From f43df0e5029702edd16fe9ca000559618d19307c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 12:21:24 +0100 Subject: [PATCH 001/216] Remove test macro --- proc-macro/src/lib.rs | 7 - proc-macro/src/test.rs | 505 ----------------------------------- proc-macro/tests/balances.rs | 25 -- 3 files changed, 537 deletions(-) delete mode 100644 proc-macro/src/test.rs diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index fee2ded501..3ca3cc82b8 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -20,7 +20,6 @@ mod call; mod event; mod module; mod store; -mod test; mod utils; use proc_macro::TokenStream; @@ -151,9 +150,3 @@ decl_derive!([Store, attributes(store)] => #[proc_macro_error] store); fn store(s: Structure) -> TokenStream { store::store(s).into() } - -#[proc_macro] -#[proc_macro_error] -pub fn subxt_test(input: TokenStream) -> TokenStream { - test::test(input.into()).into() -} diff --git a/proc-macro/src/test.rs b/proc-macro/src/test.rs deleted file mode 100644 index e0b6d78808..0000000000 --- a/proc-macro/src/test.rs +++ /dev/null @@ -1,505 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use crate::utils; -use proc_macro2::TokenStream; -use proc_macro_error::abort; -use quote::{ - format_ident, - quote, -}; -use syn::{ - parse::{ - Parse, - ParseStream, - }, - punctuated::Punctuated, -}; - -mod kw { - use syn::custom_keyword; - - custom_keyword!(name); - custom_keyword!(runtime); - custom_keyword!(account); - custom_keyword!(prelude); - custom_keyword!(step); - custom_keyword!(state); - custom_keyword!(call); - custom_keyword!(event); - custom_keyword!(assert); -} - -#[derive(Debug)] -struct Item { - key: K, - colon: syn::token::Colon, - value: V, -} - -impl Parse for Item { - fn parse(input: ParseStream) -> syn::Result { - Ok(Self { - key: input.parse()?, - colon: input.parse()?, - value: input.parse()?, - }) - } -} - -#[derive(Debug)] -struct Items { - brace: syn::token::Brace, - items: Punctuated, -} - -impl Parse for Items { - fn parse(input: ParseStream) -> syn::Result { - let content; - let brace = syn::braced!(content in input); - let items = content.parse_terminated(I::parse)?; - Ok(Self { brace, items }) - } -} - -type ItemTest = Items; - -#[derive(Debug)] -enum TestItem { - Name(Item), - Runtime(Item>), - Account(Item), - State(Item), - Prelude(Item), - Step(Item), -} - -impl Parse for TestItem { - fn parse(input: ParseStream) -> syn::Result { - if input.peek(kw::name) { - Ok(TestItem::Name(input.parse()?)) - } else if input.peek(kw::runtime) { - Ok(TestItem::Runtime(input.parse()?)) - } else if input.peek(kw::account) { - Ok(TestItem::Account(input.parse()?)) - } else if input.peek(kw::state) { - Ok(TestItem::State(input.parse()?)) - } else if input.peek(kw::prelude) { - Ok(TestItem::Prelude(input.parse()?)) - } else { - Ok(TestItem::Step(input.parse()?)) - } - } -} - -type ItemStep = Items; - -#[derive(Debug)] -enum StepItem { - State(Item), - Call(Item), - Event(Item), - Assert(Item), -} - -impl Parse for StepItem { - fn parse(input: ParseStream) -> syn::Result { - if input.peek(kw::state) { - Ok(StepItem::State(input.parse()?)) - } else if input.peek(kw::call) { - Ok(StepItem::Call(input.parse()?)) - } else if input.peek(kw::event) { - Ok(StepItem::Event(input.parse()?)) - } else { - Ok(StepItem::Assert(input.parse()?)) - } - } -} - -type ItemState = Items; -type StateItem = Item; - -struct Test { - name: syn::Ident, - runtime: Box, - account: syn::Ident, - state: Option, - prelude: Option, - steps: Vec, -} - -impl From for Test { - fn from(test: ItemTest) -> Self { - let mut name = None; - let mut runtime = None; - let mut account = None; - let mut state = None; - let mut prelude = None; - let mut steps = vec![]; - - let span = test.brace.span; - for test_item in test.items { - match test_item { - TestItem::Name(item) => { - name = Some(item.value); - } - TestItem::Runtime(item) => { - runtime = Some(item.value); - } - TestItem::Account(item) => { - account = Some(item.value); - } - TestItem::State(item) => { - state = Some(item.value.into()); - } - TestItem::Prelude(item) => { - prelude = Some(item.value); - } - TestItem::Step(item) => { - steps.push(item.value.into()); - } - } - } - let subxt = utils::use_crate("substrate-subxt"); - let runtime = runtime - .unwrap_or_else(|| syn::parse2(quote!(#subxt::DefaultNodeRuntime)).unwrap()); - Self { - name: name.unwrap_or_else(|| abort!(span, "No name specified")), - account: account.unwrap_or_else(|| format_ident!("Alice")), - runtime, - state, - prelude, - steps, - } - } -} - -impl Test { - fn into_tokens(self) -> TokenStream { - let subxt = utils::use_crate("substrate-subxt"); - let sp_keyring = utils::use_crate("sp-keyring"); - let env_logger = utils::opt_crate("env_logger") - .map(|env_logger| quote!(#env_logger::try_init().ok();)); - let Test { - name, - runtime, - account, - state, - prelude, - steps, - } = self; - let prelude = prelude.map(|block| block.stmts).unwrap_or_default(); - let step = steps - .into_iter() - .map(|step| step.into_tokens(state.as_ref())); - quote! { - #[async_std::test] - #[ignore] - async fn #name() { - #env_logger - let client = #subxt::ClientBuilder::<#runtime>::new() - .build().await.unwrap(); - let signer = #subxt::PairSigner::new(#sp_keyring::AccountKeyring::#account.pair()); - - #[allow(unused)] - let alice = #sp_keyring::AccountKeyring::Alice.to_account_id(); - #[allow(unused)] - let bob = #sp_keyring::AccountKeyring::Bob.to_account_id(); - #[allow(unused)] - let charlie = #sp_keyring::AccountKeyring::Charlie.to_account_id(); - #[allow(unused)] - let dave = #sp_keyring::AccountKeyring::Dave.to_account_id(); - #[allow(unused)] - let eve = #sp_keyring::AccountKeyring::Eve.to_account_id(); - #[allow(unused)] - let ferdie = #sp_keyring::AccountKeyring::Ferdie.to_account_id(); - - #(#prelude)* - - #({ - #step - })* - } - } - } -} - -struct Step { - state: Option, - call: syn::Expr, - event_name: Vec, - event: Vec, - assert: Option, -} - -impl From for Step { - fn from(step: ItemStep) -> Self { - let mut state = None; - let mut call = None; - let mut event_name = vec![]; - let mut event = vec![]; - let mut assert = None; - - let span = step.brace.span; - for step_item in step.items { - match step_item { - StepItem::State(item) => { - state = Some(item.value.into()); - } - StepItem::Call(item) => { - call = Some(item.value); - } - StepItem::Event(item) => { - event_name.push(struct_name(&item.value)); - event.push(item.value); - } - StepItem::Assert(item) => { - assert = Some(item.value); - } - } - } - - Self { - state, - call: call.unwrap_or_else(|| abort!(span, "Step requires a call.")), - event_name, - event, - assert, - } - } -} - -impl Step { - fn into_tokens(self, test_state: Option<&State>) -> TokenStream { - let Step { - state, - call, - event_name, - event, - assert, - } = self; - let (pre, post) = state - .as_ref() - .or(test_state) - .map(|state| { - let State { - state_name, - state, - state_param, - } = state; - let state_struct = quote! { - struct State<#(#state_param),*> { - #(#state_name: #state_param,)* - } - }; - let build_struct = quote! { - #( - let #state_name = client.fetch_or_default(#state, None).await.unwrap(); - )* - State { #(#state_name),* } - }; - let pre = quote! { - #state_struct - let pre = { - #build_struct - }; - }; - let post = quote! { - let post = { - #build_struct - }; - }; - (pre, post) - }) - .unwrap_or_default(); - let expect_event = event_name.iter().map(|event| { - format!( - "failed to find event {}", - utils::path_to_ident(event).to_string() - ) - }); - let assert = assert.map(|block| block.stmts).unwrap_or_default(); - quote! { - #pre - - #[allow(unused)] - let result = client - .watch(#call, &signer) - .await - .unwrap(); - - #( - let event = result.find_event::<#event_name<_>>().unwrap().expect(#expect_event); - assert_eq!(event, #event); - )* - - #post - - #(#assert)* - } - } -} - -struct State { - state_name: Vec, - state: Vec, - state_param: Vec, -} - -impl From for State { - fn from(item_state: ItemState) -> Self { - let mut state_name = vec![]; - let mut state = vec![]; - for item in item_state.items { - state_name.push(item.key); - state.push(item.value); - } - let state_param = (b'A'..b'Z') - .map(|c| format_ident!("{}", (c as char).to_string())) - .take(state_name.len()) - .collect::>(); - Self { - state_name, - state, - state_param, - } - } -} - -fn struct_name(expr: &syn::Expr) -> syn::Path { - if let syn::Expr::Struct(syn::ExprStruct { path, .. }) = expr { - path.clone() - } else { - abort!(expr, "Expected a struct"); - } -} - -pub fn test(input: TokenStream) -> TokenStream { - let item_test: ItemTest = - syn::parse2(input).map_err(|err| abort!("{}", err)).unwrap(); - Test::from(item_test).into_tokens() -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn transfer_test_case() { - let input = quote! {{ - name: test_transfer_balance, - runtime: KusamaRuntime, - account: Alice, - step: { - state: { - alice: AccountStore { account_id: &alice }, - bob: AccountStore { account_id: &bob }, - }, - call: TransferCall { - to: &bob, - amount: 10_000, - }, - event: TransferEvent { - from: alice.clone(), - to: bob.clone(), - amount: 10_000, - }, - assert: { - assert_eq!(pre.alice.free, post.alice.free - 10_000); - assert_eq!(pre.bob.free, post.bob.free + 10_000); - }, - }, - }}; - let expected = quote! { - #[async_std::test] - #[ignore] - async fn test_transfer_balance() { - env_logger::try_init().ok(); - let client = substrate_subxt::ClientBuilder::::new().build().await.unwrap(); - let signer = substrate_subxt::PairSigner::new(sp_keyring::AccountKeyring::Alice.pair()); - #[allow(unused)] - let alice = sp_keyring::AccountKeyring::Alice.to_account_id(); - #[allow(unused)] - let bob = sp_keyring::AccountKeyring::Bob.to_account_id(); - #[allow(unused)] - let charlie = sp_keyring::AccountKeyring::Charlie.to_account_id(); - #[allow(unused)] - let dave = sp_keyring::AccountKeyring::Dave.to_account_id(); - #[allow(unused)] - let eve = sp_keyring::AccountKeyring::Eve.to_account_id(); - #[allow(unused)] - let ferdie = sp_keyring::AccountKeyring::Ferdie.to_account_id(); - - { - struct State { - alice: A, - bob: B, - } - - let pre = { - let alice = client - .fetch_or_default(AccountStore { account_id: &alice }, None) - .await - .unwrap(); - let bob = client - .fetch_or_default(AccountStore { account_id: &bob }, None) - .await - .unwrap(); - State { alice, bob } - }; - - #[allow(unused)] - let result = client - .watch(TransferCall { - to: &bob, - amount: 10_000, - }, &signer) - .await - .unwrap(); - - let event = result.find_event::>() - .unwrap() - .expect("failed to find event TransferEvent"); - assert_eq!( - event, - TransferEvent { - from: alice.clone(), - to: bob.clone(), - amount: 10_000, - } - ); - - let post = { - let alice = client - .fetch_or_default(AccountStore { account_id: &alice }, None) - .await - .unwrap(); - let bob = client - .fetch_or_default(AccountStore { account_id: &bob }, None) - .await - .unwrap(); - State { alice, bob } - }; - - assert_eq!(pre.alice.free, post.alice.free - 10_000); - assert_eq!(pre.bob.free, post.bob.free + 10_000); - } - } - }; - let result = test(input); - utils::assert_proc_macro(result, expected); - } -} diff --git a/proc-macro/tests/balances.rs b/proc-macro/tests/balances.rs index 9dd87d8e75..cc04f24da6 100644 --- a/proc-macro/tests/balances.rs +++ b/proc-macro/tests/balances.rs @@ -80,31 +80,6 @@ impl Balances for KusamaRuntime { type Balance = u128; } -subxt_test!({ - name: transfer_test_case, - runtime: KusamaRuntime, - account: Alice, - step: { - state: { - alice: &AccountStore { account_id: &alice }, - bob: &AccountStore { account_id: &bob }, - }, - call: TransferCall { - to: &bob, - amount: 10_000, - }, - event: TransferEvent { - from: alice.clone(), - to: bob.clone(), - amount: 10_000, - }, - assert: { - assert_eq!(pre.alice.free, post.alice.free - 10_000); - assert_eq!(pre.bob.free, post.bob.free + 10_000); - }, - }, -}); - #[async_std::test] #[ignore] async fn transfer_balance_example() -> Result<(), Box> { From 01b71312eff0545477e1728b66f75c3dbaf63086 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 12:28:53 +0100 Subject: [PATCH 002/216] Remove client crate --- Cargo.toml | 4 +- client/.gitignore | 1 - client/Cargo.toml | 34 --- client/src/lib.rs | 535 ---------------------------------------------- 4 files changed, 1 insertion(+), 573 deletions(-) delete mode 100644 client/.gitignore delete mode 100644 client/Cargo.toml delete mode 100644 client/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 9db2aa202b..103cb7bcdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "client", "proc-macro"] +members = [".", "proc-macro"] [package] name = "substrate-subxt" @@ -18,7 +18,6 @@ include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE"] [features] default = ["tokio1"] -client = ["substrate-subxt-client"] # jsonrpsee can be configured to use tokio02 or tokio1. tokio02 = ["jsonrpsee-http-client/tokio02", "jsonrpsee-ws-client/tokio02"] tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] @@ -40,7 +39,6 @@ serde_json = "1.0.64" thiserror = "1.0.24" url = "2.2.1" -substrate-subxt-client = { version = "0.7.0", path = "client", optional = true } substrate-subxt-proc-macro = { version = "0.15.0", path = "proc-macro" } sp-application-crypto = "3.0.0" diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index 3005d75f6c..0000000000 --- a/client/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dev-chain.json diff --git a/client/Cargo.toml b/client/Cargo.toml deleted file mode 100644 index 1db0387241..0000000000 --- a/client/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "substrate-subxt-client" -version = "0.7.0" -authors = ["David Craven ", "Parity Technologies "] -edition = "2018" - -license = "GPL-3.0" -repository = "https://github.com/paritytech/substrate-subxt" -documentation = "https://docs.rs/substrate-subxt-client" -homepage = "https://www.parity.io/" -description = "Embed a substrate node into your subxt application." -keywords = ["parity", "substrate", "blockchain"] - -[dependencies] -async-std = "1.8.0" -futures = { version = "0.3.9", features = ["compat"], package = "futures" } -futures01 = { package = "futures", version = "0.1.29" } -jsonrpsee-types = "0.3.0" -log = "0.4.13" -serde_json = "1.0.61" -thiserror = "1.0.23" - -sc-client-db = "0.9.0" -sp-keyring = "3.0.0" -sc-network = { version = "0.9.0", default-features = false } -sc-service = { version = "0.9.0", default-features = false } - -[target.'cfg(target_arch="x86_64")'.dependencies] -sc-service = { version = "0.9.0", default-features = false, features = ["wasmtime"] } - -[dev-dependencies] -async-std = { version = "1.8.0", features = ["attributes"] } -env_logger = "0.8.2" -tempdir = "0.3.7" diff --git a/client/src/lib.rs b/client/src/lib.rs deleted file mode 100644 index 76c55a936c..0000000000 --- a/client/src/lib.rs +++ /dev/null @@ -1,535 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -//! Client for embedding substrate nodes. - -#![deny(missing_docs)] - -use async_std::{ - sync::{ - Arc, - RwLock, - }, - task, -}; -use futures::{ - channel::{ - mpsc, - oneshot, - }, - compat::Stream01CompatExt, - future::{ - select, - FutureExt, - }, - sink::SinkExt, - stream::StreamExt, -}; -use futures01::sync::mpsc as mpsc01; -use jsonrpsee_types::{ - v2::{ - error::{ - JsonRpcError, - JsonRpcErrorCode, - }, - params::{ - Id, - JsonRpcParams, - JsonRpcSubscriptionParams, - SubscriptionId, - TwoPointZero, - }, - request::{ - JsonRpcCallSer, - JsonRpcInvalidRequest, - JsonRpcNotification, - JsonRpcNotificationSer, - }, - response::JsonRpcResponse, - }, - DeserializeOwned, - Error as JsonRpseeError, - FrontToBack, - JsonValue, - RequestMessage, - Subscription, - SubscriptionKind, - SubscriptionMessage, -}; -use sc_network::config::TransportConfig; -pub use sc_service::{ - config::{ - DatabaseConfig, - KeystoreConfig, - WasmExecutionMethod, - }, - Error as ServiceError, -}; -use sc_service::{ - config::{ - NetworkConfiguration, - TaskType, - TelemetryEndpoints, - }, - ChainSpec, - Configuration, - KeepBlocks, - RpcHandlers, - RpcSession, - TaskManager, -}; -use std::{ - collections::HashMap, - sync::atomic::{ - AtomicU64, - Ordering, - }, -}; -use thiserror::Error; - -const DEFAULT_CHANNEL_SIZE: usize = 16; - -/// Error thrown by the client. -#[derive(Debug, Error)] -pub enum SubxtClientError { - /// Failed to parse json rpc message. - #[error("{0}")] - Json(#[from] serde_json::Error), - /// Channel closed. - #[error("{0}")] - Mpsc(#[from] mpsc::SendError), -} - -/// Client for an embedded substrate node. -#[derive(Clone)] -pub struct SubxtClient { - to_back: mpsc::Sender, - next_id: Arc, -} - -impl SubxtClient { - /// Create a new client. - pub fn new(mut task_manager: TaskManager, rpc: RpcHandlers) -> Self { - let (to_back, from_front) = mpsc::channel(DEFAULT_CHANNEL_SIZE); - let subscriptions = - Arc::new(RwLock::new(HashMap::::new())); - - task::spawn( - select( - Box::pin(from_front.for_each(move |message: FrontToBack| { - let rpc = rpc.clone(); - let (to_front, from_back) = mpsc01::channel(DEFAULT_CHANNEL_SIZE); - let session = RpcSession::new(to_front.clone()); - - let subscriptions = subscriptions.clone(); - - async move { - match message { - FrontToBack::Notification(raw) => { - let _ = rpc.rpc_query(&session, &raw).await; - } - FrontToBack::Request(RequestMessage { - raw, - id, - send_back, - }) => { - let raw_response = rpc.rpc_query(&session, &raw).await; - let to_front = match read_jsonrpc_response( - raw_response, - Id::Number(id), - ) { - Some(Err(e)) => Err(e), - Some(Ok(rp)) => Ok(rp), - None => return, - }; - - send_back - .expect("request should have send_back") - .send(to_front) - .expect("failed to send request response"); - } - - FrontToBack::Subscribe(SubscriptionMessage { - raw, - subscribe_id, - unsubscribe_id, - unsubscribe_method, - send_back, - }) => { - let raw_response = rpc.rpc_query(&session, &raw).await; - let sub_id: SubscriptionId = match read_jsonrpc_response( - raw_response, - Id::Number(subscribe_id), - ) { - Some(Ok(rp)) => { - serde_json::from_value(rp) - .expect("infalliable; qed") - } - Some(Err(e)) => { - send_back - .send(Err(e)) - .expect("failed to send request response"); - return - } - None => return, - }; - - let (mut send_front_sub, send_back_sub) = - mpsc::channel(DEFAULT_CHANNEL_SIZE); - - send_back - .send(Ok((send_back_sub, sub_id.clone()))) - .expect("failed to send request response"); - - { - let mut subscriptions = subscriptions.write().await; - subscriptions.insert( - sub_id.clone(), - (unsubscribe_method, Id::Number(unsubscribe_id)), - ); - } - - task::spawn(async move { - let mut from_back = from_back.compat(); - let _session = session.clone(); - - while let Some(Ok(response)) = from_back.next().await - { - let notif = serde_json::from_str::< - JsonRpcNotification< - JsonRpcSubscriptionParams<_>, - >, - >( - &response - ) - .expect("failed to decode subscription notif"); - // ignore send error since the channel is probably closed - let _ = send_front_sub - .send(notif.params.result) - .await; - } - }); - } - - FrontToBack::SubscriptionClosed(sub_id) => { - let params: &[JsonValue] = &[sub_id.clone().into()]; - - let subscriptions = subscriptions.read().await; - if let Some((unsub_method, unsub_id)) = - subscriptions.get(&sub_id) - { - let message = - serde_json::to_string(&JsonRpcCallSer::new( - unsub_id.clone(), - unsub_method, - params.into(), - )) - .unwrap(); - let _ = rpc.rpc_query(&session, &message).await; - } - } - _ => (), - } - } - })), - Box::pin(async move { - task_manager.future().await.ok(); - }), - ) - .map(drop), - ); - - Self { - to_back, - next_id: Arc::new(AtomicU64::new(0)), - } - } - - /// Creates a new client from a config. - pub fn from_config( - config: SubxtClientConfig, - builder: impl Fn(Configuration) -> Result<(TaskManager, RpcHandlers), ServiceError>, - ) -> Result { - let config = config.into_service_config(); - let (task_manager, rpc_handlers) = (builder)(config)?; - Ok(Self::new(task_manager, rpc_handlers)) - } - - /// Send a JSONRPC notification. - pub async fn notification<'a>( - &self, - method: &'a str, - params: JsonRpcParams<'a>, - ) -> Result<(), JsonRpseeError> { - let msg = serde_json::to_string(&JsonRpcNotificationSer::new(method, params)) - .map_err(JsonRpseeError::ParseError)?; - self.to_back - .clone() - .send(FrontToBack::Notification(msg)) - .await - .map_err(|e| JsonRpseeError::Transport(Box::new(e))) - } - - /// Send a JSONRPC request. - pub async fn request<'a, T>( - &self, - method: &'a str, - params: JsonRpcParams<'a>, - ) -> Result - where - T: DeserializeOwned, - { - let (send_back_tx, send_back_rx) = oneshot::channel(); - - let id = self.next_id.fetch_add(1, Ordering::Relaxed); - let msg = - serde_json::to_string(&JsonRpcCallSer::new(Id::Number(id), method, params)) - .map_err(JsonRpseeError::ParseError)?; - self.to_back - .clone() - .send(FrontToBack::Request(RequestMessage { - raw: msg, - id, - send_back: Some(send_back_tx), - })) - .await - .map_err(|e| JsonRpseeError::Transport(Box::new(e)))?; - - let json_value = match send_back_rx.await { - Ok(Ok(v)) => v, - Ok(Err(err)) => return Err(err), - Err(err) => return Err(JsonRpseeError::Transport(Box::new(err))), - }; - serde_json::from_value(json_value).map_err(JsonRpseeError::ParseError) - } - - /// Send a subscription request to the server. - pub async fn subscribe<'a, N>( - &self, - subscribe_method: &'a str, - params: JsonRpcParams<'a>, - unsubscribe_method: &'a str, - ) -> Result, JsonRpseeError> - where - N: DeserializeOwned, - { - let sub_req_id = self.next_id.fetch_add(1, Ordering::Relaxed); - let unsub_req_id = self.next_id.fetch_add(1, Ordering::Relaxed); - let msg = serde_json::to_string(&JsonRpcCallSer::new( - Id::Number(sub_req_id), - subscribe_method, - params, - )) - .map_err(JsonRpseeError::ParseError)?; - - let (send_back_tx, send_back_rx) = oneshot::channel(); - self.to_back - .clone() - .send(FrontToBack::Subscribe(SubscriptionMessage { - raw: msg, - subscribe_id: sub_req_id, - unsubscribe_id: unsub_req_id, - unsubscribe_method: unsubscribe_method.to_owned(), - send_back: send_back_tx, - })) - .await - .map_err(JsonRpseeError::Internal)?; - - let (notifs_rx, id) = match send_back_rx.await { - Ok(Ok(val)) => val, - Ok(Err(err)) => return Err(err), - Err(err) => return Err(JsonRpseeError::Transport(Box::new(err))), - }; - Ok(Subscription::new( - self.to_back.clone(), - notifs_rx, - SubscriptionKind::Subscription(id), - )) - } -} - -/// Role of the node. -#[derive(Clone, Copy, Debug)] -pub enum Role { - /// Light client. - Light, - /// A full node (mainly used for testing purposes). - Authority(sp_keyring::AccountKeyring), -} - -impl From for sc_service::Role { - fn from(role: Role) -> Self { - match role { - Role::Light => Self::Light, - Role::Authority(_) => { - Self::Authority { - sentry_nodes: Default::default(), - } - } - } - } -} - -impl From for Option { - fn from(role: Role) -> Self { - match role { - Role::Light => None, - Role::Authority(key) => Some(key.to_seed()), - } - } -} - -/// Client configuration. -#[derive(Clone)] -pub struct SubxtClientConfig { - /// Name of the implementation. - pub impl_name: &'static str, - /// Version of the implementation. - pub impl_version: &'static str, - /// Author of the implementation. - pub author: &'static str, - /// Copyright start year. - pub copyright_start_year: i32, - /// Database configuration. - pub db: DatabaseConfig, - /// Keystore configuration. - pub keystore: KeystoreConfig, - /// Chain specification. - pub chain_spec: C, - /// Role of the node. - pub role: Role, - /// Enable telemetry on the given port. - pub telemetry: Option, - /// Wasm execution method - pub wasm_method: WasmExecutionMethod, -} - -impl SubxtClientConfig { - /// Creates a service configuration. - pub fn into_service_config(self) -> Configuration { - let mut network = NetworkConfiguration::new( - format!("{} (subxt client)", self.chain_spec.name()), - "unknown", - Default::default(), - None, - ); - network.boot_nodes = self.chain_spec.boot_nodes().to_vec(); - network.transport = TransportConfig::Normal { - enable_mdns: true, - allow_private_ipv4: true, - wasm_external_transport: None, - }; - let telemetry_endpoints = if let Some(port) = self.telemetry { - let endpoints = TelemetryEndpoints::new(vec![( - format!("/ip4/127.0.0.1/tcp/{}/ws", port), - 0, - )]) - .expect("valid config; qed"); - Some(endpoints) - } else { - None - }; - let service_config = Configuration { - network, - impl_name: self.impl_name.to_string(), - impl_version: self.impl_version.to_string(), - chain_spec: Box::new(self.chain_spec), - role: self.role.into(), - task_executor: (move |fut, ty| { - match ty { - TaskType::Async => task::spawn(fut), - TaskType::Blocking => task::spawn_blocking(|| task::block_on(fut)), - } - }) - .into(), - database: self.db, - keystore: self.keystore, - max_runtime_instances: 8, - announce_block: true, - dev_key_seed: self.role.into(), - telemetry_endpoints, - - telemetry_external_transport: Default::default(), - telemetry_handle: Default::default(), - telemetry_span: Default::default(), - default_heap_pages: Default::default(), - disable_grandpa: Default::default(), - disable_log_reloading: Default::default(), - execution_strategies: Default::default(), - force_authoring: Default::default(), - keep_blocks: KeepBlocks::All, - keystore_remote: Default::default(), - offchain_worker: Default::default(), - prometheus_config: Default::default(), - rpc_cors: Default::default(), - rpc_http: Default::default(), - rpc_ipc: Default::default(), - rpc_ws: Default::default(), - rpc_ws_max_connections: Default::default(), - rpc_methods: Default::default(), - state_cache_child_ratio: Default::default(), - state_cache_size: Default::default(), - tracing_receiver: Default::default(), - tracing_targets: Default::default(), - transaction_pool: Default::default(), - wasm_method: self.wasm_method, - base_path: Default::default(), - informant_output_format: Default::default(), - state_pruning: Default::default(), - transaction_storage: sc_client_db::TransactionStorageMode::BlockBody, - wasm_runtime_overrides: Default::default(), - }; - - log::info!("{}", service_config.impl_name); - log::info!("✌️ version {}", service_config.impl_version); - log::info!("❤️ by {}, {}", self.author, self.copyright_start_year); - log::info!( - "📋 Chain specification: {}", - service_config.chain_spec.name() - ); - log::info!("🏷 Node name: {}", service_config.network.node_name); - log::info!("👤 Role: {:?}", self.role); - - service_config - } -} - -fn read_jsonrpc_response( - maybe_msg: Option, - id: Id, -) -> Option> { - let msg: String = maybe_msg?; - // NOTE: `let res` is a workaround because rustc otherwise doesn't compile - // `msg` doesn't live long enough. - let res = match serde_json::from_str::>(&msg) { - Ok(rp) if rp.id == id => Some(Ok(rp.result)), - Ok(_) => Some(Err(JsonRpseeError::InvalidRequestId)), - Err(_) => { - match serde_json::from_str::>(&msg) { - Ok(err) => { - let err = JsonRpcError { - jsonrpc: TwoPointZero, - error: JsonRpcErrorCode::InvalidRequest.into(), - id: err.id, - }; - Some(Err(JsonRpseeError::Request(err.to_string()))) - } - Err(_) => None, - } - } - }; - res -} From ff6b9fc731fb4414c2061bc05e5b1c6b343c69cd Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 13:02:26 +0100 Subject: [PATCH 003/216] Create tests crate and move pallet specific tests there --- Cargo.toml | 9 +- proc-macro/Cargo.toml | 4 - proc-macro/tests/balances.rs | 120 ----- src/frame/mod.rs | 71 --- src/lib.rs | 4 - src/runtimes.rs | 456 ------------------ tests/Cargo.toml | 15 + src/tests/mod.rs => tests/src/lib.rs | 0 .../src/node-runtime}/balances.rs | 0 .../src/node-runtime}/contracts.rs | 0 .../src/node-runtime}/session.rs | 0 .../src/node-runtime}/staking.rs | 0 {src/frame => tests/src/node-runtime}/sudo.rs | 0 .../src/node-runtime}/system.rs | 0 {src/tests => tests/src}/node_proc.rs | 0 15 files changed, 17 insertions(+), 662 deletions(-) delete mode 100644 proc-macro/tests/balances.rs delete mode 100644 src/frame/mod.rs delete mode 100644 src/runtimes.rs create mode 100644 tests/Cargo.toml rename src/tests/mod.rs => tests/src/lib.rs (100%) rename {src/frame => tests/src/node-runtime}/balances.rs (100%) rename {src/frame => tests/src/node-runtime}/contracts.rs (100%) rename {src/frame => tests/src/node-runtime}/session.rs (100%) rename {src/frame => tests/src/node-runtime}/staking.rs (100%) rename {src/frame => tests/src/node-runtime}/sudo.rs (100%) rename {src/frame => tests/src/node-runtime}/system.rs (100%) rename {src/tests => tests/src}/node_proc.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 103cb7bcdc..4c36973741 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "proc-macro"] +members = [".", "proc-macro", "tests"] [package] name = "substrate-subxt" @@ -41,17 +41,12 @@ url = "2.2.1" substrate-subxt-proc-macro = { version = "0.15.0", path = "proc-macro" } -sp-application-crypto = "3.0.0" sp-core = "3.0.0" sp-rpc = "3.0.0" sp-runtime = "3.0.0" -sp-std = "3.0.0" sp-version = "3.0.0" -frame-metadata = "13.0.0" -frame-support = "3.0.0" -pallet-indices = "3.0.0" -pallet-staking = "3.0.0" +frame-metadata = "14.0.0-rc.2" [dev-dependencies] assert_matches = "1.5.0" diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index 721291be29..fea1452006 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -33,7 +33,3 @@ substrate-subxt = { path = ".." } trybuild = "1.0.38" sp-keyring = "3.0.0" - -[[test]] -name = "balances" -path = "tests/balances.rs" diff --git a/proc-macro/tests/balances.rs b/proc-macro/tests/balances.rs deleted file mode 100644 index cc04f24da6..0000000000 --- a/proc-macro/tests/balances.rs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -#[macro_use] -extern crate substrate_subxt; - -use codec::{ - Codec, - Decode, - Encode, -}; -use sp_keyring::AccountKeyring; -use std::fmt::Debug; -use substrate_subxt::{ - sp_runtime::traits::{ - AtLeast32Bit, - MaybeSerialize, - Member, - }, - system::System, - ClientBuilder, - KusamaRuntime, - PairSigner, -}; - -#[module] -pub trait Balances: System { - type Balance: Member - + AtLeast32Bit - + Codec - + Default - + Copy - + MaybeSerialize - + Debug - + From<::BlockNumber>; -} - -#[derive(Clone, Decode, Default)] -pub struct AccountData { - pub free: Balance, - pub reserved: Balance, - pub misc_frozen: Balance, - pub fee_frozen: Balance, -} - -#[derive(Encode, Store)] -pub struct AccountStore<'a, T: Balances> { - #[store(returns = AccountData)] - pub account_id: &'a ::AccountId, -} - -#[derive(Call, Encode)] -pub struct TransferCall<'a, T: Balances> { - pub to: &'a ::Address, - #[codec(compact)] - pub amount: T::Balance, -} - -#[derive(Debug, Decode, Eq, Event, PartialEq)] -pub struct TransferEvent { - pub from: ::AccountId, - pub to: ::AccountId, - pub amount: T::Balance, -} - -impl Balances for KusamaRuntime { - type Balance = u128; -} - -#[async_std::test] -#[ignore] -async fn transfer_balance_example() -> Result<(), Box> { - env_logger::init(); - let client = ClientBuilder::::new().build().await?; - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let alice = AccountKeyring::Alice.to_account_id(); - let bob = AccountKeyring::Bob.to_account_id(); - - let alice_account = client.account(&alice, None).await?; - let bob_account = client.account(&bob, None).await?; - let pre = (alice_account, bob_account); - - let _hash = client - .transfer(&signer, &bob.clone().into(), 10_000) - .await?; - - let result = client - .transfer_and_watch(&signer, &bob.clone().into(), 10_000) - .await?; - - assert_eq!( - result.transfer()?, - Some(TransferEvent { - from: alice.clone(), - to: bob.clone(), - amount: 10_000, - }) - ); - - let alice_account = client.account(&alice, None).await?; - let bob_account = client.account(&bob, None).await?; - let post = (alice_account, bob_account); - - assert_eq!(pre.0.free, post.0.free - 10_000); - assert_eq!(pre.1.free, post.1.free + 10_000); - Ok(()) -} diff --git a/src/frame/mod.rs b/src/frame/mod.rs deleted file mode 100644 index 3f5781f098..0000000000 --- a/src/frame/mod.rs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -//! Implements support for built-in runtime modules. - -use crate::metadata::{ - Metadata, - MetadataError, -}; -use codec::{ - Decode, - Encode, -}; -use sp_core::storage::StorageKey; - -pub mod balances; -pub mod contracts; -pub mod session; -pub mod staking; -pub mod sudo; -pub mod system; - -/// Store trait. -pub trait Store: Encode { - /// Module name. - const MODULE: &'static str; - /// Field name. - const FIELD: &'static str; - /// Return type. - type Returns: Decode; - /// Returns the key prefix for storage maps - fn prefix(metadata: &Metadata) -> Result; - /// Returns the `StorageKey`. - fn key(&self, metadata: &Metadata) -> Result; - /// Returns the default value. - fn default(&self, metadata: &Metadata) -> Result { - Ok(metadata - .module(Self::MODULE)? - .storage(Self::FIELD)? - .default()?) - } -} - -/// Call trait. -pub trait Call: Encode { - /// Module name. - const MODULE: &'static str; - /// Function name. - const FUNCTION: &'static str; -} - -/// Event trait. -pub trait Event: Decode { - /// Module name. - const MODULE: &'static str; - /// Event name. - const EVENT: &'static str; -} diff --git a/src/lib.rs b/src/lib.rs index 961056e445..f6353c10fa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,13 +72,9 @@ use std::{ mod error; mod events; pub mod extrinsic; -mod frame; mod metadata; mod rpc; -mod runtimes; mod subscription; -#[cfg(test)] -mod tests; pub use crate::{ error::{ diff --git a/src/runtimes.rs b/src/runtimes.rs deleted file mode 100644 index 515c6d4248..0000000000 --- a/src/runtimes.rs +++ /dev/null @@ -1,456 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use codec::Encode; -use sp_runtime::{ - generic::Header, - impl_opaque_keys, - traits::{ - BlakeTwo256, - IdentifyAccount, - Verify, - }, - MultiSignature, - OpaqueExtrinsic, -}; -use sp_std::prelude::*; - -/// BABE marker struct -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub struct Babe; - -/// Application specific crypto types -/// -/// # Note -/// -/// These are redefined here to avoid dependencies on the substrate creates where they are defined. -/// They must be identical to the definitions in the target substrate version. -pub mod app { - use sp_application_crypto::{ - app_crypto, - ed25519, - key_types, - sr25519, - }; - - /// Authority discovery app crypto types - pub mod authority_discovery { - use super::*; - app_crypto!(sr25519, key_types::AUTHORITY_DISCOVERY); - } - /// Babe app crypto types - pub mod babe { - use super::*; - app_crypto!(sr25519, key_types::BABE); - } - /// Im online discovery app crypto types - pub mod im_online { - use super::*; - app_crypto!(ed25519, key_types::IM_ONLINE); - } - /// Grandpa app crypto types - pub mod grandpa { - use super::*; - app_crypto!(ed25519, key_types::GRANDPA); - } - /// Validator app crypto types - pub mod validator { - use super::*; - app_crypto!(ed25519, sp_core::crypto::KeyTypeId(*b"para")); - } -} - -impl sp_runtime::BoundToRuntimeAppPublic for Babe { - type Public = app::babe::Public; -} - -/// ImOnline marker struct -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub struct ImOnline; -impl sp_runtime::BoundToRuntimeAppPublic for ImOnline { - type Public = app::im_online::Public; -} - -/// GRANDPA marker struct -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub struct Grandpa; -impl sp_runtime::BoundToRuntimeAppPublic for Grandpa { - type Public = app::grandpa::Public; -} - -/// Parachain marker struct -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub struct Parachains; - -impl sp_runtime::BoundToRuntimeAppPublic for Parachains { - type Public = app::validator::Public; -} - -/// Authority discovery marker struct -#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub struct AuthorityDiscovery; -impl sp_runtime::BoundToRuntimeAppPublic for AuthorityDiscovery { - type Public = app::authority_discovery::Public; -} - -impl_opaque_keys! { - /// Substrate base runtime keys - pub struct BasicSessionKeys { - /// GRANDPA session key - pub grandpa: Grandpa, - /// BABE session key - pub babe: Babe, - /// ImOnline session key - pub im_online: ImOnline, - /// Parachain validation session key - pub parachains: Parachains, - /// AuthorityDiscovery session key - pub authority_discovery: AuthorityDiscovery, - } -} - -impl_opaque_keys! { - /// Polkadot/Kusama runtime keys - pub struct SessionKeys { - /// GRANDPA session key - pub grandpa: Grandpa, - /// BABE session key - pub babe: Babe, - /// ImOnline session key - pub im_online: ImOnline, - /// ParachainValidator session key - pub parachain_validator: Parachains, - /// AuthorityDiscovery session key - pub authority_discovery: AuthorityDiscovery, - } -} - -use crate::{ - extrinsic::{ - DefaultExtra, - SignedExtra, - }, - frame::{ - balances::{ - AccountData, - Balances, - BalancesEventTypeRegistry, - }, - contracts::{ - Contracts, - ContractsEventTypeRegistry, - }, - session::{ - Session, - SessionEventTypeRegistry, - }, - staking::{ - Staking, - StakingEventTypeRegistry, - }, - sudo::{ - Sudo, - SudoEventTypeRegistry, - }, - system::{ - System, - SystemEventTypeRegistry, - }, - }, - EventTypeRegistry, -}; - -/// Runtime trait. -pub trait Runtime: System + Sized + Send + Sync + 'static { - /// Signature type. - type Signature: Verify + Encode + Send + Sync + 'static; - /// Transaction extras. - type Extra: SignedExtra + Send + Sync + 'static; - - /// Register type sizes for this runtime - fn register_type_sizes(event_type_registry: &mut EventTypeRegistry); -} - -/// Concrete type definitions compatible with those in the default substrate `node_runtime` -/// -/// # Note -/// -/// If the concrete types in the target substrate runtime differ from these, a custom Runtime -/// definition MUST be used to ensure type compatibility. -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct DefaultNodeRuntime; - -impl Staking for DefaultNodeRuntime {} - -impl Runtime for DefaultNodeRuntime { - type Signature = MultiSignature; - type Extra = DefaultExtra; - - fn register_type_sizes(event_type_registry: &mut EventTypeRegistry) { - event_type_registry.with_system(); - event_type_registry.with_balances(); - event_type_registry.with_session(); - event_type_registry.with_staking(); - event_type_registry.with_contracts(); - event_type_registry.with_sudo(); - register_default_type_sizes(event_type_registry); - } -} - -impl System for DefaultNodeRuntime { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; - type AccountId = <::Signer as IdentifyAccount>::AccountId; - type Address = sp_runtime::MultiAddress; - type Header = Header; - type Extrinsic = OpaqueExtrinsic; - type AccountData = AccountData<::Balance>; -} - -impl Balances for DefaultNodeRuntime { - type Balance = u128; -} - -impl Session for DefaultNodeRuntime { - type ValidatorId = ::AccountId; - type Keys = BasicSessionKeys; -} - -impl Contracts for DefaultNodeRuntime {} - -impl Sudo for DefaultNodeRuntime {} - -/// Concrete type definitions compatible with the node template. -/// -/// # Note -/// -/// Main difference is `type Address = AccountId`. -/// Also the contracts module is not part of the node template runtime. -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct NodeTemplateRuntime; - -impl Runtime for NodeTemplateRuntime { - type Signature = MultiSignature; - type Extra = DefaultExtra; - - fn register_type_sizes(event_type_registry: &mut EventTypeRegistry) { - event_type_registry.with_system(); - event_type_registry.with_balances(); - event_type_registry.with_session(); - event_type_registry.with_sudo(); - register_default_type_sizes(event_type_registry); - } -} - -impl System for NodeTemplateRuntime { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; - type AccountId = <::Signer as IdentifyAccount>::AccountId; - type Address = sp_runtime::MultiAddress; - type Header = Header; - type Extrinsic = OpaqueExtrinsic; - type AccountData = AccountData<::Balance>; -} - -impl Balances for NodeTemplateRuntime { - type Balance = u128; -} - -impl Session for NodeTemplateRuntime { - type ValidatorId = ::AccountId; - type Keys = BasicSessionKeys; -} - -impl Sudo for NodeTemplateRuntime {} - -/// Concrete type definitions compatible with the node template, with the -/// contracts pallet enabled. -/// -/// Inherits types from [`NodeTemplateRuntime`], but adds an implementation for -/// the contracts pallet trait. -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct ContractsTemplateRuntime; - -impl Runtime for ContractsTemplateRuntime { - type Signature = ::Signature; - type Extra = DefaultExtra; - - fn register_type_sizes(event_type_registry: &mut EventTypeRegistry) { - event_type_registry.with_system(); - event_type_registry.with_balances(); - event_type_registry.with_contracts(); - event_type_registry.with_sudo(); - register_default_type_sizes(event_type_registry); - } -} - -impl System for ContractsTemplateRuntime { - type Index = ::Index; - type BlockNumber = ::BlockNumber; - type Hash = ::Hash; - type Hashing = ::Hashing; - type AccountId = ::AccountId; - type Address = ::Address; - type Header = ::Header; - type Extrinsic = ::Extrinsic; - type AccountData = ::AccountData; -} - -impl Balances for ContractsTemplateRuntime { - type Balance = ::Balance; -} - -impl Contracts for ContractsTemplateRuntime {} - -impl Sudo for ContractsTemplateRuntime {} - -/// Concrete type definitions compatible with those for kusama, v0.7 -/// -/// # Note -/// -/// Main difference is `type Address = AccountId`. -/// Also the contracts module is not part of the kusama runtime. -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct KusamaRuntime; - -impl Runtime for KusamaRuntime { - type Signature = MultiSignature; - type Extra = DefaultExtra; - - fn register_type_sizes(event_type_registry: &mut EventTypeRegistry) { - event_type_registry.with_system(); - event_type_registry.with_balances(); - event_type_registry.with_session(); - event_type_registry.with_staking(); - register_default_type_sizes(event_type_registry); - } -} - -impl System for KusamaRuntime { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; - type AccountId = <::Signer as IdentifyAccount>::AccountId; - type Address = Self::AccountId; - type Header = Header; - type Extrinsic = OpaqueExtrinsic; - type AccountData = AccountData<::Balance>; -} - -impl Session for KusamaRuntime { - type ValidatorId = ::AccountId; - type Keys = SessionKeys; -} - -impl Staking for KusamaRuntime {} - -impl Balances for KusamaRuntime { - type Balance = u128; -} - -/// Identity of a Grandpa authority. -pub type AuthorityId = crate::runtimes::app::grandpa::Public; -/// The weight of an authority. -pub type AuthorityWeight = u64; -/// A list of Grandpa authorities with associated weights. -pub type AuthorityList = Vec<(AuthorityId, AuthorityWeight)>; - -/// Register default common runtime type sizes -pub fn register_default_type_sizes( - event_type_registry: &mut EventTypeRegistry, -) { - // for types which have all variants with no data, the size is just the index byte. - type CLikeEnum = u8; - - // primitives - event_type_registry.register_type_size::("bool"); - event_type_registry.register_type_size::("u8"); - event_type_registry.register_type_size::("u16"); - event_type_registry.register_type_size::("u32"); - event_type_registry.register_type_size::("u64"); - event_type_registry.register_type_size::("u128"); - - event_type_registry.register_type_size::<()>("PhantomData"); - event_type_registry - .register_type_size::<()>("sp_std::marker::PhantomData<(AccountId, Event)>"); - - // frame_support types - event_type_registry - .register_type_size::("DispatchInfo"); - event_type_registry - .register_type_size::("DispatchResult"); - event_type_registry - .register_type_size::("DispatchError"); - event_type_registry - .register_type_size::("Status"); - - // aliases etc. - event_type_registry.register_type_size::("ReferendumIndex"); - event_type_registry.register_type_size::<[u8; 16]>("Kind"); - - event_type_registry.register_type_size::("AccountIndex"); - event_type_registry.register_type_size::("AssetId"); - event_type_registry.register_type_size::("BountyIndex"); - event_type_registry.register_type_size::<(u8, u8)>("CallIndex"); - event_type_registry.register_type_size::<[u8; 32]>("CallHash"); - event_type_registry.register_type_size::("PropIndex"); - event_type_registry.register_type_size::("ProposalIndex"); - event_type_registry.register_type_size::("ProxyType"); - event_type_registry.register_type_size::("AuthorityIndex"); - event_type_registry.register_type_size::("MemberCount"); - event_type_registry.register_type_size::("RegistrarIndex"); - - event_type_registry.register_type_size::("VoteThreshold"); - event_type_registry - .register_type_size::<(T::BlockNumber, u32)>("TaskAddress"); - event_type_registry - .register_type_size::<(T::BlockNumber, u32)>("Timepoint"); - - event_type_registry.register_type_size::("AuthorityId"); - event_type_registry.register_type_size::("AuthorityWeight"); - event_type_registry - .register_type_size::>("AuthorityList"); -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn can_register_default_runtime_type_sizes() { - EventTypeRegistry::::new(); - } - - #[test] - fn can_register_node_template_runtime_type_sizes() { - EventTypeRegistry::::new(); - } - - #[test] - fn can_register_contracts_template_runtime_type_sizes() { - EventTypeRegistry::::new(); - } - - #[test] - fn can_register_kusama_runtime_type_sizes() { - EventTypeRegistry::::new(); - } -} diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 0000000000..78763d9cd1 --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "tests" +version = "0.1.0" +edition = "2018" + +[dependencies] +assert_matches = "1.5.0" +async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } +env_logger = "0.8.3" +tempdir = "0.3.7" +wabt = "0.10.0" +which = "4.0.2" +sp-keyring = "3.0.0" +frame-system = "3.0.0" +pallet-balances = "3.0.0" \ No newline at end of file diff --git a/src/tests/mod.rs b/tests/src/lib.rs similarity index 100% rename from src/tests/mod.rs rename to tests/src/lib.rs diff --git a/src/frame/balances.rs b/tests/src/node-runtime/balances.rs similarity index 100% rename from src/frame/balances.rs rename to tests/src/node-runtime/balances.rs diff --git a/src/frame/contracts.rs b/tests/src/node-runtime/contracts.rs similarity index 100% rename from src/frame/contracts.rs rename to tests/src/node-runtime/contracts.rs diff --git a/src/frame/session.rs b/tests/src/node-runtime/session.rs similarity index 100% rename from src/frame/session.rs rename to tests/src/node-runtime/session.rs diff --git a/src/frame/staking.rs b/tests/src/node-runtime/staking.rs similarity index 100% rename from src/frame/staking.rs rename to tests/src/node-runtime/staking.rs diff --git a/src/frame/sudo.rs b/tests/src/node-runtime/sudo.rs similarity index 100% rename from src/frame/sudo.rs rename to tests/src/node-runtime/sudo.rs diff --git a/src/frame/system.rs b/tests/src/node-runtime/system.rs similarity index 100% rename from src/frame/system.rs rename to tests/src/node-runtime/system.rs diff --git a/src/tests/node_proc.rs b/tests/src/node_proc.rs similarity index 100% rename from src/tests/node_proc.rs rename to tests/src/node_proc.rs From d7c1d2295b5bc0ca543267d85b9a30197feb544c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 15:50:52 +0100 Subject: [PATCH 004/216] Extract client, remove metadata and extra, more demolition --- Cargo.toml | 3 +- src/client.rs | 551 +++++++++++++++++++++++++++++++++ src/error.rs | 18 -- src/events.rs | 297 ++++-------------- src/extrinsic/extra.rs | 311 ------------------- src/extrinsic/mod.rs | 1 - src/lib.rs | 550 +-------------------------------- src/metadata.rs | 677 ----------------------------------------- tests/Cargo.toml | 2 + tests/src/lib.rs | 1 - tests/src/node_proc.rs | 2 +- 11 files changed, 624 insertions(+), 1789 deletions(-) create mode 100644 src/client.rs delete mode 100644 src/extrinsic/extra.rs delete mode 100644 src/metadata.rs diff --git a/Cargo.toml b/Cargo.toml index 4c36973741..3f36c31e2c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,6 +25,7 @@ tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] [dependencies] async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "2.1", default-features = false, features = ["derive", "full"] } +scale-info = "0.12.0" dyn-clone = "1.0.4" futures = "0.3.13" hex = "0.4.3" @@ -46,7 +47,7 @@ sp-rpc = "3.0.0" sp-runtime = "3.0.0" sp-version = "3.0.0" -frame-metadata = "14.0.0-rc.2" +frame-metadata = { git = "https://github.com/paritytech/frame-metadata/" } [dev-dependencies] assert_matches = "1.5.0" diff --git a/src/client.rs b/src/client.rs new file mode 100644 index 0000000000..d225a5c188 --- /dev/null +++ b/src/client.rs @@ -0,0 +1,551 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use codec::{ + Codec, + Decode, +}; +pub use frame_metadata::RuntimeMetadataLastVersion as Metadata; +use futures::future; +use jsonrpsee_http_client::HttpClientBuilder; +use jsonrpsee_types::Subscription; +use jsonrpsee_ws_client::WsClientBuilder; +use sp_core::{ + storage::{ + StorageChangeSet, + StorageData, + StorageKey, + }, + Bytes, +}; +pub use sp_runtime::traits::SignedExtension; +pub use sp_version::RuntimeVersion; +use std::{ + marker::PhantomData, + sync::Arc, +}; + +use crate::{ + Error, + events::EventsDecoder, + extrinsic::{ + PairSigner, + SignedExtra, + Signer, + UncheckedExtrinsic, + }, + rpc::{ + ChainBlock, + Rpc, + RpcClient, + SystemProperties, + }, + subscription::{ + EventStorageSubscription, + EventSubscription, + FinalizedEventStorageSubscription, + }, +}; + +/// ClientBuilder for constructing a Client. +#[derive(Default)] +pub struct ClientBuilder { + url: Option, + client: Option, + page_size: Option, + skip_type_sizes_check: bool, + accept_weak_inclusion: bool, +} + +impl ClientBuilder { + /// Creates a new ClientBuilder. + pub fn new() -> Self { + Self { + url: None, + client: None, + page_size: None, + skip_type_sizes_check: false, + accept_weak_inclusion: false, + } + } + + /// Sets the jsonrpsee client. + pub fn set_client>(mut self, client: C) -> Self { + self.client = Some(client.into()); + self + } + + /// Set the substrate rpc address. + pub fn set_url>(mut self, url: P) -> Self { + self.url = Some(url.into()); + self + } + + /// Set the page size. + pub fn set_page_size(mut self, size: u32) -> Self { + self.page_size = Some(size); + self + } + + /// Only check that transactions are InBlock on submit. + pub fn accept_weak_inclusion(mut self) -> Self { + self.accept_weak_inclusion = true; + self + } + + /// Creates a new Client. + pub async fn build<'a>(self) -> Result, Error> { + let client = if let Some(client) = self.client { + client + } else { + let url = self.url.as_deref().unwrap_or("ws://127.0.0.1:9944"); + if url.starts_with("ws://") || url.starts_with("wss://") { + let client = WsClientBuilder::default() + .max_notifs_per_subscription(4096) + .build(url) + .await?; + RpcClient::WebSocket(Arc::new(client)) + } else { + let client = HttpClientBuilder::default().build(&url)?; + RpcClient::Http(Arc::new(client)) + } + }; + let mut rpc = Rpc::new(client); + if self.accept_weak_inclusion { + rpc.accept_weak_inclusion(); + } + let (metadata, genesis_hash, runtime_version, properties) = future::join4( + rpc.metadata(), + rpc.genesis_hash(), + rpc.runtime_version(None), + rpc.system_properties(), + ) + .await; + let metadata = metadata?; + + let events_decoder = + EventsDecoder::new(metadata.clone()); + + Ok(Client { + rpc, + genesis_hash: genesis_hash?, + metadata, + events_decoder, + properties: properties.unwrap_or_else(|_| Default::default()), + runtime_version: runtime_version?, + _marker: PhantomData, + page_size: self.page_size.unwrap_or(10), + }) + } +} + +/// Client to interface with a substrate node. +pub struct Client { + rpc: Rpc, + genesis_hash: T::Hash, + metadata: Metadata, + events_decoder: EventsDecoder, + properties: SystemProperties, + runtime_version: RuntimeVersion, + _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, + page_size: u32, +} + +impl Clone for Client { + fn clone(&self) -> Self { + Self { + rpc: self.rpc.clone(), + genesis_hash: self.genesis_hash, + metadata: self.metadata.clone(), + events_decoder: self.events_decoder.clone(), + properties: self.properties.clone(), + runtime_version: self.runtime_version.clone(), + _marker: PhantomData, + page_size: self.page_size, + } + } +} + +/// Iterates over key value pairs in a map. +pub struct KeyIter> { + client: Client, + _marker: PhantomData, + count: u32, + hash: T::Hash, + start_key: Option, + buffer: Vec<(StorageKey, StorageData)>, +} + +impl> KeyIter { + /// Returns the next key value pair from a map. + pub async fn next(&mut self) -> Result, Error> { + loop { + if let Some((k, v)) = self.buffer.pop() { + return Ok(Some((k, Decode::decode(&mut &v.0[..])?))) + } else { + let keys = self + .client + .fetch_keys::(self.count, self.start_key.take(), Some(self.hash)) + .await?; + + if keys.is_empty() { + return Ok(None) + } + + self.start_key = keys.last().cloned(); + + let change_sets = self + .client + .rpc + .query_storage_at(&keys, Some(self.hash)) + .await?; + for change_set in change_sets { + for (k, v) in change_set.changes { + if let Some(v) = v { + self.buffer.push((k, v)); + } + } + } + debug_assert_eq!(self.buffer.len(), keys.len()); + } + } + } +} + +impl Client { + /// Returns the genesis hash. + pub fn genesis(&self) -> &T::Hash { + &self.genesis_hash + } + + /// Returns the chain metadata. + pub fn metadata(&self) -> &Metadata { + &self.metadata + } + + /// Returns the system properties + pub fn properties(&self) -> &SystemProperties { + &self.properties + } + + /// Returns the rpc client. + pub fn rpc_client(&self) -> &RpcClient { + &self.rpc.client + } + + /// Fetch the value under an unhashed storage key + pub async fn fetch_unhashed( + &self, + key: StorageKey, + hash: Option, + ) -> Result, Error> { + if let Some(data) = self.rpc.storage(&key, hash).await? { + Ok(Some(Decode::decode(&mut &data.0[..])?)) + } else { + Ok(None) + } + } + + // /// Fetch a StorageKey with an optional block hash. + // pub async fn fetch>( + // &self, + // store: &F, + // hash: Option, + // ) -> Result, Error> { + // let key = store.key(&self.metadata)?; + // self.fetch_unhashed::(key, hash).await + // } + // + // /// Fetch a StorageKey that has a default value with an optional block hash. + // pub async fn fetch_or_default>( + // &self, + // store: &F, + // hash: Option, + // ) -> Result { + // if let Some(data) = self.fetch(store, hash).await? { + // Ok(data) + // } else { + // Ok(store.default(&self.metadata)?) + // } + // } + + /// Returns an iterator of key value pairs. + pub async fn iter>( + &self, + hash: Option, + ) -> Result, Error> { + let hash = if let Some(hash) = hash { + hash + } else { + self.block_hash(None) + .await? + .expect("didn't pass a block number; qed") + }; + Ok(KeyIter { + client: self.clone(), + hash, + count: self.page_size, + start_key: None, + buffer: Default::default(), + _marker: PhantomData, + }) + } + + // /// Fetch up to `count` keys for a storage map in lexicographic order. + // /// + // /// Supports pagination by passing a value to `start_key`. + // pub async fn fetch_keys>( + // &self, + // count: u32, + // start_key: Option, + // hash: Option, + // ) -> Result, Error> { + // let prefix = >::prefix(&self.metadata)?; + // let keys = self + // .rpc + // .storage_keys_paged(Some(prefix), count, start_key, hash) + // .await?; + // Ok(keys) + // } + + /// Query historical storage entries + pub async fn query_storage( + &self, + keys: Vec, + from: T::Hash, + to: Option, + ) -> Result::Hash>>, Error> { + self.rpc.query_storage(keys, from, to).await + } + + /// Get a header + pub async fn header(&self, hash: Option) -> Result, Error> + where + H: Into + 'static, + { + let header = self.rpc.header(hash.map(|h| h.into())).await?; + Ok(header) + } + + /// Get a block hash. By default returns the latest block hash + pub async fn block_hash( + &self, + block_number: Option, + ) -> Result, Error> { + let hash = self.rpc.block_hash(block_number).await?; + Ok(hash) + } + + /// Get a block hash of the latest finalized block + pub async fn finalized_head(&self) -> Result { + let head = self.rpc.finalized_head().await?; + Ok(head) + } + + /// Get a block + pub async fn block(&self, hash: Option) -> Result>, Error> + where + H: Into + 'static, + { + let block = self.rpc.block(hash.map(|h| h.into())).await?; + Ok(block) + } + + /// Get proof of storage entries at a specific block's state. + pub async fn read_proof( + &self, + keys: Vec, + hash: Option, + ) -> Result, Error> + where + H: Into + 'static, + { + let proof = self.rpc.read_proof(keys, hash.map(|h| h.into())).await?; + Ok(proof) + } + + /// Subscribe to events. + /// + /// *WARNING* these may not be included in the finalized chain, use + /// `subscribe_finalized_events` to ensure events are finalized. + pub async fn subscribe_events(&self) -> Result, Error> { + let events = self.rpc.subscribe_events().await?; + Ok(events) + } + + /// Subscribe to finalized events. + pub async fn subscribe_finalized_events( + &self, + ) -> Result, Error> { + let events = self.rpc.subscribe_finalized_events().await?; + Ok(events) + } + + /// Subscribe to new blocks. + pub async fn subscribe_blocks(&self) -> Result, Error> { + let headers = self.rpc.subscribe_blocks().await?; + Ok(headers) + } + + /// Subscribe to finalized blocks. + pub async fn subscribe_finalized_blocks( + &self, + ) -> Result, Error> { + let headers = self.rpc.subscribe_finalized_blocks().await?; + Ok(headers) + } + + /// Encodes a call. + pub fn encode>(&self, call: C) -> Result { + Ok(self + .metadata() + .module_with_calls(C::MODULE) + .and_then(|module| module.call(C::FUNCTION, call))?) + } + + /// Creates an unsigned extrinsic. + pub fn create_unsigned + Send + Sync>( + &self, + call: C, + ) -> Result, Error> { + let call = self.encode(call)?; + Ok(extrinsic::create_unsigned::(call)) + } + + /// Creates a signed extrinsic. + pub async fn create_signed + Send + Sync>( + &self, + call: C, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { + let account_nonce = if let Some(nonce) = signer.nonce() { + nonce + } else { + self.account(signer.account_id(), None).await?.nonce + }; + let call = self.encode(call)?; + let signed = extrinsic::create_signed( + &self.runtime_version, + self.genesis_hash, + account_nonce, + call, + signer, + ) + .await?; + Ok(signed) + } + + /// Returns the events decoder. + pub fn events_decoder(&self) -> &EventsDecoder { + &self.events_decoder + } + + /// Create and submit an extrinsic and return corresponding Hash if successful + pub async fn submit_extrinsic( + &self, + extrinsic: UncheckedExtrinsic, + ) -> Result { + self.rpc.submit_extrinsic(extrinsic).await + } + + /// Create and submit an extrinsic and return corresponding Event if successful + pub async fn submit_and_watch_extrinsic( + &self, + extrinsic: UncheckedExtrinsic, + ) -> Result, Error> { + self.rpc + .submit_and_watch_extrinsic(extrinsic, &self.events_decoder) + .await + } + + /// Submits a transaction to the chain. + pub async fn submit + Send + Sync>( + &self, + call: C, + signer: &(dyn Signer + Send + Sync), + ) -> Result + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { + let extrinsic = self.create_signed(call, signer).await?; + self.submit_extrinsic(extrinsic).await + } + + /// Submits transaction to the chain and watch for events. + pub async fn watch + Send + Sync>( + &self, + call: C, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { + let extrinsic = self.create_signed(call, signer).await?; + self.submit_and_watch_extrinsic(extrinsic).await + } + + /// Insert a key into the keystore. + pub async fn insert_key( + &self, + key_type: String, + suri: String, + public: Bytes, + ) -> Result<(), Error> { + self.rpc.insert_key(key_type, suri, public).await + } + + /// Generate new session keys and returns the corresponding public keys. + pub async fn rotate_keys(&self) -> Result { + self.rpc.rotate_keys().await + } + + /// Checks if the keystore has private keys for the given session public keys. + /// + /// `session_keys` is the SCALE encoded session keys object from the runtime. + /// + /// Returns `true` iff all private keys could be found. + pub async fn has_session_keys(&self, session_keys: Bytes) -> Result { + self.rpc.has_session_keys(session_keys).await + } + + /// Checks if the keystore has private keys for the given public key and key type. + /// + /// Returns `true` if a private key could be found. + pub async fn has_key( + &self, + public_key: Bytes, + key_type: String, + ) -> Result { + self.rpc.has_key(public_key, key_type).await + } +} + +/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of +/// the transaction payload +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Encoded(pub Vec); + +impl codec::Encode for Encoded { + fn encode(&self) -> Vec { + self.0.to_owned() + } +} diff --git a/src/error.rs b/src/error.rs index 4f5e3a1db7..ecb7737064 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,11 +22,6 @@ use sp_runtime::{ }; use thiserror::Error; -use crate::metadata::{ - Metadata, - MetadataError, -}; - /// Error enum. #[derive(Debug, Error)] pub enum Error { @@ -48,19 +43,6 @@ pub enum Error { /// Extrinsic validity error #[error("Transaction Validity Error: {0:?}")] Invalid(TransactionValidityError), - /// Metadata error. - #[error("Metadata error: {0}")] - Metadata(#[from] MetadataError), - /// Unregistered type sizes. - #[error( - "The following types do not have a type size registered: \ - {0:?} \ - Use `ClientBuilder::register_type_size` to register missing type sizes." - )] - MissingTypeSizes(Vec), - /// Type size unavailable. - #[error("Type size unavailable while decoding event: {0:?}")] - TypeSizeUnavailable(String), /// Runtime error. #[error("Runtime error: {0}")] Runtime(#[from] RuntimeError), diff --git a/src/events.rs b/src/events.rs index 2cda82f0fe..f5964a8854 100644 --- a/src/events.rs +++ b/src/events.rs @@ -47,10 +47,7 @@ use crate::{ Error, RuntimeError, }, - metadata::{ - EventArg, - Metadata, - }, + Metadata, Phase, Runtime, System, @@ -111,24 +108,21 @@ impl Default for TypeMarker { #[derive(Debug)] pub struct EventsDecoder { metadata: Metadata, - event_type_registry: EventTypeRegistry, } impl Clone for EventsDecoder { fn clone(&self) -> Self { Self { metadata: self.metadata.clone(), - event_type_registry: self.event_type_registry.clone(), } } } impl EventsDecoder { /// Creates a new `EventsDecoder`. - pub fn new(metadata: Metadata, event_type_registry: EventTypeRegistry) -> Self { + pub fn new(metadata: Metadata) -> Self { Self { metadata, - event_type_registry, } } @@ -192,152 +186,62 @@ impl EventsDecoder { fn decode_raw_bytes( &self, - args: &[EventArg], - input: &mut &[u8], - output: &mut W, - errors: &mut Vec, + _args: &scale_info::Variant, + _input: &mut &[u8], + _output: &mut W, + _errors: &mut Vec, ) -> Result<(), Error> { - for arg in args { - match arg { - EventArg::Vec(arg) => { - let len = >::decode(input)?; - len.encode_to(output); - for _ in 0..len.0 { - self.decode_raw_bytes(&[*arg.clone()], input, output, errors)? - } - } - EventArg::Option(arg) => { - match input.read_byte()? { - 0 => output.push_byte(0), - 1 => { - output.push_byte(1); - self.decode_raw_bytes(&[*arg.clone()], input, output, errors)? - } - _ => { - return Err(Error::Other( - "unexpected first byte decoding Option".into(), - )) - } - } - } - EventArg::Tuple(args) => { - self.decode_raw_bytes(args, input, output, errors)? - } - EventArg::Primitive(name) => { - let result = match name.as_str() { - "DispatchResult" => DispatchResult::decode(input)?, - "DispatchError" => Err(DispatchError::decode(input)?), - _ => { - if let Some(seg) = self.event_type_registry.resolve(name) { - let mut buf = Vec::::new(); - seg.segment(input, &mut buf)?; - output.write(&buf); - Ok(()) - } else { - return Err(Error::TypeSizeUnavailable(name.to_owned())) - } - } - }; - if let Err(error) = result { - // since the input may contain any number of args we propagate - // runtime errors to the caller for handling - errors.push(RuntimeError::from_dispatch(&self.metadata, error)?); - } - } - } - } - Ok(()) - } -} - -/// Registry for event types which cannot be directly inferred from the metadata. -#[derive(Default)] -pub struct EventTypeRegistry { - segmenters: HashMap>, - marker: PhantomData T>, -} - -impl Clone for EventTypeRegistry { - fn clone(&self) -> Self { - Self { - segmenters: self.segmenters.clone(), - marker: PhantomData, - } - } -} - -impl fmt::Debug for EventTypeRegistry { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("EventTypeRegistry") - .field( - "segmenters", - &self.segmenters.keys().cloned().collect::(), - ) - .finish() - } -} - -impl EventTypeRegistry { - /// Create a new [`EventTypeRegistry`]. - pub fn new() -> Self { - let mut registry = Self { - segmenters: HashMap::new(), - marker: PhantomData, - }; - T::register_type_sizes(&mut registry); - registry - } - - /// Register a type. - /// - /// # Panics - /// - /// If there is already a type size registered with this name. - pub fn register_type_size(&mut self, name: &str) - where - U: Codec + Send + Sync + 'static, - { - // A segmenter decodes a type from an input stream (&mut &[u8]) and returns te serialized - // type to the output stream (&mut Vec). - match self.segmenters.entry(name.to_string()) { - Entry::Occupied(_) => panic!("Already a type registered with key {}", name), - Entry::Vacant(entry) => entry.insert(Box::new(TypeMarker::::default())), - }; - } - - /// Check missing type sizes. - pub fn check_missing_type_sizes( - &self, - metadata: &Metadata, - ) -> Result<(), HashSet> { - let mut missing = HashSet::new(); - for module in metadata.modules_with_events() { - for event in module.events() { - for arg in event.arguments() { - for primitive in arg.primitives() { - if !self.segmenters.contains_key(&primitive) { - missing.insert(format!( - "{}::{}::{}", - module.name(), - event.name, - primitive - )); - } - } - } - } - } - - if !missing.is_empty() { - Err(missing) - } else { - Ok(()) - } - } - - /// Resolve a segmenter for a type by its name. - pub fn resolve(&self, name: &str) -> Option<&Box> { - self.segmenters.get(name) + todo!() + // for arg in args { + // match arg { + // EventArg::Vec(arg) => { + // let len = >::decode(input)?; + // len.encode_to(output); + // for _ in 0..len.0 { + // self.decode_raw_bytes(&[*arg.clone()], input, output, errors)? + // } + // } + // EventArg::Option(arg) => { + // match input.read_byte()? { + // 0 => output.push_byte(0), + // 1 => { + // output.push_byte(1); + // self.decode_raw_bytes(&[*arg.clone()], input, output, errors)? + // } + // _ => { + // return Err(Error::Other( + // "unexpected first byte decoding Option".into(), + // )) + // } + // } + // } + // EventArg::Tuple(args) => { + // self.decode_raw_bytes(args, input, output, errors)? + // } + // EventArg::Primitive(name) => { + // let result = match name.as_str() { + // "DispatchResult" => DispatchResult::decode(input)?, + // "DispatchError" => Err(DispatchError::decode(input)?), + // _ => { + // if let Some(seg) = self.event_type_registry.resolve(name) { + // let mut buf = Vec::::new(); + // seg.segment(input, &mut buf)?; + // output.write(&buf); + // Ok(()) + // } else { + // return Err(Error::TypeSizeUnavailable(name.to_owned())) + // } + // } + // }; + // if let Err(error) = result { + // // since the input may contain any number of args we propagate + // // runtime errors to the caller for handling + // errors.push(RuntimeError::from_dispatch(&self.metadata, error)?); + // } + // } + // } + // } + // Ok(()) } } @@ -353,17 +257,6 @@ pub enum Raw { #[cfg(test)] mod tests { use super::*; - use frame_metadata::{ - DecodeDifferent, - ErrorMetadata, - EventMetadata, - ExtrinsicMetadata, - ModuleMetadata, - RuntimeMetadata, - RuntimeMetadataPrefixed, - RuntimeMetadataV12, - META_RESERVED, - }; use std::convert::TryFrom; type TestRuntime = crate::NodeTemplateRuntime; @@ -372,7 +265,6 @@ mod tests { fn test_decode_option() { let decoder = EventsDecoder::::new( Metadata::default(), - EventTypeRegistry::new(), ); let value = Some(0u8); @@ -393,79 +285,4 @@ mod tests { assert_eq!(output, vec![1, 0]); } - - #[test] - fn test_decode_system_events_and_error() { - let decoder = EventsDecoder::::new( - Metadata::try_from(RuntimeMetadataPrefixed( - META_RESERVED, - RuntimeMetadata::V12(RuntimeMetadataV12 { - modules: DecodeDifferent::Decoded(vec![ModuleMetadata { - name: DecodeDifferent::Decoded("System".to_string()), - storage: None, - calls: None, - event: Some(DecodeDifferent::Decoded(vec![ - EventMetadata { - name: DecodeDifferent::Decoded( - "ExtrinsicSuccess".to_string(), - ), - arguments: DecodeDifferent::Decoded(vec![ - "DispatchInfo".to_string() - ]), - documentation: DecodeDifferent::Decoded(vec![]), - }, - EventMetadata { - name: DecodeDifferent::Decoded( - "ExtrinsicFailed".to_string(), - ), - arguments: DecodeDifferent::Decoded(vec![ - "DispatchError".to_string(), - "DispatchInfo".to_string(), - ]), - documentation: DecodeDifferent::Decoded(vec![]), - }, - ])), - constants: DecodeDifferent::Decoded(vec![]), - errors: DecodeDifferent::Decoded(vec![ - ErrorMetadata { - name: DecodeDifferent::Decoded( - "InvalidSpecName".to_string(), - ), - documentation: DecodeDifferent::Decoded(vec![]), - }, - ErrorMetadata { - name: DecodeDifferent::Decoded( - "SpecVersionNeedsToIncrease".to_string(), - ), - documentation: DecodeDifferent::Decoded(vec![]), - }, - ErrorMetadata { - name: DecodeDifferent::Decoded( - "FailedToExtractRuntimeVersion".to_string(), - ), - documentation: DecodeDifferent::Decoded(vec![]), - }, - ErrorMetadata { - name: DecodeDifferent::Decoded( - "NonDefaultComposite".to_string(), - ), - documentation: DecodeDifferent::Decoded(vec![]), - }, - ]), - index: 0, - }]), - extrinsic: ExtrinsicMetadata { - version: 0, - signed_extensions: vec![], - }, - }), - )) - .unwrap(), - EventTypeRegistry::new(), - ); - - // [(ApplyExtrinsic(0), Event(RawEvent { module: "System", variant: "ExtrinsicSuccess", data: "482d7c09000000000200" })), (ApplyExtrinsic(1), Error(Module(ModuleError { module: "System", error: "NonDefaultComposite" }))), (ApplyExtrinsic(2), Error(Module(ModuleError { module: "System", error: "NonDefaultComposite" })))] - let input = hex::decode("0c00000000000000482d7c0900000000020000000100000000010300035884723300000000000000000200000000010300035884723300000000000000").unwrap(); - decoder.decode_events(&mut &input[..]).unwrap(); - } } diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs deleted file mode 100644 index 4847885301..0000000000 --- a/src/extrinsic/extra.rs +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use codec::{ - Decode, - Encode, -}; -use core::{ - fmt::Debug, - marker::PhantomData, -}; -use sp_runtime::{ - generic::Era, - traits::SignedExtension, - transaction_validity::TransactionValidityError, -}; - -use crate::{ - frame::{ - balances::Balances, - system::System, - }, - runtimes::Runtime, -}; - -/// Extra type. -pub type Extra = <::Extra as SignedExtra>::Extra; - -/// SignedExtra checks copied from substrate, in order to remove requirement to implement -/// substrate's `frame_system::Trait` - -/// Ensure the runtime version registered in the transaction is the same as at present. -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the version, which is -/// returned via `additional_signed()`. - -/// Ensure the runtime version registered in the transaction is the same as at present. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckSpecVersion( - pub PhantomData, - /// Local version to be used for `AdditionalSigned` - #[codec(skip)] - pub u32, -); - -impl SignedExtension for CheckSpecVersion -where - T: System + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "CheckSpecVersion"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = u32; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } -} - -/// Ensure the transaction version registered in the transaction is the same as at present. -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the version, which is -/// returned via `additional_signed()`. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckTxVersion( - pub PhantomData, - /// Local version to be used for `AdditionalSigned` - #[codec(skip)] - pub u32, -); - -impl SignedExtension for CheckTxVersion -where - T: System + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "CheckTxVersion"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = u32; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } -} - -/// Check genesis hash -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the genesis hash, which is -/// returned via `additional_signed()`. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckGenesis( - pub PhantomData, - /// Local genesis hash to be used for `AdditionalSigned` - #[codec(skip)] - pub T::Hash, -); - -impl SignedExtension for CheckGenesis -where - T: System + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "CheckGenesis"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = T::Hash; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } -} - -/// Check for transaction mortality. -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the genesis hash, which is -/// returned via `additional_signed()`. It assumes therefore `Era::Immortal` (The transaction is -/// valid forever) -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckEra( - /// The default structure for the Extra encoding - pub (Era, PhantomData), - /// Local genesis hash to be used for `AdditionalSigned` - #[codec(skip)] - pub T::Hash, -); - -impl SignedExtension for CheckEra -where - T: System + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "CheckEra"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = T::Hash; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } -} - -/// Nonce check and increment to give replay protection for transactions. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckNonce(#[codec(compact)] pub T::Index); - -impl SignedExtension for CheckNonce -where - T: System + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "CheckNonce"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } -} - -/// Resource limit check. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckWeight(pub PhantomData); - -impl SignedExtension for CheckWeight -where - T: System + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "CheckWeight"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } -} - -/// Require the transactor pay for themselves and maybe include a tip to gain additional priority -/// in the queue. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct ChargeTransactionPayment(#[codec(compact)] pub T::Balance); - -impl SignedExtension for ChargeTransactionPayment -where - T: Balances + Clone + Debug + Eq + Send + Sync, -{ - const IDENTIFIER: &'static str = "ChargeTransactionPayment"; - type AccountId = u64; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } -} - -/// Trait for implementing transaction extras for a runtime. -pub trait SignedExtra: SignedExtension { - /// The type the extras. - type Extra: SignedExtension + Send + Sync; - - /// Creates a new `SignedExtra`. - fn new( - spec_version: u32, - tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, - ) -> Self; - - /// Returns the transaction extra. - fn extra(&self) -> Self::Extra; -} - -/// Default `SignedExtra` for substrate runtimes. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct DefaultExtra { - spec_version: u32, - tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, -} - -impl SignedExtra - for DefaultExtra -{ - type Extra = ( - CheckSpecVersion, - CheckTxVersion, - CheckGenesis, - CheckEra, - CheckNonce, - CheckWeight, - ChargeTransactionPayment, - ); - - fn new( - spec_version: u32, - tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, - ) -> Self { - DefaultExtra { - spec_version, - tx_version, - nonce, - genesis_hash, - } - } - - fn extra(&self) -> Self::Extra { - ( - CheckSpecVersion(PhantomData, self.spec_version), - CheckTxVersion(PhantomData, self.tx_version), - CheckGenesis(PhantomData, self.genesis_hash), - CheckEra((Era::Immortal, PhantomData), self.genesis_hash), - CheckNonce(self.nonce), - CheckWeight(PhantomData), - ChargeTransactionPayment(::Balance::default()), - ) - } -} - -impl SignedExtension - for DefaultExtra -{ - const IDENTIFIER: &'static str = "DefaultExtra"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = - <>::Extra as SignedExtension>::AdditionalSigned; - type Pre = (); - - fn additional_signed( - &self, - ) -> Result { - self.extra().additional_signed() - } -} diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index f1c669849e..367e7f4b31 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -16,7 +16,6 @@ //! Create signed or unsigned extrinsics. -mod extra; mod signer; pub use self::{ diff --git a/src/lib.rs b/src/lib.rs index f6353c10fa..e3eb9ef90e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,29 +50,16 @@ use codec::{ Codec, Decode, }; -use futures::future; -use jsonrpsee_http_client::HttpClientBuilder; -use jsonrpsee_types::Subscription; -use jsonrpsee_ws_client::WsClientBuilder; -use sp_core::{ - storage::{ - StorageChangeSet, - StorageData, - StorageKey, - }, - Bytes, -}; -pub use sp_runtime::traits::SignedExtension; -pub use sp_version::RuntimeVersion; +pub use frame_metadata::RuntimeMetadataLastVersion as Metadata; use std::{ marker::PhantomData, sync::Arc, }; +mod client; mod error; mod events; pub mod extrinsic; -mod metadata; mod rpc; mod subscription; @@ -83,7 +70,6 @@ pub use crate::{ RuntimeError, }, events::{ - EventTypeRegistry, EventsDecoder, RawEvent, }, @@ -114,535 +100,21 @@ pub use crate::{ substrate_subxt_proc_macro::*, }; use crate::{ - frame::system::{ - AccountStoreExt, - Phase, - System, - }, rpc::{ ChainBlock, Rpc, }, }; -/// ClientBuilder for constructing a Client. -#[derive(Default)] -pub struct ClientBuilder { - url: Option, - client: Option, - page_size: Option, - event_type_registry: EventTypeRegistry, - skip_type_sizes_check: bool, - accept_weak_inclusion: bool, -} - -impl ClientBuilder { - /// Creates a new ClientBuilder. - pub fn new() -> Self { - Self { - url: None, - client: None, - page_size: None, - event_type_registry: EventTypeRegistry::new(), - skip_type_sizes_check: false, - accept_weak_inclusion: false, - } - } - - /// Sets the jsonrpsee client. - pub fn set_client>(mut self, client: C) -> Self { - self.client = Some(client.into()); - self - } - - /// Set the substrate rpc address. - pub fn set_url>(mut self, url: P) -> Self { - self.url = Some(url.into()); - self - } - - /// Set the page size. - pub fn set_page_size(mut self, size: u32) -> Self { - self.page_size = Some(size); - self - } - - /// Register a custom type segmenter, for consuming types in events where the size cannot - /// be inferred from the metadata. - /// - /// # Panics - /// - /// If there is already a type size registered with this name. - pub fn register_type_size(mut self, name: &str) -> Self - where - U: Codec + Send + Sync + 'static, - { - self.event_type_registry.register_type_size::(name); - self - } - - /// Disable the check for missing type sizes on `build`. - /// - /// *WARNING* can lead to runtime errors if receiving events with unknown types. - pub fn skip_type_sizes_check(mut self) -> Self { - self.skip_type_sizes_check = true; - self - } - - /// Only check that transactions are InBlock on submit. - pub fn accept_weak_inclusion(mut self) -> Self { - self.accept_weak_inclusion = true; - self - } - - /// Creates a new Client. - pub async fn build<'a>(self) -> Result, Error> { - let client = if let Some(client) = self.client { - client - } else { - let url = self.url.as_deref().unwrap_or("ws://127.0.0.1:9944"); - if url.starts_with("ws://") || url.starts_with("wss://") { - let client = WsClientBuilder::default() - .max_notifs_per_subscription(4096) - .build(url) - .await?; - RpcClient::WebSocket(Arc::new(client)) - } else { - let client = HttpClientBuilder::default().build(&url)?; - RpcClient::Http(Arc::new(client)) - } - }; - let mut rpc = Rpc::new(client); - if self.accept_weak_inclusion { - rpc.accept_weak_inclusion(); - } - let (metadata, genesis_hash, runtime_version, properties) = future::join4( - rpc.metadata(), - rpc.genesis_hash(), - rpc.runtime_version(None), - rpc.system_properties(), - ) - .await; - let metadata = metadata?; - - if let Err(missing) = self.event_type_registry.check_missing_type_sizes(&metadata) - { - if self.skip_type_sizes_check { - log::warn!( - "The following types do not have registered type segmenters: {:?} \ - If any events containing these types are received, this can cause a \ - `TypeSizeUnavailable` error and prevent decoding the actual event \ - being listened for.\ - \ - Use `ClientBuilder::register_type_size` to register missing type sizes.", - missing - ); - } else { - return Err(Error::MissingTypeSizes(missing.into_iter().collect())) - } - } - - let events_decoder = - EventsDecoder::new(metadata.clone(), self.event_type_registry); - - Ok(Client { - rpc, - genesis_hash: genesis_hash?, - metadata, - events_decoder, - properties: properties.unwrap_or_else(|_| Default::default()), - runtime_version: runtime_version?, - _marker: PhantomData, - page_size: self.page_size.unwrap_or(10), - }) - } -} - -/// Client to interface with a substrate node. -pub struct Client { - rpc: Rpc, - genesis_hash: T::Hash, - metadata: Metadata, - events_decoder: EventsDecoder, - properties: SystemProperties, - runtime_version: RuntimeVersion, - _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, - page_size: u32, -} - -impl Clone for Client { - fn clone(&self) -> Self { - Self { - rpc: self.rpc.clone(), - genesis_hash: self.genesis_hash, - metadata: self.metadata.clone(), - events_decoder: self.events_decoder.clone(), - properties: self.properties.clone(), - runtime_version: self.runtime_version.clone(), - _marker: PhantomData, - page_size: self.page_size, - } - } -} - -/// Iterates over key value pairs in a map. -pub struct KeyIter> { - client: Client, - _marker: PhantomData, - count: u32, - hash: T::Hash, - start_key: Option, - buffer: Vec<(StorageKey, StorageData)>, -} - -impl> KeyIter { - /// Returns the next key value pair from a map. - pub async fn next(&mut self) -> Result, Error> { - loop { - if let Some((k, v)) = self.buffer.pop() { - return Ok(Some((k, Decode::decode(&mut &v.0[..])?))) - } else { - let keys = self - .client - .fetch_keys::(self.count, self.start_key.take(), Some(self.hash)) - .await?; - - if keys.is_empty() { - return Ok(None) - } - - self.start_key = keys.last().cloned(); - - let change_sets = self - .client - .rpc - .query_storage_at(&keys, Some(self.hash)) - .await?; - for change_set in change_sets { - for (k, v) in change_set.changes { - if let Some(v) = v { - self.buffer.push((k, v)); - } - } - } - debug_assert_eq!(self.buffer.len(), keys.len()); - } - } - } -} - -impl Client { - /// Returns the genesis hash. - pub fn genesis(&self) -> &T::Hash { - &self.genesis_hash - } - - /// Returns the chain metadata. - pub fn metadata(&self) -> &Metadata { - &self.metadata - } - - /// Returns the system properties - pub fn properties(&self) -> &SystemProperties { - &self.properties - } - - /// Returns the rpc client. - pub fn rpc_client(&self) -> &RpcClient { - &self.rpc.client - } - - /// Fetch the value under an unhashed storage key - pub async fn fetch_unhashed( - &self, - key: StorageKey, - hash: Option, - ) -> Result, Error> { - if let Some(data) = self.rpc.storage(&key, hash).await? { - Ok(Some(Decode::decode(&mut &data.0[..])?)) - } else { - Ok(None) - } - } - - /// Fetch a StorageKey with an optional block hash. - pub async fn fetch>( - &self, - store: &F, - hash: Option, - ) -> Result, Error> { - let key = store.key(&self.metadata)?; - self.fetch_unhashed::(key, hash).await - } - - /// Fetch a StorageKey that has a default value with an optional block hash. - pub async fn fetch_or_default>( - &self, - store: &F, - hash: Option, - ) -> Result { - if let Some(data) = self.fetch(store, hash).await? { - Ok(data) - } else { - Ok(store.default(&self.metadata)?) - } - } - - /// Returns an iterator of key value pairs. - pub async fn iter>( - &self, - hash: Option, - ) -> Result, Error> { - let hash = if let Some(hash) = hash { - hash - } else { - self.block_hash(None) - .await? - .expect("didn't pass a block number; qed") - }; - Ok(KeyIter { - client: self.clone(), - hash, - count: self.page_size, - start_key: None, - buffer: Default::default(), - _marker: PhantomData, - }) - } - - /// Fetch up to `count` keys for a storage map in lexicographic order. - /// - /// Supports pagination by passing a value to `start_key`. - pub async fn fetch_keys>( - &self, - count: u32, - start_key: Option, - hash: Option, - ) -> Result, Error> { - let prefix = >::prefix(&self.metadata)?; - let keys = self - .rpc - .storage_keys_paged(Some(prefix), count, start_key, hash) - .await?; - Ok(keys) - } - - /// Query historical storage entries - pub async fn query_storage( - &self, - keys: Vec, - from: T::Hash, - to: Option, - ) -> Result::Hash>>, Error> { - self.rpc.query_storage(keys, from, to).await - } - - /// Get a header - pub async fn header(&self, hash: Option) -> Result, Error> - where - H: Into + 'static, - { - let header = self.rpc.header(hash.map(|h| h.into())).await?; - Ok(header) - } - - /// Get a block hash. By default returns the latest block hash - pub async fn block_hash( - &self, - block_number: Option, - ) -> Result, Error> { - let hash = self.rpc.block_hash(block_number).await?; - Ok(hash) - } - - /// Get a block hash of the latest finalized block - pub async fn finalized_head(&self) -> Result { - let head = self.rpc.finalized_head().await?; - Ok(head) - } - - /// Get a block - pub async fn block(&self, hash: Option) -> Result>, Error> - where - H: Into + 'static, - { - let block = self.rpc.block(hash.map(|h| h.into())).await?; - Ok(block) - } - - /// Get proof of storage entries at a specific block's state. - pub async fn read_proof( - &self, - keys: Vec, - hash: Option, - ) -> Result, Error> - where - H: Into + 'static, - { - let proof = self.rpc.read_proof(keys, hash.map(|h| h.into())).await?; - Ok(proof) - } - - /// Subscribe to events. - /// - /// *WARNING* these may not be included in the finalized chain, use - /// `subscribe_finalized_events` to ensure events are finalized. - pub async fn subscribe_events(&self) -> Result, Error> { - let events = self.rpc.subscribe_events().await?; - Ok(events) - } - - /// Subscribe to finalized events. - pub async fn subscribe_finalized_events( - &self, - ) -> Result, Error> { - let events = self.rpc.subscribe_finalized_events().await?; - Ok(events) - } - - /// Subscribe to new blocks. - pub async fn subscribe_blocks(&self) -> Result, Error> { - let headers = self.rpc.subscribe_blocks().await?; - Ok(headers) - } - - /// Subscribe to finalized blocks. - pub async fn subscribe_finalized_blocks( - &self, - ) -> Result, Error> { - let headers = self.rpc.subscribe_finalized_blocks().await?; - Ok(headers) - } - - /// Encodes a call. - pub fn encode>(&self, call: C) -> Result { - Ok(self - .metadata() - .module_with_calls(C::MODULE) - .and_then(|module| module.call(C::FUNCTION, call))?) - } - - /// Creates an unsigned extrinsic. - pub fn create_unsigned + Send + Sync>( - &self, - call: C, - ) -> Result, Error> { - let call = self.encode(call)?; - Ok(extrinsic::create_unsigned::(call)) - } - - /// Creates a signed extrinsic. - pub async fn create_signed + Send + Sync>( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let account_nonce = if let Some(nonce) = signer.nonce() { - nonce - } else { - self.account(signer.account_id(), None).await?.nonce - }; - let call = self.encode(call)?; - let signed = extrinsic::create_signed( - &self.runtime_version, - self.genesis_hash, - account_nonce, - call, - signer, - ) - .await?; - Ok(signed) - } - - /// Returns the events decoder. - pub fn events_decoder(&self) -> &EventsDecoder { - &self.events_decoder - } - - /// Create and submit an extrinsic and return corresponding Hash if successful - pub async fn submit_extrinsic( - &self, - extrinsic: UncheckedExtrinsic, - ) -> Result { - self.rpc.submit_extrinsic(extrinsic).await - } - - /// Create and submit an extrinsic and return corresponding Event if successful - pub async fn submit_and_watch_extrinsic( - &self, - extrinsic: UncheckedExtrinsic, - ) -> Result, Error> { - self.rpc - .submit_and_watch_extrinsic(extrinsic, &self.events_decoder) - .await - } - - /// Submits a transaction to the chain. - pub async fn submit + Send + Sync>( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let extrinsic = self.create_signed(call, signer).await?; - self.submit_extrinsic(extrinsic).await - } - - /// Submits transaction to the chain and watch for events. - pub async fn watch + Send + Sync>( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let extrinsic = self.create_signed(call, signer).await?; - self.submit_and_watch_extrinsic(extrinsic).await - } - - /// Insert a key into the keystore. - pub async fn insert_key( - &self, - key_type: String, - suri: String, - public: Bytes, - ) -> Result<(), Error> { - self.rpc.insert_key(key_type, suri, public).await - } - - /// Generate new session keys and returns the corresponding public keys. - pub async fn rotate_keys(&self) -> Result { - self.rpc.rotate_keys().await - } - - /// Checks if the keystore has private keys for the given session public keys. - /// - /// `session_keys` is the SCALE encoded session keys object from the runtime. - /// - /// Returns `true` iff all private keys could be found. - pub async fn has_session_keys(&self, session_keys: Bytes) -> Result { - self.rpc.has_session_keys(session_keys).await - } - - /// Checks if the keystore has private keys for the given public key and key type. - /// - /// Returns `true` if a private key could be found. - pub async fn has_key( - &self, - public_key: Bytes, - key_type: String, - ) -> Result { - self.rpc.has_key(public_key, key_type).await - } +/// A phase of a block's execution. +#[derive(Clone, Debug, Eq, PartialEq, Decode)] +pub enum Phase { + /// Applying an extrinsic. + ApplyExtrinsic(u32), + /// Finalizing the block. + Finalization, + /// Initializing the block. + Initialization, } /// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of diff --git a/src/metadata.rs b/src/metadata.rs deleted file mode 100644 index 9e4b992e0a..0000000000 --- a/src/metadata.rs +++ /dev/null @@ -1,677 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use std::{ - collections::HashMap, - convert::TryFrom, - marker::PhantomData, - str::FromStr, -}; - -use codec::{ - Decode, - Encode, - Error as CodecError, -}; - -use frame_metadata::{ - DecodeDifferent, - RuntimeMetadata, - RuntimeMetadataPrefixed, - StorageEntryModifier, - StorageEntryType, - StorageHasher, - META_RESERVED, -}; -use sp_core::storage::StorageKey; - -use crate::Encoded; - -/// Metadata error. -#[derive(Debug, thiserror::Error)] -pub enum MetadataError { - /// Failed to parse metadata. - #[error("Error converting substrate metadata: {0}")] - Conversion(#[from] ConversionError), - /// Module is not in metadata. - #[error("Module {0} not found")] - ModuleNotFound(String), - /// Module is not in metadata. - #[error("Module index {0} not found")] - ModuleIndexNotFound(u8), - /// Call is not in metadata. - #[error("Call {0} not found")] - CallNotFound(&'static str), - /// Event is not in metadata. - #[error("Event {0} not found")] - EventNotFound(u8), - /// Event is not in metadata. - #[error("Error {0} not found")] - ErrorNotFound(u8), - /// Storage is not in metadata. - #[error("Storage {0} not found")] - StorageNotFound(&'static str), - /// Storage type does not match requested type. - #[error("Storage type error")] - StorageTypeError, - /// Default error. - #[error("Failed to decode default: {0}")] - DefaultError(CodecError), - /// Failure to decode constant value. - #[error("Failed to decode constant value: {0}")] - ConstantValueError(CodecError), - /// Constant is not in metadata. - #[error("Constant {0} not found")] - ConstantNotFound(&'static str), -} - -/// Runtime metadata. -#[derive(Clone, Debug, Default)] -pub struct Metadata { - modules: HashMap, - modules_with_calls: HashMap, - modules_with_events: HashMap, - modules_with_errors: HashMap, -} - -impl Metadata { - /// Returns `ModuleMetadata`. - pub fn module(&self, name: S) -> Result<&ModuleMetadata, MetadataError> - where - S: ToString, - { - let name = name.to_string(); - self.modules - .get(&name) - .ok_or(MetadataError::ModuleNotFound(name)) - } - - /// Returns `ModuleWithCalls`. - pub fn module_with_calls(&self, name: S) -> Result<&ModuleWithCalls, MetadataError> - where - S: ToString, - { - let name = name.to_string(); - self.modules_with_calls - .get(&name) - .ok_or(MetadataError::ModuleNotFound(name)) - } - - /// Returns Iterator of `ModuleWithEvents`. - pub fn modules_with_events(&self) -> impl Iterator { - self.modules_with_events.values() - } - - /// Returns `ModuleWithEvents`. - pub fn module_with_events( - &self, - module_index: u8, - ) -> Result<&ModuleWithEvents, MetadataError> { - self.modules_with_events - .values() - .find(|&module| module.index == module_index) - .ok_or(MetadataError::ModuleIndexNotFound(module_index)) - } - - /// Returns `ModuleWithErrors`. - pub fn module_with_errors( - &self, - module_index: u8, - ) -> Result<&ModuleWithErrors, MetadataError> { - self.modules_with_errors - .values() - .find(|&module| module.index == module_index) - .ok_or(MetadataError::ModuleIndexNotFound(module_index)) - } - - /// Pretty print metadata. - pub fn pretty(&self) -> String { - let mut string = String::new(); - for (name, module) in &self.modules { - string.push_str(name.as_str()); - string.push('\n'); - for storage in module.storage.keys() { - string.push_str(" s "); - string.push_str(storage.as_str()); - string.push('\n'); - } - if let Some(module) = self.modules_with_calls.get(name) { - for call in module.calls.keys() { - string.push_str(" c "); - string.push_str(call.as_str()); - string.push('\n'); - } - } - if let Some(module) = self.modules_with_events.get(name) { - for event in module.events.values() { - string.push_str(" e "); - string.push_str(event.name.as_str()); - string.push('\n'); - } - } - } - string - } -} - -#[derive(Clone, Debug)] -pub struct ModuleMetadata { - index: u8, - name: String, - storage: HashMap, - constants: HashMap, -} - -impl ModuleMetadata { - pub fn storage(&self, key: &'static str) -> Result<&StorageMetadata, MetadataError> { - self.storage - .get(key) - .ok_or(MetadataError::StorageNotFound(key)) - } - - /// Get a constant's metadata by name - pub fn constant( - &self, - key: &'static str, - ) -> Result<&ModuleConstantMetadata, MetadataError> { - self.constants - .get(key) - .ok_or(MetadataError::ConstantNotFound(key)) - } -} - -#[derive(Clone, Debug)] -pub struct ModuleWithCalls { - index: u8, - calls: HashMap, -} - -impl ModuleWithCalls { - pub fn call( - &self, - function: &'static str, - params: T, - ) -> Result { - let fn_index = self - .calls - .get(function) - .ok_or(MetadataError::CallNotFound(function))?; - let mut bytes = vec![self.index, *fn_index]; - bytes.extend(params.encode()); - Ok(Encoded(bytes)) - } -} - -#[derive(Clone, Debug)] -pub struct ModuleWithEvents { - index: u8, - name: String, - events: HashMap, -} - -impl ModuleWithEvents { - pub fn name(&self) -> &str { - &self.name - } - - pub fn events(&self) -> impl Iterator { - self.events.values() - } - - pub fn event(&self, index: u8) -> Result<&ModuleEventMetadata, MetadataError> { - self.events - .get(&index) - .ok_or(MetadataError::EventNotFound(index)) - } -} - -#[derive(Clone, Debug)] -pub struct ModuleWithErrors { - index: u8, - name: String, - errors: HashMap, -} - -impl ModuleWithErrors { - pub fn name(&self) -> &str { - &self.name - } - - pub fn error(&self, index: u8) -> Result<&String, MetadataError> { - self.errors - .get(&index) - .ok_or(MetadataError::ErrorNotFound(index)) - } -} - -#[derive(Clone, Debug)] -pub struct StorageMetadata { - module_prefix: String, - storage_prefix: String, - modifier: StorageEntryModifier, - ty: StorageEntryType, - default: Vec, -} - -impl StorageMetadata { - pub fn prefix(&self) -> StorageKey { - let mut bytes = sp_core::twox_128(self.module_prefix.as_bytes()).to_vec(); - bytes.extend(&sp_core::twox_128(self.storage_prefix.as_bytes())[..]); - StorageKey(bytes) - } - - pub fn default(&self) -> Result { - Decode::decode(&mut &self.default[..]).map_err(MetadataError::DefaultError) - } - - pub fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { - match hasher { - StorageHasher::Identity => bytes.to_vec(), - StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), - StorageHasher::Blake2_128Concat => { - // copied from substrate Blake2_128Concat::hash since StorageHasher is not public - sp_core::blake2_128(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), - StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), - StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), - StorageHasher::Twox64Concat => { - sp_core::twox_64(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - } - } - - pub fn hash_key(hasher: &StorageHasher, key: &K) -> Vec { - Self::hash(hasher, &key.encode()) - } - - pub fn plain(&self) -> Result { - match &self.ty { - StorageEntryType::Plain(_) => { - Ok(StoragePlain { - prefix: self.prefix().0, - }) - } - _ => Err(MetadataError::StorageTypeError), - } - } - - pub fn map(&self) -> Result, MetadataError> { - match &self.ty { - StorageEntryType::Map { hasher, .. } => { - Ok(StorageMap { - _marker: PhantomData, - prefix: self.prefix().0, - hasher: hasher.clone(), - }) - } - _ => Err(MetadataError::StorageTypeError), - } - } - - pub fn double_map( - &self, - ) -> Result, MetadataError> { - match &self.ty { - StorageEntryType::DoubleMap { - hasher, - key2_hasher, - .. - } => { - Ok(StorageDoubleMap { - _marker: PhantomData, - prefix: self.prefix().0, - hasher1: hasher.clone(), - hasher2: key2_hasher.clone(), - }) - } - _ => Err(MetadataError::StorageTypeError), - } - } -} - -#[derive(Clone, Debug)] -pub struct StoragePlain { - prefix: Vec, -} - -impl StoragePlain { - pub fn key(&self) -> StorageKey { - StorageKey(self.prefix.clone()) - } -} - -#[derive(Clone, Debug)] -pub struct StorageMap { - _marker: PhantomData, - prefix: Vec, - hasher: StorageHasher, -} - -impl StorageMap { - pub fn key(&self, key: &K) -> StorageKey { - let mut bytes = self.prefix.clone(); - bytes.extend(StorageMetadata::hash_key(&self.hasher, key)); - StorageKey(bytes) - } -} - -#[derive(Clone, Debug)] -pub struct StorageDoubleMap { - _marker: PhantomData<(K1, K2)>, - prefix: Vec, - hasher1: StorageHasher, - hasher2: StorageHasher, -} - -impl StorageDoubleMap { - pub fn key(&self, key1: &K1, key2: &K2) -> StorageKey { - let mut bytes = self.prefix.clone(); - bytes.extend(StorageMetadata::hash_key(&self.hasher1, key1)); - bytes.extend(StorageMetadata::hash_key(&self.hasher2, key2)); - StorageKey(bytes) - } -} - -#[derive(Clone, Debug)] -pub struct ModuleEventMetadata { - pub name: String, - arguments: Vec, -} - -impl ModuleEventMetadata { - pub fn arguments(&self) -> Vec { - self.arguments.to_vec() - } -} - -/// Naive representation of event argument types, supports current set of substrate EventArg types. -/// If and when Substrate uses `type-metadata`, this can be replaced. -/// -/// Used to calculate the size of a instance of an event variant without having the concrete type, -/// so the raw bytes can be extracted from the encoded `Vec>` (without `E` defined). -#[derive(Clone, Debug, Eq, PartialEq, Hash)] -pub enum EventArg { - Primitive(String), - Vec(Box), - Tuple(Vec), - Option(Box), -} - -impl FromStr for EventArg { - type Err = ConversionError; - - fn from_str(s: &str) -> Result { - if s.starts_with("Vec<") { - if s.ends_with('>') { - Ok(EventArg::Vec(Box::new(s[4..s.len() - 1].parse()?))) - } else { - Err(ConversionError::InvalidEventArg( - s.to_string(), - "Expected closing `>` for `Vec`", - )) - } - } else if s.starts_with("Option<") { - if s.ends_with('>') { - Ok(EventArg::Option(Box::new(s[7..s.len() - 1].parse()?))) - } else { - Err(ConversionError::InvalidEventArg( - s.to_string(), - "Expected closing `>` for `Option`", - )) - } - } else if s.starts_with('(') { - if s.ends_with(')') { - let mut args = Vec::new(); - for arg in s[1..s.len() - 1].split(',') { - let arg = arg.trim().parse()?; - args.push(arg) - } - Ok(EventArg::Tuple(args)) - } else { - Err(ConversionError::InvalidEventArg( - s.to_string(), - "Expecting closing `)` for tuple", - )) - } - } else { - Ok(EventArg::Primitive(s.to_string())) - } - } -} - -impl EventArg { - /// Returns all primitive types for this EventArg - pub fn primitives(&self) -> Vec { - match self { - EventArg::Primitive(p) => vec![p.clone()], - EventArg::Vec(arg) => arg.primitives(), - EventArg::Option(arg) => arg.primitives(), - EventArg::Tuple(args) => { - let mut primitives = Vec::new(); - for arg in args { - primitives.extend(arg.primitives()) - } - primitives - } - } - } -} - -#[derive(Clone, Debug)] -pub struct ModuleConstantMetadata { - name: String, - ty: String, - value: Vec, - documentation: Vec, -} - -impl ModuleConstantMetadata { - /// Name - pub fn name(&self) -> &String { - &self.name - } - - /// Constant value (decoded) - pub fn value(&self) -> Result { - Decode::decode(&mut &self.value[..]).map_err(MetadataError::ConstantValueError) - } - - /// Type (as defined in the runtime) - pub fn ty(&self) -> &String { - &self.ty - } - - /// Documentation - pub fn documentation(&self) -> &Vec { - &self.documentation - } -} - -#[derive(Debug, thiserror::Error)] -pub enum ConversionError { - #[error("Invalid prefix")] - InvalidPrefix, - #[error("Invalid version")] - InvalidVersion, - #[error("Expected DecodeDifferent::Decoded")] - ExpectedDecoded, - #[error("Invalid event arg {0}")] - InvalidEventArg(String, &'static str), -} - -impl TryFrom for Metadata { - type Error = MetadataError; - - fn try_from(metadata: RuntimeMetadataPrefixed) -> Result { - if metadata.0 != META_RESERVED { - return Err(ConversionError::InvalidPrefix.into()) - } - let meta = match metadata.1 { - RuntimeMetadata::V12(meta) => meta, - _ => return Err(ConversionError::InvalidVersion.into()), - }; - let mut modules = HashMap::new(); - let mut modules_with_calls = HashMap::new(); - let mut modules_with_events = HashMap::new(); - let mut modules_with_errors = HashMap::new(); - for module in convert(meta.modules)?.into_iter() { - let module_name = convert(module.name.clone())?; - - let mut constant_map = HashMap::new(); - for constant in convert(module.constants)?.into_iter() { - let constant_meta = convert_constant(constant)?; - constant_map.insert(constant_meta.name.clone(), constant_meta); - } - - let mut storage_map = HashMap::new(); - if let Some(storage) = module.storage { - let storage = convert(storage)?; - let module_prefix = convert(storage.prefix)?; - for entry in convert(storage.entries)?.into_iter() { - let storage_prefix = convert(entry.name.clone())?; - let entry = convert_entry( - module_prefix.clone(), - storage_prefix.clone(), - entry, - )?; - storage_map.insert(storage_prefix, entry); - } - } - modules.insert( - module_name.clone(), - ModuleMetadata { - index: module.index, - name: module_name.clone(), - storage: storage_map, - constants: constant_map, - }, - ); - - if let Some(calls) = module.calls { - let mut call_map = HashMap::new(); - for (index, call) in convert(calls)?.into_iter().enumerate() { - let name = convert(call.name)?; - call_map.insert(name, index as u8); - } - modules_with_calls.insert( - module_name.clone(), - ModuleWithCalls { - index: module.index, - calls: call_map, - }, - ); - } - if let Some(events) = module.event { - let mut event_map = HashMap::new(); - for (index, event) in convert(events)?.into_iter().enumerate() { - event_map.insert(index as u8, convert_event(event)?); - } - modules_with_events.insert( - module_name.clone(), - ModuleWithEvents { - index: module.index, - name: module_name.clone(), - events: event_map, - }, - ); - } - let mut error_map = HashMap::new(); - for (index, error) in convert(module.errors)?.into_iter().enumerate() { - error_map.insert(index as u8, convert_error(error)?); - } - modules_with_errors.insert( - module_name.clone(), - ModuleWithErrors { - index: module.index, - name: module_name.clone(), - errors: error_map, - }, - ); - } - Ok(Metadata { - modules, - modules_with_calls, - modules_with_events, - modules_with_errors, - }) - } -} - -fn convert( - dd: DecodeDifferent, -) -> Result { - match dd { - DecodeDifferent::Decoded(value) => Ok(value), - _ => Err(ConversionError::ExpectedDecoded), - } -} - -fn convert_event( - event: frame_metadata::EventMetadata, -) -> Result { - let name = convert(event.name)?; - let mut arguments = Vec::new(); - for arg in convert(event.arguments)? { - let arg = arg.parse::()?; - arguments.push(arg); - } - Ok(ModuleEventMetadata { name, arguments }) -} - -fn convert_entry( - module_prefix: String, - storage_prefix: String, - entry: frame_metadata::StorageEntryMetadata, -) -> Result { - let default = convert(entry.default)?; - Ok(StorageMetadata { - module_prefix, - storage_prefix, - modifier: entry.modifier, - ty: entry.ty, - default, - }) -} - -fn convert_error( - error: frame_metadata::ErrorMetadata, -) -> Result { - convert(error.name) -} - -fn convert_constant( - constant: frame_metadata::ModuleConstantMetadata, -) -> Result { - let name = convert(constant.name)?; - let ty = convert(constant.ty)?; - let value = convert(constant.value)?; - let documentation = convert(constant.documentation)?; - Ok(ModuleConstantMetadata { - name, - ty, - value, - documentation, - }) -} diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 78763d9cd1..f9c0750e21 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -4,6 +4,8 @@ version = "0.1.0" edition = "2018" [dependencies] +subxt = { package = "substrate-subxt", path = ".." } + assert_matches = "1.5.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } env_logger = "0.8.3" diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 43f59ca7b6..05f64d89d3 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -16,7 +16,6 @@ mod node_proc; -use super::*; pub use node_proc::TestNodeProcess; use sp_core::storage::{ well_known_keys, diff --git a/tests/src/node_proc.rs b/tests/src/node_proc.rs index 9f33d6985c..45b0fb0589 100644 --- a/tests/src/node_proc.rs +++ b/tests/src/node_proc.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::{ +use subxt::{ Client, ClientBuilder, Runtime, From b755c29cc1c51e515ae50d7a0c55589cf7e225e7 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 16:59:57 +0100 Subject: [PATCH 005/216] Update substrate dependencies to git dependencies --- Cargo.toml | 19 ++++--------------- proc-macro/Cargo.toml | 2 +- tests/Cargo.toml | 4 +--- 3 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3f36c31e2c..e92f3321a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,20 +42,9 @@ url = "2.2.1" substrate-subxt-proc-macro = { version = "0.15.0", path = "proc-macro" } -sp-core = "3.0.0" -sp-rpc = "3.0.0" -sp-runtime = "3.0.0" -sp-version = "3.0.0" +sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/" } +sp-rpc = { package = "sp-rpc", git = "https://github.com/paritytech/substrate/" } +sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/" } +sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/" } frame-metadata = { git = "https://github.com/paritytech/frame-metadata/" } - -[dev-dependencies] -assert_matches = "1.5.0" -async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } -env_logger = "0.8.3" -tempdir = "0.3.7" -wabt = "0.10.0" -which = "4.0.2" -sp-keyring = "3.0.0" -frame-system = "3.0.0" -pallet-balances = "3.0.0" diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index fea1452006..9fade17ef7 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -32,4 +32,4 @@ pretty_assertions = "0.6.1" substrate-subxt = { path = ".." } trybuild = "1.0.38" -sp-keyring = "3.0.0" +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } diff --git a/tests/Cargo.toml b/tests/Cargo.toml index f9c0750e21..a2b2e9a64d 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -12,6 +12,4 @@ env_logger = "0.8.3" tempdir = "0.3.7" wabt = "0.10.0" which = "4.0.2" -sp-keyring = "3.0.0" -frame-system = "3.0.0" -pallet-balances = "3.0.0" \ No newline at end of file +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } \ No newline at end of file From 05fe05193d97e89c29fd79f27cd961a7afea0822 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 17:08:13 +0100 Subject: [PATCH 006/216] Remove Store stuff for now --- src/client.rs | 108 -------------------------------------------------- 1 file changed, 108 deletions(-) diff --git a/src/client.rs b/src/client.rs index d225a5c188..9b41fd249e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -179,52 +179,6 @@ impl Clone for Client { } } -/// Iterates over key value pairs in a map. -pub struct KeyIter> { - client: Client, - _marker: PhantomData, - count: u32, - hash: T::Hash, - start_key: Option, - buffer: Vec<(StorageKey, StorageData)>, -} - -impl> KeyIter { - /// Returns the next key value pair from a map. - pub async fn next(&mut self) -> Result, Error> { - loop { - if let Some((k, v)) = self.buffer.pop() { - return Ok(Some((k, Decode::decode(&mut &v.0[..])?))) - } else { - let keys = self - .client - .fetch_keys::(self.count, self.start_key.take(), Some(self.hash)) - .await?; - - if keys.is_empty() { - return Ok(None) - } - - self.start_key = keys.last().cloned(); - - let change_sets = self - .client - .rpc - .query_storage_at(&keys, Some(self.hash)) - .await?; - for change_set in change_sets { - for (k, v) in change_set.changes { - if let Some(v) = v { - self.buffer.push((k, v)); - } - } - } - debug_assert_eq!(self.buffer.len(), keys.len()); - } - } - } -} - impl Client { /// Returns the genesis hash. pub fn genesis(&self) -> &T::Hash { @@ -259,68 +213,6 @@ impl Client { } } - // /// Fetch a StorageKey with an optional block hash. - // pub async fn fetch>( - // &self, - // store: &F, - // hash: Option, - // ) -> Result, Error> { - // let key = store.key(&self.metadata)?; - // self.fetch_unhashed::(key, hash).await - // } - // - // /// Fetch a StorageKey that has a default value with an optional block hash. - // pub async fn fetch_or_default>( - // &self, - // store: &F, - // hash: Option, - // ) -> Result { - // if let Some(data) = self.fetch(store, hash).await? { - // Ok(data) - // } else { - // Ok(store.default(&self.metadata)?) - // } - // } - - /// Returns an iterator of key value pairs. - pub async fn iter>( - &self, - hash: Option, - ) -> Result, Error> { - let hash = if let Some(hash) = hash { - hash - } else { - self.block_hash(None) - .await? - .expect("didn't pass a block number; qed") - }; - Ok(KeyIter { - client: self.clone(), - hash, - count: self.page_size, - start_key: None, - buffer: Default::default(), - _marker: PhantomData, - }) - } - - // /// Fetch up to `count` keys for a storage map in lexicographic order. - // /// - // /// Supports pagination by passing a value to `start_key`. - // pub async fn fetch_keys>( - // &self, - // count: u32, - // start_key: Option, - // hash: Option, - // ) -> Result, Error> { - // let prefix = >::prefix(&self.metadata)?; - // let keys = self - // .rpc - // .storage_keys_paged(Some(prefix), count, start_key, hash) - // .await?; - // Ok(keys) - // } - /// Query historical storage entries pub async fn query_storage( &self, From 5e9140672f1f71303153c6704fb9581cb3f1ebd0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 17:36:01 +0100 Subject: [PATCH 007/216] Comment out some Call usages --- src/client.rs | 172 ++++++++++++++++++++++++-------------------------- src/events.rs | 14 +--- 2 files changed, 86 insertions(+), 100 deletions(-) diff --git a/src/client.rs b/src/client.rs index 9b41fd249e..f3387d57dc 100644 --- a/src/client.rs +++ b/src/client.rs @@ -15,7 +15,6 @@ // along with substrate-subxt. If not, see . use codec::{ - Codec, Decode, }; pub use frame_metadata::RuntimeMetadataLastVersion as Metadata; @@ -26,7 +25,6 @@ use jsonrpsee_ws_client::WsClientBuilder; use sp_core::{ storage::{ StorageChangeSet, - StorageData, StorageKey, }, Bytes, @@ -38,27 +36,23 @@ use std::{ sync::Arc, }; -use crate::{ - Error, - events::EventsDecoder, - extrinsic::{ - PairSigner, - SignedExtra, - Signer, - UncheckedExtrinsic, - }, - rpc::{ - ChainBlock, - Rpc, - RpcClient, - SystemProperties, - }, - subscription::{ - EventStorageSubscription, - EventSubscription, - FinalizedEventStorageSubscription, - }, -}; +use crate::{Error, events::EventsDecoder, extrinsic::{ + self, + PairSigner, + SignedExtra, + Signer, + UncheckedExtrinsic, +}, rpc::{ + ChainBlock, + Rpc, + RpcClient, + SystemProperties, + ExtrinsicSuccess, +}, subscription::{ + EventStorageSubscription, + EventSubscription, + FinalizedEventStorageSubscription, +}, BlockNumber, ReadProof}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -157,7 +151,7 @@ pub struct Client { rpc: Rpc, genesis_hash: T::Hash, metadata: Metadata, - events_decoder: EventsDecoder, + events_decoder: EventsDecoder, properties: SystemProperties, runtime_version: RuntimeVersion, _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, @@ -219,7 +213,7 @@ impl Client { keys: Vec, from: T::Hash, to: Option, - ) -> Result::Hash>>, Error> { + ) -> Result>, Error> { self.rpc.query_storage(keys, from, to).await } @@ -300,52 +294,52 @@ impl Client { Ok(headers) } - /// Encodes a call. - pub fn encode>(&self, call: C) -> Result { - Ok(self - .metadata() - .module_with_calls(C::MODULE) - .and_then(|module| module.call(C::FUNCTION, call))?) - } + // /// Encodes a call. + // pub fn encode>(&self, call: C) -> Result { + // Ok(self + // .metadata() + // .module_with_calls(C::MODULE) + // .and_then(|module| module.call(C::FUNCTION, call))?) + // } /// Creates an unsigned extrinsic. - pub fn create_unsigned + Send + Sync>( - &self, - call: C, - ) -> Result, Error> { - let call = self.encode(call)?; - Ok(extrinsic::create_unsigned::(call)) - } + // pub fn create_unsigned + Send + Sync>( + // &self, + // call: C, + // ) -> Result, Error> { + // let call = self.encode(call)?; + // Ok(extrinsic::create_unsigned::(call)) + // } /// Creates a signed extrinsic. - pub async fn create_signed + Send + Sync>( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let account_nonce = if let Some(nonce) = signer.nonce() { - nonce - } else { - self.account(signer.account_id(), None).await?.nonce - }; - let call = self.encode(call)?; - let signed = extrinsic::create_signed( - &self.runtime_version, - self.genesis_hash, - account_nonce, - call, - signer, - ) - .await?; - Ok(signed) - } + // pub async fn create_signed + Send + Sync>( + // &self, + // call: C, + // signer: &(dyn Signer + Send + Sync), + // ) -> Result, Error> + // where + // <>::Extra as SignedExtension>::AdditionalSigned: + // Send + Sync, + // { + // let account_nonce = if let Some(nonce) = signer.nonce() { + // nonce + // } else { + // self.account(signer.account_id(), None).await?.nonce + // }; + // let call = self.encode(call)?; + // let signed = extrinsic::create_signed( + // &self.runtime_version, + // self.genesis_hash, + // account_nonce, + // call, + // signer, + // ) + // .await?; + // Ok(signed) + // } /// Returns the events decoder. - pub fn events_decoder(&self) -> &EventsDecoder { + pub fn events_decoder(&self) -> &EventsDecoder { &self.events_decoder } @@ -368,32 +362,32 @@ impl Client { } /// Submits a transaction to the chain. - pub async fn submit + Send + Sync>( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let extrinsic = self.create_signed(call, signer).await?; - self.submit_extrinsic(extrinsic).await - } + // pub async fn submit + Send + Sync>( + // &self, + // call: C, + // signer: &(dyn Signer + Send + Sync), + // ) -> Result + // where + // <>::Extra as SignedExtension>::AdditionalSigned: + // Send + Sync, + // { + // let extrinsic = self.create_signed(call, signer).await?; + // self.submit_extrinsic(extrinsic).await + // } /// Submits transaction to the chain and watch for events. - pub async fn watch + Send + Sync>( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let extrinsic = self.create_signed(call, signer).await?; - self.submit_and_watch_extrinsic(extrinsic).await - } + // pub async fn watch + Send + Sync>( + // &self, + // call: C, + // signer: &(dyn Signer + Send + Sync), + // ) -> Result, Error> + // where + // <>::Extra as SignedExtension>::AdditionalSigned: + // Send + Sync, + // { + // let extrinsic = self.create_signed(call, signer).await?; + // self.submit_and_watch_extrinsic(extrinsic).await + // } /// Insert a key into the keystore. pub async fn insert_key( diff --git a/src/events.rs b/src/events.rs index f5964a8854..a2c5abf31e 100644 --- a/src/events.rs +++ b/src/events.rs @@ -105,20 +105,12 @@ impl Default for TypeMarker { } /// Events decoder. -#[derive(Debug)] -pub struct EventsDecoder { +#[derive(Debug, Clone)] +pub struct EventsDecoder { metadata: Metadata, } -impl Clone for EventsDecoder { - fn clone(&self) -> Self { - Self { - metadata: self.metadata.clone(), - } - } -} - -impl EventsDecoder { +impl EventsDecoder { /// Creates a new `EventsDecoder`. pub fn new(metadata: Metadata) -> Self { Self { From 59aa4d7684be0c8c355ce204a439d2be59ac4577 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 26 Aug 2021 17:44:52 +0100 Subject: [PATCH 008/216] Add back Runtime trait coped from original System trait --- src/client.rs | 4 ++-- src/lib.rs | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/client.rs b/src/client.rs index f3387d57dc..e4c7e07ce8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -52,7 +52,7 @@ use crate::{Error, events::EventsDecoder, extrinsic::{ EventStorageSubscription, EventSubscription, FinalizedEventStorageSubscription, -}, BlockNumber, ReadProof}; +}, BlockNumber, ReadProof, Runtime}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -101,7 +101,7 @@ impl ClientBuilder { } /// Creates a new Client. - pub async fn build<'a>(self) -> Result, Error> { + pub async fn build(self) -> Result, Error> { let client = if let Some(client) = self.client { client } else { diff --git a/src/lib.rs b/src/lib.rs index e3eb9ef90e..55b2864802 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,6 +106,53 @@ use crate::{ }, }; +pub trait Runtime: Send + Sync + 'static { + /// Account index (aka nonce) type. This stores the number of previous + /// transactions associated with a sender account. + type Index: Parameter + + Default + // + MaybeDisplay + // + AtLeast32Bit + + Copy; + + /// The block number type used by the runtime. + type BlockNumber: Parameter + // + Member + // + MaybeMallocSizeOf + // + MaybeSerializeDeserialize + // + Debug + // + MaybeDisplay + // + AtLeast32BitUnsigned + + Default + // + Bounded + + Copy + + std::hash::Hash + + std::str::FromStr; + + /// The output of the `Hashing` function. + type Hash: Parameter + + Ord + + Default + + Copy + + std::hash::Hash + + AsRef<[u8]> + + AsMut<[u8]>; + + /// The user account identifier type for the runtime. + type AccountId: Parameter; // + Member + MaybeSerialize + MaybeDisplay + Ord + Default; + + // /// The address type. This instead of `::Source`. + // #[module(ignore)] + // type Address: Codec + Clone + PartialEq; + // + Debug + Send + Sync; + + // /// The block header. + // #[module(ignore)] + // type Header: Parameter; + // + Header + // + DeserializeOwned; +} + /// A phase of a block's execution. #[derive(Clone, Debug, Eq, PartialEq, Decode)] pub enum Phase { From e337d344636276091b748a3febfbe0df769fe60a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 27 Aug 2021 12:00:47 +0100 Subject: [PATCH 009/216] Make subxt lib compile --- src/client.rs | 8 +- src/error.rs | 20 ++- src/events.rs | 191 ++++++++++----------- src/extrinsic/extra.rs | 302 +++++++++++++++++++++++++++++++++ src/extrinsic/mod.rs | 6 +- src/extrinsic/signer.rs | 2 +- src/lib.rs | 67 +++++--- src/metadata.rs | 358 ++++++++++++++++++++++++++++++++++++++++ src/rpc.rs | 20 +-- src/subscription.rs | 8 +- 10 files changed, 834 insertions(+), 148 deletions(-) create mode 100644 src/extrinsic/extra.rs create mode 100644 src/metadata.rs diff --git a/src/client.rs b/src/client.rs index e4c7e07ce8..d8056abffe 100644 --- a/src/client.rs +++ b/src/client.rs @@ -17,7 +17,6 @@ use codec::{ Decode, }; -pub use frame_metadata::RuntimeMetadataLastVersion as Metadata; use futures::future; use jsonrpsee_http_client::HttpClientBuilder; use jsonrpsee_types::Subscription; @@ -39,7 +38,6 @@ use std::{ use crate::{Error, events::EventsDecoder, extrinsic::{ self, PairSigner, - SignedExtra, Signer, UncheckedExtrinsic, }, rpc::{ @@ -52,7 +50,7 @@ use crate::{Error, events::EventsDecoder, extrinsic::{ EventStorageSubscription, EventSubscription, FinalizedEventStorageSubscription, -}, BlockNumber, ReadProof, Runtime}; +}, BlockNumber, Metadata, ReadProof, Runtime}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -151,7 +149,7 @@ pub struct Client { rpc: Rpc, genesis_hash: T::Hash, metadata: Metadata, - events_decoder: EventsDecoder, + events_decoder: EventsDecoder, properties: SystemProperties, runtime_version: RuntimeVersion, _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, @@ -339,7 +337,7 @@ impl Client { // } /// Returns the events decoder. - pub fn events_decoder(&self) -> &EventsDecoder { + pub fn events_decoder(&self) -> &EventsDecoder { &self.events_decoder } diff --git a/src/error.rs b/src/error.rs index ecb7737064..4ab4cb8e22 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . +use crate::Metadata; use jsonrpsee_types::Error as RequestError; use sp_core::crypto::SecretStringError; use sp_runtime::{ @@ -21,6 +22,7 @@ use sp_runtime::{ DispatchError, }; use thiserror::Error; +use crate::metadata::InvalidMetadataError; /// Error enum. #[derive(Debug, Error)] @@ -43,6 +45,9 @@ pub enum Error { /// Extrinsic validity error #[error("Transaction Validity Error: {0:?}")] Invalid(TransactionValidityError), + /// Invalid metadata error + #[error("Invalid Metadata: {0}")] + InvalidMetadata(#[from] InvalidMetadataError), /// Runtime error. #[error("Runtime error: {0}")] Runtime(#[from] RuntimeError), @@ -110,18 +115,21 @@ impl RuntimeError { error, message: _, } => { - let module = metadata.module_with_errors(index)?; - let error = module.error(error)?; - Ok(Self::Module(ModuleError { - module: module.name().to_string(), - error: error.to_string(), - })) + todo!() + // let module = metadata.module_with_errors(index)?; + // let error = module.error(error)?; + // Ok(Self::Module(ModuleError { + // module: module.name().to_string(), + // error: error.to_string(), + // })) } DispatchError::BadOrigin => Ok(Self::BadOrigin), DispatchError::CannotLookup => Ok(Self::CannotLookup), DispatchError::ConsumerRemaining => Ok(Self::ConsumerRemaining), DispatchError::NoProviders => Ok(Self::NoProviders), DispatchError::Other(msg) => Ok(Self::Other(msg.into())), + DispatchError::Token(_) => todo!(), + DispatchError::Arithmetic(_) => todo!(), } } } diff --git a/src/events.rs b/src/events.rs index a2c5abf31e..eeb893a4df 100644 --- a/src/events.rs +++ b/src/events.rs @@ -43,14 +43,11 @@ use std::{ }; use crate::{ - error::{ - Error, - RuntimeError, - }, + Runtime, + Error, + RuntimeError, Metadata, Phase, - Runtime, - System, }; /// Raw bytes for an Event @@ -106,74 +103,80 @@ impl Default for TypeMarker { /// Events decoder. #[derive(Debug, Clone)] -pub struct EventsDecoder { +pub struct EventsDecoder { metadata: Metadata, + marker: PhantomData, } -impl EventsDecoder { +impl EventsDecoder +where + T: Runtime +{ /// Creates a new `EventsDecoder`. pub fn new(metadata: Metadata) -> Self { Self { metadata, + marker: Default::default(), } } /// Decode events. pub fn decode_events(&self, input: &mut &[u8]) -> Result, Error> { - let compact_len = >::decode(input)?; - let len = compact_len.0 as usize; - - let mut r = Vec::new(); - for _ in 0..len { - // decode EventRecord - let phase = Phase::decode(input)?; - let module_variant = input.read_byte()?; - - let module = self.metadata.module_with_events(module_variant)?; - let event_variant = input.read_byte()?; - let event_metadata = module.event(event_variant)?; - - log::debug!( - "received event '{}::{}' ({:?})", - module.name(), - event_metadata.name, - event_metadata.arguments() - ); - - let mut event_data = Vec::::new(); - let mut event_errors = Vec::::new(); - let result = self.decode_raw_bytes( - &event_metadata.arguments(), - input, - &mut event_data, - &mut event_errors, - ); - let raw = match result { - Ok(()) => { - log::debug!("raw bytes: {}", hex::encode(&event_data),); - - let event = RawEvent { - module: module.name().to_string(), - variant: event_metadata.name.clone(), - data: event_data, - }; - - // topics come after the event data in EventRecord - let _topics = Vec::::decode(input)?; - Raw::Event(event) - } - Err(err) => return Err(err), - }; - - if event_errors.is_empty() { - r.push((phase.clone(), raw)); - } - - for err in event_errors { - r.push((phase.clone(), Raw::Error(err))); - } - } - Ok(r) + todo!() + // let compact_len = >::decode(input)?; + // let len = compact_len.0 as usize; + // + // let mut r = Vec::new(); + // for _ in 0..len { + // // decode EventRecord + // let phase = Phase::decode(input)?; + // let module_variant = input.read_byte()?; + // + // let module = self.metadata.module_with_events(module_variant)?; + // let event_variant = input.read_byte()?; + // let event_metadata = module.event(event_variant)?; + // + // log::debug!( + // "received event '{}::{}' ({:?})", + // module.name(), + // event_metadata.name, + // event_metadata.arguments() + // ); + // + // let mut event_data = Vec::::new(); + // let mut event_errors = Vec::::new(); + // let result = self.decode_raw_bytes( + // &event_metadata.arguments(), + // input, + // &mut event_data, + // &mut event_errors, + // ); + // let raw = match result { + // Ok(()) => { + // log::debug!("raw bytes: {}", hex::encode(&event_data),); + // + // let event = RawEvent { + // module: module.name().to_string(), + // variant: event_metadata.name.clone(), + // data: event_data, + // }; + // + // // topics come after the event data in EventRecord + // let _topics = Vec::::decode(input)?; + // Raw::Event(event) + // } + // Err(err) => return Err(err), + // }; + // + // if event_errors.is_empty() { + // r.push((phase.clone(), raw)); + // } + // + // for err in event_errors { + // r.push((phase.clone(), Raw::Error(err))); + // } + // } + // Ok(r) } fn decode_raw_bytes( @@ -246,35 +249,35 @@ pub enum Raw { Error(RuntimeError), } -#[cfg(test)] -mod tests { - use super::*; - use std::convert::TryFrom; - - type TestRuntime = crate::NodeTemplateRuntime; - - #[test] - fn test_decode_option() { - let decoder = EventsDecoder::::new( - Metadata::default(), - ); - - let value = Some(0u8); - let input = value.encode(); - let mut output = Vec::::new(); - let mut errors = Vec::::new(); - - decoder - .decode_raw_bytes( - &[EventArg::Option(Box::new(EventArg::Primitive( - "u8".to_string(), - )))], - &mut &input[..], - &mut output, - &mut errors, - ) - .unwrap(); - - assert_eq!(output, vec![1, 0]); - } -} +// #[cfg(test)] +// mod tests { +// use super::*; +// use std::convert::TryFrom; +// +// type TestRuntime = crate::NodeTemplateRuntime; +// +// #[test] +// fn test_decode_option() { +// let decoder = EventsDecoder::::new( +// Metadata::default(), +// ); +// +// let value = Some(0u8); +// let input = value.encode(); +// let mut output = Vec::::new(); +// let mut errors = Vec::::new(); +// +// decoder +// .decode_raw_bytes( +// &[EventArg::Option(Box::new(EventArg::Primitive( +// "u8".to_string(), +// )))], +// &mut &input[..], +// &mut output, +// &mut errors, +// ) +// .unwrap(); +// +// assert_eq!(output, vec![1, 0]); +// } +// } diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs new file mode 100644 index 0000000000..928b6e4530 --- /dev/null +++ b/src/extrinsic/extra.rs @@ -0,0 +1,302 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use codec::{ + Decode, + Encode, +}; +use core::{ + fmt::Debug, + marker::PhantomData, +}; +use sp_runtime::{ + generic::Era, + traits::SignedExtension, + transaction_validity::TransactionValidityError, +}; + +use crate::Runtime; + +/// Extra type. +pub type Extra = <::Extra as SignedExtra>::Extra; + +/// SignedExtra checks copied from substrate, in order to remove requirement to implement +/// substrate's `frame_system::Trait` + +/// Ensure the runtime version registered in the transaction is the same as at present. +/// +/// # Note +/// +/// This is modified from the substrate version to allow passing in of the version, which is +/// returned via `additional_signed()`. + +/// Ensure the runtime version registered in the transaction is the same as at present. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct CheckSpecVersion( + pub PhantomData, + /// Local version to be used for `AdditionalSigned` + #[codec(skip)] + pub u32, +); + +impl SignedExtension for CheckSpecVersion +where + T: Runtime + Clone + Debug + Eq + Send + Sync, +{ + const IDENTIFIER: &'static str = "CheckSpecVersion"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = u32; + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(self.1) + } +} + +/// Ensure the transaction version registered in the transaction is the same as at present. +/// +/// # Note +/// +/// This is modified from the substrate version to allow passing in of the version, which is +/// returned via `additional_signed()`. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct CheckTxVersion( + pub PhantomData, + /// Local version to be used for `AdditionalSigned` + #[codec(skip)] + pub u32, +); + +impl SignedExtension for CheckTxVersion +where + T: Runtime + Clone + Debug + Eq + Send + Sync, +{ + const IDENTIFIER: &'static str = "CheckTxVersion"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = u32; + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(self.1) + } +} + +/// Check genesis hash +/// +/// # Note +/// +/// This is modified from the substrate version to allow passing in of the genesis hash, which is +/// returned via `additional_signed()`. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct CheckGenesis( + pub PhantomData, + /// Local genesis hash to be used for `AdditionalSigned` + #[codec(skip)] + pub T::Hash, +); + +impl SignedExtension for CheckGenesis +where + T: Runtime + Clone + Debug + Eq + Send + Sync, +{ + const IDENTIFIER: &'static str = "CheckGenesis"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = T::Hash; + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(self.1) + } +} + +/// Check for transaction mortality. +/// +/// # Note +/// +/// This is modified from the substrate version to allow passing in of the genesis hash, which is +/// returned via `additional_signed()`. It assumes therefore `Era::Immortal` (The transaction is +/// valid forever) +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct CheckEra( + /// The default structure for the Extra encoding + pub (Era, PhantomData), + /// Local genesis hash to be used for `AdditionalSigned` + #[codec(skip)] + pub T::Hash, +); + +impl SignedExtension for CheckEra +where + T: Runtime + Clone + Debug + Eq + Send + Sync, +{ + const IDENTIFIER: &'static str = "CheckEra"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = T::Hash; + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(self.1) + } +} + +/// Nonce check and increment to give replay protection for transactions. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct CheckNonce(#[codec(compact)] pub T::Index); + +impl SignedExtension for CheckNonce +where + T: Runtime + Clone + Debug + Eq + Send + Sync, +{ + const IDENTIFIER: &'static str = "CheckNonce"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = (); + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(()) + } +} + +/// Resource limit check. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct CheckWeight(pub PhantomData); + +impl SignedExtension for CheckWeight +where + T: Runtime + Clone + Debug + Eq + Send + Sync, +{ + const IDENTIFIER: &'static str = "CheckWeight"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = (); + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(()) + } +} + +/// Require the transactor pay for themselves and maybe include a tip to gain additional priority +/// in the queue. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct ChargeTransactionPayment(#[codec(compact)] pub u128); + +impl SignedExtension for ChargeTransactionPayment { + const IDENTIFIER: &'static str = "ChargeTransactionPayment"; + type AccountId = u64; + type Call = (); + type AdditionalSigned = (); + type Pre = (); + fn additional_signed( + &self, + ) -> Result { + Ok(()) + } +} + +/// Trait for implementing transaction extras for a runtime. +pub trait SignedExtra: SignedExtension { + /// The type the extras. + type Extra: SignedExtension + Send + Sync; + + /// Creates a new `SignedExtra`. + fn new( + spec_version: u32, + tx_version: u32, + nonce: T::Index, + genesis_hash: T::Hash, + ) -> Self; + + /// Returns the transaction extra. + fn extra(&self) -> Self::Extra; +} + +/// Default `SignedExtra` for substrate runtimes. +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +pub struct DefaultExtra { + spec_version: u32, + tx_version: u32, + nonce: T::Index, + genesis_hash: T::Hash, +} + +impl SignedExtra + for DefaultExtra +{ + type Extra = ( + CheckSpecVersion, + CheckTxVersion, + CheckGenesis, + CheckEra, + CheckNonce, + CheckWeight, + ChargeTransactionPayment, + ); + + fn new( + spec_version: u32, + tx_version: u32, + nonce: T::Index, + genesis_hash: T::Hash, + ) -> Self { + DefaultExtra { + spec_version, + tx_version, + nonce, + genesis_hash, + } + } + + fn extra(&self) -> Self::Extra { + ( + CheckSpecVersion(PhantomData, self.spec_version), + CheckTxVersion(PhantomData, self.tx_version), + CheckGenesis(PhantomData, self.genesis_hash), + CheckEra((Era::Immortal, PhantomData), self.genesis_hash), + CheckNonce(self.nonce), + CheckWeight(PhantomData), + ChargeTransactionPayment(u128::default()), + ) + } +} + +impl SignedExtension + for DefaultExtra +{ + const IDENTIFIER: &'static str = "DefaultExtra"; + type AccountId = T::AccountId; + type Call = (); + type AdditionalSigned = + <>::Extra as SignedExtension>::AdditionalSigned; + type Pre = (); + + fn additional_signed( + &self, + ) -> Result { + self.extra().additional_signed() + } +} diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index 367e7f4b31..c5e6f4f8ff 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -16,6 +16,7 @@ //! Create signed or unsigned extrinsics. +mod extra; mod signer; pub use self::{ @@ -41,15 +42,14 @@ use sp_runtime::traits::SignedExtension; use sp_version::RuntimeVersion; use crate::{ - frame::system::System, - runtimes::Runtime, + Runtime, Encoded, Error, }; /// UncheckedExtrinsic type. pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< - ::Address, + ::Address, Encoded, ::Signature, Extra, diff --git a/src/extrinsic/signer.rs b/src/extrinsic/signer.rs index 357ac36042..9010341985 100644 --- a/src/extrinsic/signer.rs +++ b/src/extrinsic/signer.rs @@ -22,7 +22,7 @@ use super::{ SignedPayload, UncheckedExtrinsic, }; -use crate::runtimes::Runtime; +use crate::Runtime; use codec::Encode; use sp_core::Pair; use sp_runtime::traits::{ diff --git a/src/lib.rs b/src/lib.rs index 55b2864802..33f3526cca 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,12 +46,10 @@ extern crate substrate_subxt_proc_macro; pub use sp_core; pub use sp_runtime; -use codec::{ - Codec, - Decode, -}; -pub use frame_metadata::RuntimeMetadataLastVersion as Metadata; +use codec::{Codec, Decode, EncodeLike, Encode}; +use serde::de::DeserializeOwned; use std::{ + fmt::Debug, marker::PhantomData, sync::Arc, }; @@ -60,6 +58,7 @@ mod client; mod error; mod events; pub mod extrinsic; +mod metadata; mod rpc; mod subscription; @@ -79,11 +78,7 @@ pub use crate::{ Signer, UncheckedExtrinsic, }, - frame::*, - metadata::{ - Metadata, - MetadataError, - }, + metadata::Metadata, rpc::{ BlockNumber, ExtrinsicSuccess, @@ -91,7 +86,6 @@ pub use crate::{ RpcClient, SystemProperties, }, - runtimes::*, subscription::{ EventStorageSubscription, EventSubscription, @@ -105,19 +99,26 @@ use crate::{ Rpc, }, }; +use crate::sp_runtime::traits::{Verify, Extrinsic, Member, Hash, Header, AtLeast32Bit, MaybeSerializeDeserialize}; + +/// Parameter trait compied from substrate::frame_support +pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} +impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} -pub trait Runtime: Send + Sync + 'static { +/// Runtime types. +pub trait Runtime: Clone + Sized + Send + Sync + 'static { /// Account index (aka nonce) type. This stores the number of previous /// transactions associated with a sender account. type Index: Parameter + + Member + Default // + MaybeDisplay - // + AtLeast32Bit + + AtLeast32Bit + Copy; /// The block number type used by the runtime. type BlockNumber: Parameter - // + Member + + Member // + MaybeMallocSizeOf // + MaybeSerializeDeserialize // + Debug @@ -131,6 +132,8 @@ pub trait Runtime: Send + Sync + 'static { /// The output of the `Hashing` function. type Hash: Parameter + + Member + + MaybeSerializeDeserialize + Ord + Default + Copy @@ -138,19 +141,37 @@ pub trait Runtime: Send + Sync + 'static { + AsRef<[u8]> + AsMut<[u8]>; + /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). + type Hashing: Hash; + /// The user account identifier type for the runtime. - type AccountId: Parameter; // + Member + MaybeSerialize + MaybeDisplay + Ord + Default; + type AccountId: Parameter + Member; // + MaybeSerialize + MaybeDisplay + Ord + Default; - // /// The address type. This instead of `::Source`. - // #[module(ignore)] - // type Address: Codec + Clone + PartialEq; + /// The address type. This instead of `::Source`. + type Address: Codec + Clone + PartialEq; // + Debug + Send + Sync; - // /// The block header. - // #[module(ignore)] - // type Header: Parameter; - // + Header - // + DeserializeOwned; + /// The block header. + type Header: Parameter + + Header + + DeserializeOwned; + + /// Transaction extras. + type Extra: SignedExtra + Send + Sync + 'static; + + /// Signature type. + type Signature: Verify + Encode + Send + Sync + 'static; + + /// Extrinsic type within blocks. + type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; +} + +/// Event trait. +pub trait Event: Decode { + /// Module name. + const MODULE: &'static str; + /// Event name. + const EVENT: &'static str; } /// A phase of a block's execution. diff --git a/src/metadata.rs b/src/metadata.rs new file mode 100644 index 0000000000..7e88a04440 --- /dev/null +++ b/src/metadata.rs @@ -0,0 +1,358 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use std::{ + collections::HashMap, + convert::TryFrom, + marker::PhantomData, + str::FromStr, +}; + +use codec::{ + Decode, + Encode, + Error as CodecError, +}; + +use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed, StorageEntryModifier, StorageEntryType, StorageHasher, META_RESERVED, RuntimeMetadataLastVersion, PalletConstantMetadata}; +use sp_core::storage::StorageKey; + +use crate::Encoded; + +/// Metadata error. +#[derive(Debug, thiserror::Error)] +pub enum MetadataError { + /// Module is not in metadata. + #[error("Module {0} not found")] + ModuleNotFound(String), + /// Module is not in metadata. + #[error("Module index {0} not found")] + ModuleIndexNotFound(u8), + /// Call is not in metadata. + #[error("Call {0} not found")] + CallNotFound(&'static str), + /// Event is not in metadata. + #[error("Event {0} not found")] + EventNotFound(u8), + /// Event is not in metadata. + #[error("Error {0} not found")] + ErrorNotFound(u8), + /// Storage is not in metadata. + #[error("Storage {0} not found")] + StorageNotFound(&'static str), + /// Storage type does not match requested type. + #[error("Storage type error")] + StorageTypeError, + /// Default error. + #[error("Failed to decode default: {0}")] + DefaultError(CodecError), + /// Failure to decode constant value. + #[error("Failed to decode constant value: {0}")] + ConstantValueError(CodecError), + /// Constant is not in metadata. + #[error("Constant {0} not found")] + ConstantNotFound(&'static str), +} + +/// Runtime metadata. +#[derive(Clone, Debug)] +pub struct Metadata { + metadata: RuntimeMetadataLastVersion, +} + +impl Metadata { + /// Returns `ModuleMetadata`. + pub fn pallet(&self, name: S) -> Result<&PalletMetadata, MetadataError> + where + S: ToString, + { + todo!() + // let name = name.to_string(); + // self.modules + // .get(&name) + // .ok_or(MetadataError::ModuleNotFound(name)) + } +} + +#[derive(Clone, Debug)] +pub struct PalletMetadata { + index: u8, + name: String, + storage: HashMap, + constants: HashMap, +} + +impl PalletMetadata { + pub fn storage(&self, key: &'static str) -> Result<&StorageMetadata, MetadataError> { + self.storage + .get(key) + .ok_or(MetadataError::StorageNotFound(key)) + } + + /// Get a constant's metadata by name + pub fn constant( + &self, + key: &'static str, + ) -> Result<&PalletConstantMetadata, MetadataError> { + self.constants + .get(key) + .ok_or(MetadataError::ConstantNotFound(key)) + } +} + +#[derive(Clone, Debug)] +pub struct StorageMetadata { + module_prefix: String, + storage_prefix: String, + modifier: StorageEntryModifier, + ty: StorageEntryType, + default: Vec, +} + +impl StorageMetadata { + pub fn prefix(&self) -> StorageKey { + let mut bytes = sp_core::twox_128(self.module_prefix.as_bytes()).to_vec(); + bytes.extend(&sp_core::twox_128(self.storage_prefix.as_bytes())[..]); + StorageKey(bytes) + } + + pub fn default(&self) -> Result { + Decode::decode(&mut &self.default[..]).map_err(MetadataError::DefaultError) + } + + pub fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { + match hasher { + StorageHasher::Identity => bytes.to_vec(), + StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), + StorageHasher::Blake2_128Concat => { + // copied from substrate Blake2_128Concat::hash since StorageHasher is not public + sp_core::blake2_128(bytes) + .iter() + .chain(bytes) + .cloned() + .collect() + } + StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), + StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), + StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), + StorageHasher::Twox64Concat => { + sp_core::twox_64(bytes) + .iter() + .chain(bytes) + .cloned() + .collect() + } + } + } + + pub fn hash_key(hasher: &StorageHasher, key: &K) -> Vec { + Self::hash(hasher, &key.encode()) + } + + pub fn plain(&self) -> Result { + match &self.ty { + StorageEntryType::Plain(_) => { + Ok(StoragePlain { + prefix: self.prefix().0, + }) + } + _ => Err(MetadataError::StorageTypeError), + } + } + + pub fn map(&self) -> Result, MetadataError> { + todo!() + // match &self.ty { + // StorageEntryType::Map { hasher, .. } => { + // Ok(StorageMap { + // _marker: PhantomData, + // prefix: self.prefix().0, + // hasher: hasher.clone(), + // }) + // } + // _ => Err(MetadataError::StorageTypeError), + // } + } + + pub fn double_map( + &self, + ) -> Result, MetadataError> { + todo!() + // match &self.ty { + // StorageEntryType::DoubleMap { + // hasher, + // key2_hasher, + // .. + // } => { + // Ok(StorageDoubleMap { + // _marker: PhantomData, + // prefix: self.prefix().0, + // hasher1: hasher.clone(), + // hasher2: key2_hasher.clone(), + // }) + // } + // _ => Err(MetadataError::StorageTypeError), + // } + } +} + +#[derive(Clone, Debug)] +pub struct StoragePlain { + prefix: Vec, +} + +impl StoragePlain { + pub fn key(&self) -> StorageKey { + StorageKey(self.prefix.clone()) + } +} + +#[derive(Clone, Debug)] +pub struct StorageMap { + _marker: PhantomData, + prefix: Vec, + hasher: StorageHasher, +} + +impl StorageMap { + pub fn key(&self, key: &K) -> StorageKey { + let mut bytes = self.prefix.clone(); + bytes.extend(StorageMetadata::hash_key(&self.hasher, key)); + StorageKey(bytes) + } +} + +#[derive(Clone, Debug)] +pub struct StorageDoubleMap { + _marker: PhantomData<(K1, K2)>, + prefix: Vec, + hasher1: StorageHasher, + hasher2: StorageHasher, +} + +impl StorageDoubleMap { + pub fn key(&self, key1: &K1, key2: &K2) -> StorageKey { + let mut bytes = self.prefix.clone(); + bytes.extend(StorageMetadata::hash_key(&self.hasher1, key1)); + bytes.extend(StorageMetadata::hash_key(&self.hasher2, key2)); + StorageKey(bytes) + } +} + +#[derive(Debug, thiserror::Error)] +pub enum InvalidMetadataError { + #[error("Invalid prefix")] + InvalidPrefix, + #[error("Invalid version")] + InvalidVersion, +} + +impl TryFrom for Metadata { + type Error = InvalidMetadataError; + + fn try_from(metadata: RuntimeMetadataPrefixed) -> Result { + todo!() + // if metadata.0 != META_RESERVED { + // return Err(ConversionError::InvalidPrefix.into()) + // } + // let meta = match metadata.1 { + // RuntimeMetadata::V14(meta) => meta, + // _ => return Err(ConversionError::InvalidVersion.into()), + // }; + // let mut modules = HashMap::new(); + // let mut modules_with_calls = HashMap::new(); + // let mut modules_with_events = HashMap::new(); + // let mut modules_with_errors = HashMap::new(); + // for module in convert(meta.modules)?.into_iter() { + // let module_name = convert(module.name.clone())?; + // + // let mut constant_map = HashMap::new(); + // for constant in convert(module.constants)?.into_iter() { + // let constant_meta = convert_constant(constant)?; + // constant_map.insert(constant_meta.name.clone(), constant_meta); + // } + // + // let mut storage_map = HashMap::new(); + // if let Some(storage) = module.storage { + // let storage = convert(storage)?; + // let module_prefix = convert(storage.prefix)?; + // for entry in convert(storage.entries)?.into_iter() { + // let storage_prefix = convert(entry.name.clone())?; + // let entry = convert_entry( + // module_prefix.clone(), + // storage_prefix.clone(), + // entry, + // )?; + // storage_map.insert(storage_prefix, entry); + // } + // } + // modules.insert( + // module_name.clone(), + // ModuleMetadata { + // index: module.index, + // name: module_name.clone(), + // storage: storage_map, + // constants: constant_map, + // }, + // ); + // + // if let Some(calls) = module.calls { + // let mut call_map = HashMap::new(); + // for (index, call) in convert(calls)?.into_iter().enumerate() { + // let name = convert(call.name)?; + // call_map.insert(name, index as u8); + // } + // modules_with_calls.insert( + // module_name.clone(), + // ModuleWithCalls { + // index: module.index, + // calls: call_map, + // }, + // ); + // } + // if let Some(events) = module.event { + // let mut event_map = HashMap::new(); + // for (index, event) in convert(events)?.into_iter().enumerate() { + // event_map.insert(index as u8, convert_event(event)?); + // } + // modules_with_events.insert( + // module_name.clone(), + // ModuleWithEvents { + // index: module.index, + // name: module_name.clone(), + // events: event_map, + // }, + // ); + // } + // let mut error_map = HashMap::new(); + // for (index, error) in convert(module.errors)?.into_iter().enumerate() { + // error_map.insert(index as u8, convert_error(error)?); + // } + // modules_with_errors.insert( + // module_name.clone(), + // ModuleWithErrors { + // index: module.index, + // name: module_name.clone(), + // errors: error_map, + // }, + // ); + // } + // Ok(Metadata { + // pallets, + // + // }) + } +} diff --git a/src/rpc.rs b/src/rpc.rs index 2673021fc4..abc5e45b36 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -70,17 +70,14 @@ use sp_runtime::{ use sp_version::RuntimeVersion; use crate::{ + Event, error::Error, events::{ EventsDecoder, RawEvent, }, - frame::{ - system::System, - Event, - }, - metadata::Metadata, - runtimes::Runtime, + Metadata, + Runtime, subscription::{ EventStorageSubscription, EventSubscription, @@ -90,7 +87,7 @@ use crate::{ }; pub type ChainBlock = - SignedBlock::Header, ::Extrinsic>>; + SignedBlock::Header, ::Extrinsic>>; /// Wrapper for NumberOrHex to allow custom From impls #[derive(Serialize)] @@ -155,6 +152,7 @@ pub enum TransactionStatus { #[cfg(feature = "client")] use substrate_subxt_client::SubxtClient; +use crate::metadata::{MetadataError, InvalidMetadataError}; /// Rpc client wrapper. /// This is workaround because adding generic types causes the macros to fail. @@ -326,7 +324,7 @@ impl Rpc { keys: Vec, from: T::Hash, to: Option, - ) -> Result::Hash>>, Error> { + ) -> Result>, Error> { let params = &[ to_json_value(keys)?, to_json_value(from)?, @@ -343,7 +341,7 @@ impl Rpc { &self, keys: &[StorageKey], at: Option, - ) -> Result::Hash>>, Error> { + ) -> Result>, Error> { let params = &[to_json_value(keys)?, to_json_value(at)?]; self.client .request("state_queryStorageAt", params) @@ -666,7 +664,7 @@ impl Rpc { /// Captures data for when an extrinsic is successfully included in a block #[derive(Debug)] -pub struct ExtrinsicSuccess { +pub struct ExtrinsicSuccess { /// Block hash. pub block: T::Hash, /// Extrinsic hash. @@ -675,7 +673,7 @@ pub struct ExtrinsicSuccess { pub events: Vec, } -impl ExtrinsicSuccess { +impl ExtrinsicSuccess { /// Find the Event for the given module/variant, with raw encoded event data. /// Returns `None` if the Event is not found. pub fn find_event_raw(&self, module: &str, variant: &str) -> Option<&RawEvent> { diff --git a/src/subscription.rs b/src/subscription.rs index 2fe7192e56..41c2b0e643 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -35,12 +35,10 @@ use crate::{ Raw, RawEvent, }, - frame::{ - system::Phase, - Event, - }, + Phase, + Event, rpc::Rpc, - runtimes::Runtime, + Runtime, }; /// Event subscription simplifies filtering a storage change set stream for From 8540533d3874bc2afa3af989a4e5f849763423ab Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 27 Aug 2021 17:00:40 +0100 Subject: [PATCH 010/216] Delete old proc macros and copy over type generation from chameleon --- Cargo.toml | 5 +- proc-macro/Cargo.toml | 12 +- proc-macro/src/call.rs | 167 ---- proc-macro/src/event.rs | 96 --- proc-macro/src/generate_runtime.rs | 178 +++++ proc-macro/src/generate_types.rs | 1178 ++++++++++++++++++++++++++++ proc-macro/src/lib.rs | 138 +--- proc-macro/src/module.rs | 271 ------- proc-macro/src/store.rs | 262 ------- proc-macro/src/utils.rs | 253 ------ src/lib.rs | 3 +- 11 files changed, 1379 insertions(+), 1184 deletions(-) delete mode 100644 proc-macro/src/call.rs delete mode 100644 proc-macro/src/event.rs create mode 100644 proc-macro/src/generate_runtime.rs create mode 100644 proc-macro/src/generate_types.rs delete mode 100644 proc-macro/src/module.rs delete mode 100644 proc-macro/src/store.rs delete mode 100644 proc-macro/src/utils.rs diff --git a/Cargo.toml b/Cargo.toml index e92f3321a9..e5b6016219 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,8 @@ tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] [dependencies] async-trait = "0.1.49" -codec = { package = "parity-scale-codec", version = "2.1", default-features = false, features = ["derive", "full"] } +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +chameleon = "0.1.0" scale-info = "0.12.0" dyn-clone = "1.0.4" futures = "0.3.13" @@ -40,7 +41,7 @@ serde_json = "1.0.64" thiserror = "1.0.24" url = "2.2.1" -substrate-subxt-proc-macro = { version = "0.15.0", path = "proc-macro" } +subxt-proc-macro = { version = "0.1.0", path = "proc-macro" } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/" } sp-rpc = { package = "sp-rpc", git = "https://github.com/paritytech/substrate/" } diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index 9fade17ef7..0a7f3c716c 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "substrate-subxt-proc-macro" -version = "0.15.0" -authors = ["David Craven ", "Parity Technologies "] +name = "subxt-proc-macro" +version = "0.1.0" +authors = ["Parity Technologies "] edition = "2018" autotests = false @@ -9,20 +9,22 @@ license = "GPL-3.0" repository = "https://github.com/paritytech/substrate-subxt" documentation = "https://docs.rs/substrate-subxt" homepage = "https://www.parity.io/" -description = "Derive calls, events, storage and tests for interacting Substrate modules with substrate-subxt" +description = "Generate types and helpers for interacting with Substrate runtimes." [lib] proc-macro = true [dependencies] async-trait = "0.1.49" +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +frame-metadata = { git = "https://github.com/paritytech/frame-metadata/" } heck = "0.3.2" proc-macro2 = "1.0.24" proc-macro-crate = "0.1.5" proc-macro-error = "1.0.4" quote = "1.0.8" syn = "1.0.58" -synstructure = "0.12.4" +scale-info = "0.12.0" [dev-dependencies] async-std = { version = "1.8.0", features = ["attributes"] } diff --git a/proc-macro/src/call.rs b/proc-macro/src/call.rs deleted file mode 100644 index c4aebbf8e3..0000000000 --- a/proc-macro/src/call.rs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use crate::utils; -use heck::{ - CamelCase, - SnakeCase, -}; -use proc_macro2::TokenStream; -use quote::{ - format_ident, - quote, -}; -use synstructure::Structure; - -pub fn call(s: Structure) -> TokenStream { - let subxt = utils::use_crate("substrate-subxt"); - let ident = &s.ast().ident; - let generics = &s.ast().generics; - let params = utils::type_params(generics); - let module = utils::module_name(generics); - let call_name = utils::ident_to_name(ident, "Call").to_snake_case(); - let bindings = utils::bindings(&s); - let fields = utils::fields(&bindings); - let marker = utils::marker_field(&fields).unwrap_or_else(|| format_ident!("_")); - let filtered_fields = utils::filter_fields(&fields, &marker); - let args = utils::fields_to_args(&filtered_fields); - let build_struct = utils::build_struct(ident, &fields); - let call_trait = format_ident!("{}CallExt", call_name.to_camel_case()); - let call = format_ident!("{}", call_name); - let call_and_watch = format_ident!("{}_and_watch", call_name); - - quote! { - impl#generics #subxt::Call for #ident<#(#params),*> { - const MODULE: &'static str = MODULE; - const FUNCTION: &'static str = #call_name; - } - - /// Call extension trait. - #[async_trait::async_trait] - pub trait #call_trait { - /// Create and submit an extrinsic. - async fn #call<'a>( - &'a self, - signer: &'a (dyn #subxt::Signer + Send + Sync), - #args - ) -> Result; - - /// Create, submit and watch an extrinsic. - async fn #call_and_watch<'a>( - &'a self, - signer: &'a (dyn #subxt::Signer + Send + Sync), - #args - ) -> Result<#subxt::ExtrinsicSuccess, #subxt::Error>; - } - - #[async_trait::async_trait] - impl #call_trait for #subxt::Client - where - <>::Extra as #subxt::SignedExtension>::AdditionalSigned: Send + Sync, - { - async fn #call<'a>( - &'a self, - signer: &'a (dyn #subxt::Signer + Send + Sync), - #args - ) -> Result { - let #marker = core::marker::PhantomData::; - self.submit(#build_struct, signer).await - } - - async fn #call_and_watch<'a>( - &'a self, - signer: &'a (dyn #subxt::Signer + Send + Sync), - #args - ) -> Result<#subxt::ExtrinsicSuccess, #subxt::Error> { - let #marker = core::marker::PhantomData::; - self.watch(#build_struct, signer).await - } - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_transfer_call() { - let input = quote! { - #[derive(Call, Encode)] - pub struct TransferCall<'a, T: Balances> { - pub to: &'a ::Address, - #[codec(compact)] - pub amount: T::Balance, - } - }; - let expected = quote! { - impl<'a, T: Balances> substrate_subxt::Call for TransferCall<'a, T> { - const MODULE: &'static str = MODULE; - const FUNCTION: &'static str = "transfer"; - } - - /// Call extension trait. - #[async_trait::async_trait] - pub trait TransferCallExt { - /// Create and submit an extrinsic. - async fn transfer<'a>( - &'a self, - signer: &'a (dyn substrate_subxt::Signer + Send + Sync), - to: &'a ::Address, - amount: T::Balance, - ) -> Result; - - /// Create, submit and watch an extrinsic. - async fn transfer_and_watch<'a>( - &'a self, - signer: &'a (dyn substrate_subxt::Signer + Send + Sync), - to: &'a ::Address, - amount: T::Balance, - ) -> Result, substrate_subxt::Error>; - } - - #[async_trait::async_trait] - impl TransferCallExt for substrate_subxt::Client - where - <>::Extra as substrate_subxt::SignedExtension>::AdditionalSigned: Send + Sync, - { - async fn transfer<'a>( - &'a self, - signer: &'a (dyn substrate_subxt::Signer + Send + Sync), - to: &'a ::Address, - amount: T::Balance, - ) -> Result { - let _ = core::marker::PhantomData::; - self.submit(TransferCall { to, amount, }, signer).await - } - - async fn transfer_and_watch<'a>( - &'a self, - signer: &'a (dyn substrate_subxt::Signer + Send + Sync), - to: &'a ::Address, - amount: T::Balance, - ) -> Result, substrate_subxt::Error> { - let _ = core::marker::PhantomData::; - self.watch(TransferCall { to, amount, }, signer).await - } - } - }; - let derive_input = syn::parse2(input).unwrap(); - let s = Structure::new(&derive_input); - let result = call(s); - utils::assert_proc_macro(result, expected); - } -} diff --git a/proc-macro/src/event.rs b/proc-macro/src/event.rs deleted file mode 100644 index e653442b94..0000000000 --- a/proc-macro/src/event.rs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use crate::utils; -use heck::{ - CamelCase, - SnakeCase, -}; -use proc_macro2::TokenStream; -use quote::{ - format_ident, - quote, -}; -use synstructure::Structure; - -pub fn event(s: Structure) -> TokenStream { - let subxt = utils::use_crate("substrate-subxt"); - let codec = utils::use_crate("parity-scale-codec"); - let ident = &s.ast().ident; - let generics = &s.ast().generics; - let module = utils::module_name(generics); - let event_name = utils::ident_to_name(ident, "Event").to_camel_case(); - let event = format_ident!("{}", event_name.to_snake_case()); - let event_trait = format_ident!("{}EventExt", event_name); - - quote! { - impl #subxt::Event for #ident { - const MODULE: &'static str = MODULE; - const EVENT: &'static str = #event_name; - } - - /// Event extension trait. - pub trait #event_trait { - /// Retrieves the event. - fn #event(&self) -> Result>, #codec::Error>; - } - - impl #event_trait for #subxt::ExtrinsicSuccess { - fn #event(&self) -> Result>, #codec::Error> { - self.find_event() - } - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_transfer_event() { - let input = quote! { - #[derive(Debug, Decode, Eq, Event, PartialEq)] - pub struct TransferEvent { - pub from: ::AccountId, - pub to: ::AccountId, - pub amount: T::Balance, - } - }; - let expected = quote! { - impl substrate_subxt::Event for TransferEvent { - const MODULE: &'static str = MODULE; - const EVENT: &'static str = "Transfer"; - } - - /// Event extension trait. - pub trait TransferEventExt { - /// Retrieves the event. - fn transfer(&self) -> Result>, codec::Error>; - } - - impl TransferEventExt for substrate_subxt::ExtrinsicSuccess { - fn transfer(&self) -> Result>, codec::Error> { - self.find_event() - } - } - }; - let derive_input = syn::parse2(input).unwrap(); - let s = Structure::new(&derive_input); - let result = event(s); - utils::assert_proc_macro(result, expected); - } -} diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs new file mode 100644 index 0000000000..077df690f1 --- /dev/null +++ b/proc-macro/src/generate_runtime.rs @@ -0,0 +1,178 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use codec::Decode; +use crate::{TokenStream2, TypeGenerator}; +use frame_metadata::{ + v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, +}; +use heck::SnakeCase as _; +use proc_macro_error::{abort, abort_call_site}; +use quote::{format_ident, quote}; +use scale_info::form::PortableForm; +use scale_info::prelude::string::ToString; +use std::{ + fs, + io::{self, Read}, + path, +}; + +pub fn generate_runtime_types

(mod_name: &str, path: P) -> TokenStream2 +where + P: AsRef, +{ + let mut file = fs::File::open(&path) + .unwrap_or_else(|e| abort_call_site!("Failed to open {}: {}", path.as_ref().to_string_lossy(), e)); + + let mut bytes = Vec::new(); + file.read_to_end(&mut bytes) + .unwrap_or_else(|e| abort_call_site!("Failed to read metadata file: {}", e)); + + let metadata = frame_metadata::RuntimeMetadataPrefixed::decode(&mut &bytes[..]) + .unwrap_or_else(|e| abort_call_site!("Failed to decode metadata: {}", e)); + + let generator = RuntimeGenerator::new(metadata); + generator.generate_runtime(mod_name) +} + +pub struct RuntimeGenerator { + metadata: RuntimeMetadataV14, +} + +impl RuntimeGenerator { + pub fn new(metadata: RuntimeMetadataPrefixed) -> Self { + match metadata.1 { + RuntimeMetadata::V14(v14) => Self { metadata: v14 }, + _ => panic!("Unsupported metadata version {:?}", metadata.1), + } + } + + pub fn generate_runtime(&self, mod_name: &str) -> TokenStream2 { + let type_gen = TypeGenerator::new(&self.metadata.types, "__runtime_types"); + let types_mod = type_gen.generate_types_mod(); + let types_mod_ident = types_mod.ident(); + let modules = self.metadata.pallets.iter().map(|pallet| { + let mod_name = format_ident!("{}", pallet.name.to_string().to_snake_case()); + let mut calls = Vec::new(); + for call in &pallet.calls { + let call_structs = self.generate_call_structs(&type_gen, call); + calls.extend(call_structs) + } + + let event = if let Some(ref event) = pallet.event { + let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); + quote! { + pub type Event = #event_type; + } + } else { + quote! {} + }; + + let calls = if !calls.is_empty() { + quote! { + mod calls { + use super::#types_mod_ident; + #( #calls )* + } + } + } else { + quote! {} + }; + + quote! { + pub mod #mod_name { + use super::#types_mod_ident; + #calls + #event + } + } + }); + + let outer_event_variants = self.metadata.pallets.iter().filter_map(|p| { + let variant_name = format_ident!("{}", p.name); + let mod_name = format_ident!("{}", p.name.to_string().to_snake_case()); + let index = proc_macro2::Literal::u8_unsuffixed(p.index); + + p.event.as_ref().map(|_| { + quote! { + #[codec(index = #index)] + #variant_name(#mod_name::Event), + } + }) + }); + + let outer_event = quote! { + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub enum Event { + #( #outer_event_variants )* + } + }; + + let mod_name = format_ident!("{}", mod_name); + quote! { + #[allow(dead_code, unused_imports, non_camel_case_types)] + pub mod #mod_name { + #outer_event + #( #modules )* + #types_mod + } + } + } + + fn generate_call_structs( + &self, + type_gen: &TypeGenerator, + call: &PalletCallMetadata, + ) -> Vec { + let ty = call.ty; + let name = type_gen.resolve_type_path(ty.id(), &[]); + use crate::generate_types::TypePath; + match name { + TypePath::Parameter(_) => panic!("Call type should be a Type"), + TypePath::Type(ref ty) => { + let ty = ty.ty(); + + let type_def = ty.type_def(); + if let scale_info::TypeDef::Variant(variant) = type_def { + variant + .variants() + .iter() + .map(|var| { + use heck::CamelCase; + let name = format_ident!("{}", var.name().to_string().to_camel_case()); + let args = var.fields().iter().filter_map(|field| { + field.name().map(|name| { + let name = format_ident!("{}", name); + let ty = type_gen.resolve_type_path(field.ty().id(), &[]); + quote! { #name: #ty } + }) + }); + + quote! { + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct #name { + #( #args ),* + } + } + }) + .collect::>() + } else { + panic!("Call type should be an variant/enum type") + } + } + } + } +} \ No newline at end of file diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs new file mode 100644 index 0000000000..f9d193caa9 --- /dev/null +++ b/proc-macro/src/generate_types.rs @@ -0,0 +1,1178 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use proc_macro2::{Ident, Span, TokenStream as TokenStream2, TokenStream}; +use quote::{format_ident, quote, ToTokens}; +use scale_info::{form::PortableForm, Field, PortableRegistry, Type, TypeDef, TypeDefPrimitive}; +use std::collections::{BTreeMap, HashSet}; + +#[derive(Debug)] +pub struct TypeGenerator<'a> { + root_mod_ident: Ident, + type_registry: &'a PortableRegistry, +} + +impl<'a> TypeGenerator<'a> { + /// Construct a new [`TypeGenerator`]. + pub fn new(type_registry: &'a PortableRegistry, root_mod: &'static str) -> Self { + let root_mod_ident = Ident::new(root_mod, Span::call_site()); + Self { + root_mod_ident, + type_registry, + } + } + + /// Generate a module containing all types defined in the supplied type registry. + pub fn generate_types_mod(&'a self) -> Module<'a> { + let mut root_mod = Module::new(self.root_mod_ident.clone(), self.root_mod_ident.clone()); + + for (id, ty) in self.type_registry.types().iter().enumerate() { + if ty.ty().path().namespace().is_empty() { + // prelude types e.g. Option/Result have no namespace, so we don't generate them + continue; + } + self.insert_type( + ty.ty().clone(), + id as u32, + ty.ty().path().namespace().to_vec(), + &self.root_mod_ident, + &mut root_mod, + ) + } + + root_mod + } + + fn insert_type( + &'a self, + ty: Type, + id: u32, + path: Vec, + root_mod_ident: &Ident, + module: &mut Module<'a>, + ) { + let segment = path.first().expect("path has at least one segment"); + let mod_ident = Ident::new(segment, Span::call_site()); + + let child_mod = module + .children + .entry(mod_ident.clone()) + .or_insert_with(|| Module::new(mod_ident, root_mod_ident.clone())); + + if path.len() == 1 { + child_mod + .types + .insert(ty.path().clone(), ModuleType { ty, type_gen: self }); + } else { + self.insert_type(ty, id, path[1..].to_vec(), root_mod_ident, child_mod) + } + } + + /// # Panics + /// + /// If no type with the given id found in the type registry. + pub fn resolve_type_path(&self, id: u32, parent_type_params: &[TypeParameter]) -> TypePath { + if let Some(parent_type_param) = parent_type_params + .iter() + .find(|tp| tp.concrete_type_id == id) + { + return TypePath::Parameter(parent_type_param.clone()); + } + + let resolve_type = |id| { + self.type_registry + .resolve(id) + .unwrap_or_else(|| panic!("No type with id {} found", id)) + .clone() + }; + + let mut ty = resolve_type(id); + if ty.path().ident() == Some("Cow".to_string()) { + ty = resolve_type( + ty.type_params()[0] + .ty() + .expect("type parameters to Cow are not expected to be skipped; qed") + .id(), + ) + } + + let params_type_ids = match ty.type_def() { + TypeDef::Array(arr) => vec![arr.type_param().id()], + TypeDef::Sequence(seq) => vec![seq.type_param().id()], + TypeDef::Tuple(tuple) => tuple.fields().iter().map(|f| f.id()).collect(), + TypeDef::Compact(compact) => vec![compact.type_param().id()], + TypeDef::BitSequence(seq) => vec![seq.bit_order_type().id(), seq.bit_store_type().id()], + TypeDef::Range(range) => vec![range.index_type().id()], + _ => ty + .type_params() + .iter() + .filter_map(|f| f.ty().map(|f| f.id())) + .collect(), + }; + + let params = params_type_ids + .iter() + .map(|tp| self.resolve_type_path(*tp, parent_type_params)) + .collect::>(); + + TypePath::Type(TypePathType { + ty, + params, + root_mod_ident: self.root_mod_ident.clone(), + }) + } +} + +#[derive(Debug)] +pub struct Module<'a> { + name: Ident, + root_mod: Ident, + children: BTreeMap>, + types: BTreeMap, ModuleType<'a>>, +} + +impl<'a> ToTokens for Module<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + let name = &self.name; + let root_mod = &self.root_mod; + let modules = self.children.values(); + let types = self.types.values().clone(); + + tokens.extend(quote! { + pub mod #name { + use super::#root_mod; + + #( #modules )* + #( #types )* + } + }) + } +} + +impl<'a> Module<'a> { + pub fn new(name: Ident, root_mod: Ident) -> Self { + Self { + name, + root_mod, + children: BTreeMap::new(), + types: BTreeMap::new(), + } + } + + /// Returns the module with the given path, if any. + pub fn get_mod(&'a self, path_segs: &[&'static str]) -> Option<&'a Module<'a>> { + let (mod_name, rest) = path_segs.split_first()?; + let mod_ident = Ident::new(mod_name, Span::call_site()); + let module = self.children.get(&mod_ident)?; + if rest.is_empty() { + Some(module) + } else { + module.get_mod(rest) + } + } + + /// Returns the module ident. + pub fn ident(&self) -> &Ident { + &self.name + } +} + +#[derive(Debug)] +pub struct ModuleType<'a> { + type_gen: &'a TypeGenerator<'a>, + ty: Type, +} + +impl<'a> quote::ToTokens for ModuleType<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + let type_params = self + .ty + .type_params() + .iter() + .enumerate() + .filter_map(|(i, tp)| match tp.ty() { + Some(ty) => { + let tp_name = format_ident!("_{}", i); + Some(TypeParameter { + concrete_type_id: ty.id(), + name: tp_name, + }) + } + None => None, + }) + .collect::>(); + + let type_name = self.ty.path().ident().map(|ident| { + let type_params = if !type_params.is_empty() { + quote! { < #( #type_params ),* > } + } else { + quote! {} + }; + let ty = format_ident!("{}", ident); + let path = syn::parse_quote! { #ty #type_params}; + syn::Type::Path(path) + }); + + match self.ty.type_def() { + TypeDef::Composite(composite) => { + let type_name = type_name.expect("structs should have a name"); + let (fields, _) = self.composite_fields(composite.fields(), &type_params, true); + let ty_toks = quote! { + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct #type_name #fields + }; + tokens.extend(ty_toks); + } + TypeDef::Variant(variant) => { + let type_name = type_name.expect("variants should have a name"); + let mut variants = Vec::new(); + let mut used_type_params = HashSet::new(); + let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); + + for v in variant.variants() { + let variant_name = format_ident!("{}", v.name()); + let (fields, unused_type_params) = if v.fields().is_empty() { + let unused = type_params_set.iter().cloned().collect::>(); + (quote! {}, unused) + } else { + self.composite_fields(v.fields(), &type_params, false) + }; + variants.push(quote! { #variant_name #fields }); + let unused_params_set = unused_type_params.iter().cloned().collect(); + let used_params = type_params_set.difference(&unused_params_set); + + for used_param in used_params { + used_type_params.insert(used_param.clone()); + } + } + + let unused_type_params = type_params_set + .difference(&used_type_params) + .cloned() + .collect::>(); + if !unused_type_params.is_empty() { + let phantom = Self::phantom_data(&unused_type_params); + variants.push(quote! { + __Ignore(#phantom) + }) + } + + let ty_toks = quote! { + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub enum #type_name { + #( #variants, )* + } + }; + tokens.extend(ty_toks); + } + _ => (), // all built-in types should already be in scope + } + } +} + +impl<'a> ModuleType<'a> { + fn composite_fields( + &self, + fields: &'a [Field], + type_params: &'a [TypeParameter], + is_struct: bool, + ) -> (TokenStream2, Vec) { + let named = fields.iter().all(|f| f.name().is_some()); + let unnamed = fields.iter().all(|f| f.name().is_none()); + + fn unused_type_params<'a>( + type_params: &'a [TypeParameter], + types: impl Iterator, + ) -> Vec { + let mut used_type_params = HashSet::new(); + for ty in types { + ty.parent_type_params(&mut used_type_params) + } + let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); + let mut unused = type_params_set + .difference(&used_type_params) + .cloned() + .collect::>(); + unused.sort(); + unused + } + + let ty_toks = |ty_name: &str, ty_path: &TypePath| { + if ty_name.contains("Box<") { + // todo [AJ] remove this hack once scale-info can represent Box somehow + quote! { std::boxed::Box<#ty_path> } + } else if ty_name.contains("BTreeMap<") { + // todo [AJ] remove this hack and add namespaces or import prelude types + quote! { std::collections::#ty_path } + } else { + quote! { #ty_path } + } + }; + + if named { + let fields = fields + .iter() + .map(|field| { + let name = + format_ident!("{}", field.name().expect("named field without a name")); + let ty = self + .type_gen + .resolve_type_path(field.ty().id(), type_params); + (name, ty, field.type_name()) + }) + .collect::>(); + + let mut fields_tokens = fields + .iter() + .map(|(name, ty, ty_name)| match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! { pub #name: #ty } + } else { + quote! { #name: #ty } + } + } + None => { + quote! { #name: #ty } + } + }) + .collect::>(); + + let unused_params = unused_type_params(type_params, fields.iter().map(|(_, ty, _)| ty)); + + if is_struct && !unused_params.is_empty() { + let phantom = Self::phantom_data(&unused_params); + fields_tokens.push(quote! { + pub __chameleon_unused_type_params: #phantom + }) + } + + let fields = quote! { + { + #( #fields_tokens, )* + } + }; + (fields, unused_params) + } else if unnamed { + let type_paths = fields + .iter() + .map(|field| { + let ty = self + .type_gen + .resolve_type_path(field.ty().id(), type_params); + (ty, field.type_name()) + }) + .collect::>(); + let mut fields_tokens = type_paths + .iter() + .map(|(ty, ty_name)| match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! { pub #ty } + } else { + quote! { #ty } + } + } + None => { + quote! { #ty } + } + }) + .collect::>(); + + let unused_params = + unused_type_params(type_params, type_paths.iter().map(|(ty, _)| ty)); + + if is_struct && !unused_params.is_empty() { + let phantom_data = Self::phantom_data(&unused_params); + fields_tokens.push(quote! { pub #phantom_data }) + } + + let fields = quote! { ( #( #fields_tokens, )* ) }; + let fields_tokens = if is_struct { + // add a semicolon for tuple structs + quote! { #fields; } + } else { + fields + }; + + (fields_tokens, unused_params) + } else { + panic!("Fields must be either all named or all unnamed") + } + } + + fn phantom_data(params: &[TypeParameter]) -> TokenStream2 { + let params = if params.len() == 1 { + let param = ¶ms[0]; + quote! { #param } + } else { + quote! { ( #( #params ), * ) } + }; + quote! ( ::core::marker::PhantomData<#params> ) + } +} + +#[derive(Debug)] +pub enum TypePath { + Parameter(TypeParameter), + Type(TypePathType), +} + +impl quote::ToTokens for TypePath { + fn to_tokens(&self, tokens: &mut TokenStream) { + let syn_type = self.to_syn_type(); + syn_type.to_tokens(tokens) + } +} + +impl TypePath { + pub(crate) fn to_syn_type(&self) -> syn::Type { + match self { + TypePath::Parameter(ty_param) => syn::Type::Path(syn::parse_quote! { #ty_param }), + TypePath::Type(ty) => ty.to_syn_type(), + } + } + + /// Returns the type parameters in a path which are inherited from the containing type. + /// + /// # Example + /// + /// ```rust + /// struct S { + /// a: Vec>, // the parent type param here is `T` + /// } + /// ``` + fn parent_type_params(&self, acc: &mut HashSet) { + match self { + Self::Parameter(type_parameter) => { + acc.insert(type_parameter.clone()); + } + Self::Type(type_path) => type_path.parent_type_params(acc), + } + } +} + +#[derive(Debug)] +pub struct TypePathType { + ty: Type, + params: Vec, + root_mod_ident: Ident, +} + +impl TypePathType { + pub(crate) fn ty(&self) -> &Type { + &self.ty + } + + fn to_syn_type(&self) -> syn::Type { + let params = &self.params; + match self.ty.type_def() { + TypeDef::Composite(_) | TypeDef::Variant(_) => { + let mut ty_path = self + .ty + .path() + .segments() + .iter() + .map(|s| syn::PathSegment::from(format_ident!("{}", s))) + .collect::>(); + if !self.ty.path().namespace().is_empty() { + // types without a namespace are assumed to be globally in scope e.g. `Option`s + ty_path.insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); + } + + let params = &self.params; + let path = if params.is_empty() { + syn::parse_quote! { #ty_path } + } else { + syn::parse_quote! { #ty_path< #( #params ),* > } + }; + syn::Type::Path(path) + } + TypeDef::Sequence(_) => { + let type_param = &self.params[0]; + let type_path = syn::parse_quote! { Vec<#type_param> }; + syn::Type::Path(type_path) + } + TypeDef::Array(array) => { + let array_type = &self.params[0]; + let array_len = array.len() as usize; + let array = syn::parse_quote! { [#array_type; #array_len] }; + syn::Type::Array(array) + } + TypeDef::Tuple(_) => { + let tuple = syn::parse_quote! { (#( # params, )* ) }; + syn::Type::Tuple(tuple) + } + TypeDef::Primitive(primitive) => { + let primitive = match primitive { + TypeDefPrimitive::Bool => "bool", + TypeDefPrimitive::Char => "char", + TypeDefPrimitive::Str => "String", + TypeDefPrimitive::U8 => "u8", + TypeDefPrimitive::U16 => "u16", + TypeDefPrimitive::U32 => "u32", + TypeDefPrimitive::U64 => "u64", + TypeDefPrimitive::U128 => "u128", + TypeDefPrimitive::U256 => unimplemented!("not a rust primitive"), + TypeDefPrimitive::I8 => "i8", + TypeDefPrimitive::I16 => "i16", + TypeDefPrimitive::I32 => "i32", + TypeDefPrimitive::I64 => "i64", + TypeDefPrimitive::I128 => "i128", + TypeDefPrimitive::I256 => unimplemented!("not a rust primitive"), + }; + let ident = format_ident!("{}", primitive); + let path = syn::parse_quote! { #ident }; + syn::Type::Path(path) + } + TypeDef::Compact(_) => { + // todo: change the return type of this method to include info that it is compact + // and should be annotated with #[compact] for fields + let compact_type = &self.params[0]; + syn::Type::Path(syn::parse_quote! ( #compact_type )) + } + TypeDef::BitSequence(_) => { + let bit_order_type = &self.params[0]; + let bit_store_type = &self.params[1]; + + let mut type_path: syn::punctuated::Punctuated = + syn::parse_quote! { bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; + type_path.insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); + let type_path = syn::parse_quote! { #type_path }; + + syn::Type::Path(type_path) + } + TypeDef::Range(range) => { + let idx = &self.params[0]; + let type_path = if range.inclusive() { + syn::parse_quote! { ::core::ops::RangeInclusive<#idx> } + } else { + syn::parse_quote! { ::core::ops::Range<#idx> } + }; + syn::Type::Path(type_path) + } + } + } + + /// Returns the type parameters in a path which are inherited from the containing type. + /// + /// # Example + /// + /// ```rust + /// struct S { + /// a: Vec>, // the parent type param here is `T` + /// } + /// ``` + fn parent_type_params(&self, acc: &mut HashSet) { + for p in &self.params { + p.parent_type_params(acc); + } + } +} + +#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct TypeParameter { + concrete_type_id: u32, + name: proc_macro2::Ident, +} + +impl quote::ToTokens for TypeParameter { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.name.to_tokens(tokens) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use pretty_assertions::assert_eq; + use scale_info::{meta_type, Registry, TypeInfo}; + + const MOD_PATH: &'static [&'static str] = &["chameleon_core", "generate_types", "tests"]; + + #[test] + fn generate_struct_with_primitives() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: bool, + b: u32, + c: char, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct S { + pub a: bool, + pub b: u32, + pub c: char, + } + } + } + .to_string() + ) + } + + #[test] + fn generate_struct_with_a_struct_field() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Parent { + a: bool, + b: Child, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct Child { + a: i32, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Child { + pub a: i32, + } + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Parent { + pub a: bool, + pub b: root::chameleon_core::generate_types::tests::Child, + } + } + } + .to_string() + ) + } + + #[test] + fn generate_tuple_struct() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Parent(bool, Child); + + #[allow(unused)] + #[derive(TypeInfo)] + struct Child(i32); + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Child(pub i32,); + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Parent(pub bool, pub root::chameleon_core::generate_types::tests::Child,); + } + } + .to_string() + ) + } + + #[test] + fn generate_enum() { + #[allow(unused)] + #[derive(TypeInfo)] + enum E { + A, + B(bool), + C { a: u32 }, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub enum E { + A, + B (bool,), + C { a: u32, }, + } + } + } + .to_string() + ) + } + + #[test] + fn generate_array_field() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: [u8; 32], + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct S { + pub a: [u8; 32usize], + } + } + } + .to_string() + ) + } + + #[test] + fn option_fields() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: Option, + b: Option, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct S { + pub a: Option, + pub b: Option, + } + } + } + .to_string() + ) + } + + #[test] + fn box_fields_struct() { + // todo: [AJ] remove hack for Box and make no_std compatible using `alloc::Box` + + use std::boxed::Box; + + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: std::boxed::Box, + b: Box, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct S { + pub a: std::boxed::Box, + pub b: std::boxed::Box, + } + } + } + .to_string() + ) + } + + #[test] + fn box_fields_enum() { + use std::boxed::Box; + + #[allow(unused)] + #[derive(TypeInfo)] + enum E { + A(Box), + B { a: Box }, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub enum E { + A(std::boxed::Box,), + B { a: std::boxed::Box, }, + } + } + } + .to_string() + ) + } + + #[test] + fn range_fields() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: core::ops::Range, + b: core::ops::RangeInclusive, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct S { + pub a: ::core::ops::Range, + pub b: ::core::ops::RangeInclusive, + } + } + } + .to_string() + ) + } + + #[test] + fn generics() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Foo { + a: T, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct Bar { + b: Foo, + c: Foo, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Bar { + pub b: root::chameleon_core::generate_types::tests::Foo, + pub c: root::chameleon_core::generate_types::tests::Foo, + } + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Foo<_0> { + pub a: _0, + } + } + } + .to_string() + ) + } + + #[test] + fn generics_nested() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Foo { + a: T, + b: Option<(T, U)>, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct Bar { + b: Foo, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::>()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Bar<_0> { + pub b: root::chameleon_core::generate_types::tests::Foo<_0, u32>, + } + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Foo<_0, _1> { + pub a: _0, + pub b: Option<(_0, _1,)>, + } + } + } + .to_string() + ) + } + + #[cfg(feature = "bit-vec")] + #[test] + fn generate_bitvec() { + use bitvec::{ + order::{Lsb0, Msb0}, + vec::BitVec, + }; + + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + lsb: BitVec, + msb: BitVec, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct S { + pub lsb: root::bitvec::vec::BitVec, + pub msb: root::bitvec::vec::BitVec, + } + } + } + .to_string() + ) + } + + #[test] + fn generics_with_alias_adds_phantom_data_marker() { + trait Trait { + type Type; + } + + impl Trait for bool { + type Type = u32; + } + + type Foo = ::Type; + type Bar = (::Type, ::Type); + + #[allow(unused)] + #[derive(TypeInfo)] + struct NamedFields { + b: Foo, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct UnnamedFields(Bar); + + let mut registry = Registry::new(); + registry.register_type(&meta_type::>()); + registry.register_type(&meta_type::>()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct NamedFields<_0> { + pub b: u32, + pub __chameleon_unused_type_params: ::core::marker::PhantomData<_0>, + } + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct UnnamedFields<_0, _1> ( + pub (u32, u32,), + pub ::core::marker::PhantomData<(_0, _1)>, + ); + } + } + .to_string() + ) + } + + #[test] + fn modules() { + mod modules { + pub mod a { + #[allow(unused)] + #[derive(scale_info::TypeInfo)] + pub struct Foo {} + + pub mod b { + #[allow(unused)] + #[derive(scale_info::TypeInfo)] + pub struct Bar { + a: super::Foo, + } + } + } + + pub mod c { + #[allow(unused)] + #[derive(scale_info::TypeInfo)] + pub struct Foo { + a: super::a::b::Bar, + } + } + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root"); + let types = type_gen.generate_types_mod(); + let tests_mod = types.get_mod(MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + pub mod modules { + use super::root; + pub mod a { + use super::root; + + pub mod b { + use super::root; + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Bar { + pub a: root::chameleon_core::generate_types::tests::modules::a::Foo, + } + } + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Foo {} + } + + pub mod c { + use super::root; + + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct Foo { + pub a: root::chameleon_core::generate_types::tests::modules::a::b::Bar, + } + } + } + } + } + .to_string() + ) + } +} diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index 3ca3cc82b8..98f07d99c1 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -16,137 +16,23 @@ extern crate proc_macro; -mod call; -mod event; -mod module; -mod store; -mod utils; +mod generate_types; +mod generate_runtime; +use generate_types::TypeGenerator; use proc_macro::TokenStream; +use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::proc_macro_error; -use synstructure::{ - decl_derive, - Structure, -}; -/// Register type sizes for [EventsDecoder](struct.EventsDecoder.html) and set the `MODULE`. -/// -/// The `module` macro registers the type sizes of the associated types of a trait so that [EventsDecoder](struct.EventsDecoder.html) -/// can decode events of that type when received from Substrate. It also sets the `MODULE` constant -/// to the name of the trait (must match the name of the Substrate pallet) that enables the [Call](), [Event]() and [Store]() macros to work. -/// -/// If you do not want an associated type to be registered, likely because you never expect it as part of a response payload to be decoded, use `#[module(ignore)]` on the type. -/// -/// Example: -/// -/// ```ignore -/// #[module] -/// pub trait Herd: Husbandry { -/// type Hooves: HoofCounter; -/// type Wool: WoollyAnimal; -/// #[module(ignore)] -/// type Digestion: EnergyProducer + std::fmt::Debug; -/// } -/// ``` -/// -/// The above will produce the following code: -/// -/// ```ignore -/// pub trait Herd: Husbandry { -/// type Hooves: HoofCounter; -/// type Wool: WoollyAnimal; -/// #[module(ignore)] -/// type Digestion: EnergyProducer + std::fmt::Debug; -/// } -/// -/// const MODULE: &str = "Herd"; -/// -/// // `EventTypeRegistry` extension trait. -/// pub trait HerdEventTypeRegistry { -/// // Registers this modules types. -/// fn with_herd(&mut self); -/// } -/// -/// impl EventTypeRegistry for -/// substrate_subxt::EventTypeRegistry -/// { -/// fn with_herd(&mut self) { -/// self.register_type_size::("Hooves"); -/// self.register_type_size::("Wool"); -/// } -/// } -/// ``` -/// -/// The following type sizes are registered by default: `bool, u8, u32, AccountId, AccountIndex, -/// AuthorityId, AuthorityIndex, AuthorityWeight, BlockNumber, DispatchInfo, Hash, Kind, -/// MemberCount, PhantomData, PropIndex, ProposalIndex, ReferendumIndex, SessionIndex, VoteThreshold` -#[proc_macro_attribute] +#[proc_macro] #[proc_macro_error] -pub fn module(args: TokenStream, input: TokenStream) -> TokenStream { - module::module(args.into(), input.into()).into() -} - -decl_derive!( - [Call] => - /// Derive macro that implements [substrate_subxt::Call](../substrate_subxt/trait.Call.html) for your struct - /// and defines&implements the calls as an extension trait. - /// - /// Use the `Call` derive macro in tandem with the [#module](../substrate_subxt/attr.module.html) macro to extend - /// your struct to enable calls to substrate and to decode events. The struct maps to the corresponding Substrate runtime call, e.g.: - /// - /// ```ignore - /// decl_module! { - /// /* … */ - /// pub fn fun_stuff(origin, something: Vec) -> DispatchResult { /* … */ } - /// /* … */ - /// } - ///``` - /// - /// Implements [substrate_subxt::Call](../substrate_subxt/trait.Call.html) and adds an extension trait that - /// provides two methods named as your struct. - /// - /// Example: - /// ```rust,ignore - /// pub struct MyRuntime; - /// - /// impl System for MyRuntime { /* … */ } - /// impl Balances for MyRuntime { /* … */ } - /// - /// #[module] - /// pub trait MyTrait: System + Balances {} - /// - /// #[derive(Call)] - /// pub struct FunStuffCall { - /// /// Runtime marker. - /// pub _runtime: PhantomData, - /// /// The argument passed to the call.. - /// pub something: Vec, - /// } - /// ``` - /// - /// When building a [Client](../substrate_subxt/struct.Client.html) parameterised to `MyRuntime`, you have access to - /// two new methods: `fun_stuff()` and `fun_stuff_and_watch()` by way of the derived `FunStuffExt` - /// trait. The `_and_watch` variant makes the call and waits for the result. The fields of the - /// input struct become arguments to the calls (ignoring the marker field). - /// - /// Under the hood the implementation calls [submit()](../substrate_subxt/struct.Client.html#method.submit) and - /// [watch()](../substrate_subxt/struct.Client.html#method.watch) respectively. - /// - /// *N.B.* You must use the `#[derive(Call)]` macro with `#[module]` in the same module or you will get errors - /// about undefined method with a name starting with `with_`. +pub fn runtime_types(input: TokenStream) -> TokenStream { + let input = input.to_string(); + let input = input.trim_matches('"'); - #[proc_macro_error] call -); -fn call(s: Structure) -> TokenStream { - call::call(s).into() -} - -decl_derive!([Event] => #[proc_macro_error] event); -fn event(s: Structure) -> TokenStream { - event::event(s).into() -} + let root = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".into()); + let root_path = std::path::Path::new(&root); + let path = root_path.join(input); -decl_derive!([Store, attributes(store)] => #[proc_macro_error] store); -fn store(s: Structure) -> TokenStream { - store::store(s).into() + generate_runtime::generate_runtime_types("runtime", path).into() } diff --git a/proc-macro/src/module.rs b/proc-macro/src/module.rs deleted file mode 100644 index cc14d5b3b4..0000000000 --- a/proc-macro/src/module.rs +++ /dev/null @@ -1,271 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use crate::utils; -use heck::SnakeCase; -use proc_macro2::TokenStream; -use proc_macro_error::abort; -use quote::{ - format_ident, - quote, -}; -use syn::parse::{ - Parse, - ParseStream, -}; - -mod kw { - use syn::custom_keyword; - - custom_keyword!(ignore); -} - -#[derive(Debug)] -enum ModuleAttr { - Ignore(kw::ignore), -} - -impl Parse for ModuleAttr { - fn parse(input: ParseStream) -> syn::Result { - Ok(Self::Ignore(input.parse()?)) - } -} - -type ModuleAttrs = utils::Attrs; - -fn ignore(attrs: &[syn::Attribute]) -> bool { - for attr in attrs { - if let Some(ident) = attr.path.get_ident() { - if ident == "module" { - let attrs: ModuleAttrs = syn::parse2(attr.tokens.clone()) - .map_err(|err| abort!("{}", err)) - .unwrap(); - if !attrs.attrs.is_empty() { - return true - } - } - } - } - false -} - -fn event_type_registry_trait_name(module: &syn::Ident) -> syn::Ident { - format_ident!("{}EventTypeRegistry", module.to_string()) -} - -fn with_module_ident(module: &syn::Ident) -> syn::Ident { - format_ident!("with_{}", module.to_string().to_snake_case()) -} - -type EventAttr = utils::UniAttr; -type EventAliasAttr = utils::UniAttr>; - -/// Parses the event type definition macros within #[module] -/// -/// It supports two ways to define the associated event type: -/// -/// ```ignore -/// #[module] -/// trait Pallet: System { -/// #![event_type(SomeType)] -/// #![event_alias(TypeNameAlias = SomeType)] -/// #![event_alias(SomeOtherAlias = TypeWithAssociatedTypes)] -/// } -/// ``` -fn parse_event_type_attr(attr: &syn::Attribute) -> Option<(String, syn::Type)> { - let ident = utils::path_to_ident(&attr.path); - if ident == "event_type" { - let attrs: EventAttr = syn::parse2(attr.tokens.clone()) - .map_err(|err| abort!("{}", err)) - .unwrap(); - let ty = attrs.attr; - let ident_str = quote!(#ty).to_string(); - Some((ident_str, ty)) - } else if ident == "event_alias" { - let attrs: EventAliasAttr = syn::parse2(attr.tokens.clone()) - .map_err(|err| abort!("{}", err)) - .unwrap(); - let ty = attrs.attr.value; - let ident_str = attrs.attr.key.to_string(); - Some((ident_str, ty)) - } else { - None - } -} - -/// Attribute macro that registers the type sizes used by the module; also sets the `MODULE` constant. -pub fn module(_args: TokenStream, tokens: TokenStream) -> TokenStream { - let input: Result = syn::parse2(tokens.clone()); - let mut input = if let Ok(input) = input { - input - } else { - // handle #[module(ignore)] by just returning the tokens - return tokens - }; - - // Parse the inner attributes `event_type` and `event_alias` and remove them from the macro - // outputs. - let (other_attrs, event_types): (Vec<_>, Vec<_>) = input - .attrs - .iter() - .cloned() - .partition(|attr| parse_event_type_attr(attr).is_none()); - input.attrs = other_attrs; - - let subxt = utils::use_crate("substrate-subxt"); - let module = &input.ident; - let module_name = module.to_string(); - let module_events_type_registry = event_type_registry_trait_name(module); - let with_module = with_module_ident(module); - - let associated_types = input.items.iter().filter_map(|item| { - if let syn::TraitItem::Type(ty) = item { - if ignore(&ty.attrs) { - return None - } - let ident = &ty.ident; - let ident_str = ident.to_string(); - Some(quote! { - self.register_type_size::(#ident_str); - }) - } else { - None - } - }); - let types = event_types.iter().map(|attr| { - let (ident_str, ty) = parse_event_type_attr(&attr).unwrap(); - quote! { - self.register_type_size::<#ty>(#ident_str); - } - }); - - quote! { - #input - - const MODULE: &str = #module_name; - - /// `EventTypeRegistry` extension trait. - pub trait #module_events_type_registry { - /// Registers this modules types. - fn #with_module(&mut self); - } - - impl #module_events_type_registry for - #subxt::EventTypeRegistry - { - fn #with_module(&mut self) { - #(#associated_types)* - #(#types)* - } - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_balance_module() { - let attr = quote!(#[module]); - let input = quote! { - pub trait Balances: System { - type Balance: frame_support::Parameter - + sp_runtime::traits::Member - + sp_runtime::traits::AtLeast32Bit - + codec::Codec - + Default - + Copy - + sp_runtime::traits::MaybeSerialize - + std::fmt::Debug - + From<::BlockNumber>; - } - }; - let expected = quote! { - pub trait Balances: System { - type Balance: frame_support::Parameter - + sp_runtime::traits::Member - + sp_runtime::traits::AtLeast32Bit - + codec::Codec - + Default - + Copy - + sp_runtime::traits::MaybeSerialize - + std::fmt::Debug - + From< ::BlockNumber>; - } - - const MODULE: &str = "Balances"; - - /// `EventTypeRegistry` extension trait. - pub trait BalancesEventTypeRegistry { - /// Registers this modules types. - fn with_balances(&mut self); - } - - impl BalancesEventTypeRegistry for - substrate_subxt::EventTypeRegistry - { - fn with_balances(&mut self) { - self.register_type_size::("Balance"); - } - } - }; - - let result = module(attr, input); - utils::assert_proc_macro(result, expected); - } - - #[test] - fn test_herd() { - let attr = quote!(#[module]); - let input = quote! { - pub trait Herd: Husbandry { - type Hoves: u8; - type Wool: bool; - #[module(ignore)] - type Digestion: EnergyProducer + fmt::Debug; - } - }; - let expected = quote! { - pub trait Herd: Husbandry { - type Hoves: u8; - type Wool: bool; - #[module(ignore)] - type Digestion: EnergyProducer + fmt::Debug; - } - - const MODULE: &str = "Herd"; - - /// `EventTypeRegistry` extension trait. - pub trait HerdEventTypeRegistry { - /// Registers this modules types. - fn with_herd(&mut self); - } - - impl HerdEventTypeRegistry for - substrate_subxt::EventTypeRegistry - { - fn with_herd(&mut self) { - self.register_type_size::("Hoves"); - self.register_type_size::("Wool"); - } - } - }; - - let result = module(attr, input); - utils::assert_proc_macro(result, expected); - } -} diff --git a/proc-macro/src/store.rs b/proc-macro/src/store.rs deleted file mode 100644 index 2a4d0cffb3..0000000000 --- a/proc-macro/src/store.rs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use crate::utils; -use heck::{ - CamelCase, - SnakeCase, -}; -use proc_macro2::TokenStream; -use proc_macro_error::abort; -use quote::{ - format_ident, - quote, -}; -use syn::parse::{ - Parse, - ParseStream, -}; -use synstructure::Structure; - -mod kw { - use syn::custom_keyword; - - custom_keyword!(returns); -} - -#[derive(Debug)] -enum StoreAttr { - Returns(utils::Attr), -} - -impl Parse for StoreAttr { - fn parse(input: ParseStream) -> syn::Result { - Ok(Self::Returns(input.parse()?)) - } -} - -type StoreAttrs = utils::Attrs; - -fn parse_returns_attr(attr: &syn::Attribute) -> Option<(syn::Type, syn::Type, bool)> { - let attrs: StoreAttrs = syn::parse2(attr.tokens.clone()) - .map_err(|err| abort!("{}", err)) - .unwrap(); - attrs.attrs.into_iter().next().map(|attr| { - let StoreAttr::Returns(attr) = attr; - let ty = attr.value; - if let Some(inner) = utils::parse_option(&ty) { - (ty, inner, false) - } else { - (ty.clone(), ty, true) - } - }) -} - -pub fn store(s: Structure) -> TokenStream { - let subxt = utils::use_crate("substrate-subxt"); - let ident = &s.ast().ident; - let generics = &s.ast().generics; - let params = utils::type_params(generics); - let module = utils::module_name(generics); - let store_name = utils::ident_to_name(ident, "Store").to_camel_case(); - let store = format_ident!("{}", store_name.to_snake_case()); - let store_iter = format_ident!("{}_iter", store_name.to_snake_case()); - let store_trait = format_ident!("{}StoreExt", store_name); - let bindings = utils::bindings(&s); - let fields = utils::fields(&bindings); - let marker = utils::marker_field(&fields).unwrap_or_else(|| format_ident!("_")); - let filtered_fields = utils::filter_fields(&fields, &marker); - let args = utils::fields_to_args(&filtered_fields); - let build_struct = utils::build_struct(ident, &fields); - let (ret, store_ret, uses_default) = bindings - .iter() - .filter_map(|bi| bi.ast().attrs.iter().filter_map(parse_returns_attr).next()) - .next() - .unwrap_or_else(|| { - abort!(ident, "#[store(returns = ..)] needs to be specified.") - }); - let fetch = if uses_default { - quote!(fetch_or_default) - } else { - quote!(fetch) - }; - let store_ty = format_ident!( - "{}", - match filtered_fields.len() { - 0 => "plain", - 1 => "map", - 2 => "double_map", - _ => { - abort!( - ident, - "Expected 0-2 fields but found {}", - filtered_fields.len() - ); - } - } - ); - let keys = filtered_fields - .iter() - .map(|(field, _)| quote!(&self.#field)); - let key_iter = quote!(#subxt::KeyIter>); - - quote! { - impl#generics #subxt::Store for #ident<#(#params),*> { - const MODULE: &'static str = MODULE; - const FIELD: &'static str = #store_name; - type Returns = #store_ret; - - fn prefix( - metadata: &#subxt::Metadata, - ) -> Result<#subxt::sp_core::storage::StorageKey, #subxt::MetadataError> { - Ok(metadata - .module(Self::MODULE)? - .storage(Self::FIELD)? - .prefix()) - } - - fn key( - &self, - metadata: &#subxt::Metadata, - ) -> Result<#subxt::sp_core::storage::StorageKey, #subxt::MetadataError> { - Ok(metadata - .module(Self::MODULE)? - .storage(Self::FIELD)? - .#store_ty()? - .key(#(#keys,)*)) - } - } - - /// Store extension trait. - #[async_trait::async_trait] - pub trait #store_trait { - /// Retrieve the store element. - async fn #store<'a>( - &'a self, - #args - hash: Option, - ) -> Result<#ret, #subxt::Error>; - - /// Iterate over the store element. - async fn #store_iter<'a>( - &'a self, - hash: Option, - ) -> Result<#key_iter, #subxt::Error>; - } - - #[async_trait::async_trait] - impl #store_trait for #subxt::Client { - async fn #store<'a>( - &'a self, - #args - hash: Option, - ) -> Result<#ret, #subxt::Error> { - let #marker = core::marker::PhantomData::; - self.#fetch(&#build_struct, hash).await - } - - async fn #store_iter<'a>( - &'a self, - hash: Option, - ) -> Result<#key_iter, #subxt::Error> { - self.iter(hash).await - } - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_account_store() { - let input = quote! { - #[derive(Encode, Store)] - pub struct AccountStore<'a, T: Balances> { - #[store(returns = AccountData)] - account_id: &'a ::AccountId, - } - }; - let expected = quote! { - impl<'a, T: Balances> substrate_subxt::Store for AccountStore<'a, T> { - const MODULE: &'static str = MODULE; - const FIELD: &'static str = "Account"; - type Returns = AccountData; - - fn prefix( - metadata: &substrate_subxt::Metadata, - ) -> Result { - Ok(metadata - .module(Self::MODULE)? - .storage(Self::FIELD)? - .prefix()) - } - - fn key( - &self, - metadata: &substrate_subxt::Metadata, - ) -> Result { - Ok(metadata - .module(Self::MODULE)? - .storage(Self::FIELD)? - .map()? - .key(&self.account_id,)) - } - } - - /// Store extension trait. - #[async_trait::async_trait] - pub trait AccountStoreExt { - /// Retrieve the store element. - async fn account<'a>( - &'a self, - account_id: &'a ::AccountId, - hash: Option, - ) -> Result, substrate_subxt::Error>; - /// Iterate over the store element. - async fn account_iter<'a>( - &'a self, - hash: Option, - ) -> Result>, substrate_subxt::Error>; - } - - #[async_trait::async_trait] - impl AccountStoreExt for substrate_subxt::Client { - async fn account<'a>( - &'a self, - account_id: &'a ::AccountId, - hash: Option, - ) -> Result, substrate_subxt::Error> - { - let _ = core::marker::PhantomData::; - self.fetch_or_default(&AccountStore { account_id, }, hash).await - } - - async fn account_iter<'a>( - &'a self, - hash: Option, - ) -> Result>, substrate_subxt::Error> { - self.iter(hash).await - } - } - }; - let derive_input = syn::parse2(input).unwrap(); - let s = Structure::new(&derive_input); - let result = store(s); - utils::assert_proc_macro(result, expected); - } -} diff --git a/proc-macro/src/utils.rs b/proc-macro/src/utils.rs deleted file mode 100644 index ba644436a7..0000000000 --- a/proc-macro/src/utils.rs +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -use proc_macro2::{ - Span, - TokenStream, -}; -use quote::{ - format_ident, - quote, -}; -use syn::{ - parse::{ - Parse, - ParseStream, - }, - punctuated::Punctuated, -}; -use synstructure::{ - BindingInfo, - Structure, -}; - -pub fn use_crate(name: &str) -> syn::Ident { - opt_crate(name).unwrap_or_else(|| syn::Ident::new("crate", Span::call_site())) -} - -pub fn opt_crate(name: &str) -> Option { - proc_macro_crate::crate_name(name) - .ok() - .map(|krate| syn::Ident::new(&krate, Span::call_site())) -} - -pub fn bindings<'a>(s: &'a Structure) -> Vec<&'a BindingInfo<'a>> { - let mut bindings = vec![]; - for variant in s.variants() { - for binding in variant.bindings() { - bindings.push(binding); - } - } - bindings -} - -type Field = (syn::Ident, syn::Type); - -pub fn fields(bindings: &[&BindingInfo<'_>]) -> Vec { - bindings - .iter() - .enumerate() - .map(|(i, bi)| { - ( - bi.ast() - .ident - .clone() - .unwrap_or_else(|| format_ident!("key{}", i)), - bi.ast().ty.clone(), - ) - }) - .collect() -} - -pub fn marker_field(fields: &[Field]) -> Option { - fields - .iter() - .filter_map(|(field, ty)| { - if quote!(#ty).to_string() == quote!(PhantomData).to_string() { - Some(field) - } else { - None - } - }) - .next() - .cloned() -} - -pub fn filter_fields(fields: &[Field], field: &syn::Ident) -> Vec { - fields - .iter() - .filter_map(|(field2, ty)| { - if field2 != field { - Some((field2.clone(), ty.clone())) - } else { - None - } - }) - .collect() -} - -pub fn fields_to_args(fields: &[Field]) -> TokenStream { - let args = fields.iter().map(|(field, ty)| quote!(#field: #ty,)); - quote!(#(#args)*) -} - -pub fn build_struct(ident: &syn::Ident, fields: &[Field]) -> TokenStream { - let fields = fields.iter().map(|(field, _)| field); - quote!(#ident { #(#fields,)* }) -} - -pub fn ident_to_name(ident: &syn::Ident, ty: &str) -> String { - let name = ident.to_string(); - let name = name.trim_end_matches(ty); - if name.is_empty() { - ty.to_string() - } else { - name.to_string() - } -} - -pub fn module_name(generics: &syn::Generics) -> &syn::Path { - generics - .params - .iter() - .filter_map(|p| { - if let syn::GenericParam::Type(p) = p { - p.bounds - .iter() - .filter_map(|b| { - if let syn::TypeParamBound::Trait(t) = b { - Some(&t.path) - } else { - None - } - }) - .next() - } else { - None - } - }) - .next() - .unwrap() -} - -pub fn path_to_ident(path: &syn::Path) -> &syn::Ident { - &path.segments.iter().last().unwrap().ident -} - -pub fn type_params(generics: &syn::Generics) -> Vec { - generics - .params - .iter() - .filter_map(|g| { - match g { - syn::GenericParam::Type(p) => { - let ident = &p.ident; - Some(quote!(#ident)) - } - syn::GenericParam::Lifetime(p) => { - let lifetime = &p.lifetime; - Some(quote!(#lifetime)) - } - syn::GenericParam::Const(_) => None, - } - }) - .collect() -} - -pub fn parse_option(ty: &syn::Type) -> Option { - if let syn::Type::Path(ty_path) = ty { - if let Some(seg) = ty_path.path.segments.first() { - if &seg.ident == "Option" { - if let syn::PathArguments::AngleBracketed(args) = &seg.arguments { - if let Some(syn::GenericArgument::Type(ty)) = args.args.first() { - return Some(ty.clone()) - } - } - } - } - } - None -} - -#[derive(Debug)] -pub struct Attrs { - pub paren: syn::token::Paren, - pub attrs: Punctuated, -} - -impl Parse for Attrs { - fn parse(input: ParseStream) -> syn::Result { - let content; - let paren = syn::parenthesized!(content in input); - let attrs = content.parse_terminated(A::parse)?; - Ok(Self { paren, attrs }) - } -} - -#[derive(Debug)] -pub struct Attr { - pub key: K, - pub eq: syn::token::Eq, - pub value: V, -} - -impl Parse for Attr { - fn parse(input: ParseStream) -> syn::Result { - Ok(Self { - key: input.parse()?, - eq: input.parse()?, - value: input.parse()?, - }) - } -} - -#[derive(Debug)] -pub struct UniAttr { - pub paren: syn::token::Paren, - pub attr: A, -} - -impl Parse for UniAttr { - fn parse(input: ParseStream) -> syn::Result { - let content; - let paren = syn::parenthesized!(content in input); - let attr = content.parse()?; - Ok(Self { paren, attr }) - } -} - -#[cfg(test)] -pub(crate) fn assert_proc_macro( - result: proc_macro2::TokenStream, - expected: proc_macro2::TokenStream, -) { - let result = result.to_string(); - let expected = expected.to_string(); - pretty_assertions::assert_eq!(result, expected); -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_parse_option() { - let option_t: syn::Type = syn::parse2(quote!(Option)).unwrap(); - let t: syn::Type = syn::parse2(quote!(T)).unwrap(); - assert_eq!(parse_option(&option_t), Some(t.clone())); - assert_eq!(parse_option(&t), None); - } -} diff --git a/src/lib.rs b/src/lib.rs index 33f3526cca..a2c4c4ccd2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,7 +41,7 @@ #![allow(clippy::type_complexity)] #[macro_use] -extern crate substrate_subxt_proc_macro; +extern crate subxt_proc_macro; pub use sp_core; pub use sp_runtime; @@ -91,7 +91,6 @@ pub use crate::{ EventSubscription, FinalizedEventStorageSubscription, }, - substrate_subxt_proc_macro::*, }; use crate::{ rpc::{ From e917dac79548a1abf0c4381401ca5f63a7353c7f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 3 Sep 2021 10:38:47 +0100 Subject: [PATCH 011/216] WIP make transfer balance test pass --- proc-macro/Cargo.toml | 2 - proc-macro/src/generate_runtime.rs | 8 +- proc-macro/src/lib.rs | 4 +- src/lib.rs | 4 +- tests/Cargo.toml | 10 +- tests/node_runtime.scale | Bin 0 -> 297278 bytes tests/src/lib.rs | 239 ++++++++++++++++------------- tests/src/node_proc.rs | 5 +- 8 files changed, 148 insertions(+), 124 deletions(-) create mode 100644 tests/node_runtime.scale diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index 0a7f3c716c..9abf3e5b83 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -27,9 +27,7 @@ syn = "1.0.58" scale-info = "0.12.0" [dev-dependencies] -async-std = { version = "1.8.0", features = ["attributes"] } codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } -env_logger = "0.8.2" pretty_assertions = "0.6.1" substrate-subxt = { path = ".." } trybuild = "1.0.38" diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 077df690f1..113d99129a 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -20,13 +20,13 @@ use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, }; use heck::SnakeCase as _; -use proc_macro_error::{abort, abort_call_site}; +use proc_macro_error::abort_call_site; use quote::{format_ident, quote}; use scale_info::form::PortableForm; use scale_info::prelude::string::ToString; use std::{ fs, - io::{self, Read}, + io::Read, path, }; @@ -61,7 +61,7 @@ impl RuntimeGenerator { } pub fn generate_runtime(&self, mod_name: &str) -> TokenStream2 { - let type_gen = TypeGenerator::new(&self.metadata.types, "__runtime_types"); + let type_gen = TypeGenerator::new(&self.metadata.types, "__types"); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); let modules = self.metadata.pallets.iter().map(|pallet| { @@ -83,7 +83,7 @@ impl RuntimeGenerator { let calls = if !calls.is_empty() { quote! { - mod calls { + pub mod calls { use super::#types_mod_ident; #( #calls )* } diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index 98f07d99c1..39a1906e17 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -33,6 +33,8 @@ pub fn runtime_types(input: TokenStream) -> TokenStream { let root = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".into()); let root_path = std::path::Path::new(&root); let path = root_path.join(input); + let mod_name = path.file_stem().unwrap_or_else(|| + proc_macro_error::abort_call_site!("Expected a file path")); - generate_runtime::generate_runtime_types("runtime", path).into() + generate_runtime::generate_runtime_types(&mod_name.to_string_lossy(), &path).into() } diff --git a/src/lib.rs b/src/lib.rs index a2c4c4ccd2..ff00f6200a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,7 @@ mod rpc; mod subscription; pub use crate::{ + client::{Client, ClientBuilder}, error::{ Error, ModuleError, @@ -97,8 +98,9 @@ use crate::{ ChainBlock, Rpc, }, + sp_runtime::traits::{Verify, Extrinsic, Member, Hash, Header, AtLeast32Bit, MaybeSerializeDeserialize}, }; -use crate::sp_runtime::traits::{Verify, Extrinsic, Member, Hash, Header, AtLeast32Bit, MaybeSerializeDeserialize}; +pub use subxt_proc_macro::runtime_types; /// Parameter trait compied from substrate::frame_support pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} diff --git a/tests/Cargo.toml b/tests/Cargo.toml index a2b2e9a64d..71ac56dc51 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -1,15 +1,21 @@ [package] -name = "tests" +name = "subxt-tests" version = "0.1.0" edition = "2018" [dependencies] subxt = { package = "substrate-subxt", path = ".." } +codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } + +sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/" } +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } +sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/" } + assert_matches = "1.5.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } env_logger = "0.8.3" +log = "0.4.14" tempdir = "0.3.7" wabt = "0.10.0" which = "4.0.2" -sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } \ No newline at end of file diff --git a/tests/node_runtime.scale b/tests/node_runtime.scale new file mode 100644 index 0000000000000000000000000000000000000000..36651ca7c312a6532014c35eea1c0e0f761e100b GIT binary patch literal 297278 zcmeFa4QOT8buYg6)frpk$cfyJ-(P-DdGGi|e!0q%ZZ!5d8Bb(0nvtB*%Y4WqjblI0 zpnG-ik#sv(_bT^eW>ive!G#o3a3KK~Tu32-1QJLg0T)tmA1Szyf(v<&f(t3QkU|P6 zq>zFO|KD$|z4tli-Ybp9_PBket(=k0*=K*Oz4rQEYwsl8%7^bCHDi;V-Suj#olI2Q zd%NA%%tE!=>NUH|wZ|ScCNhzYU+A6uO#IlR*Z8LyiH$L%_QRc$ppy`7}p8MpD}Wb-VC z$K&00>q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)zfGuqKK``a^LGR>ZCihJNg*5+QU>;GHmYPS%GE?~Bv7KZEMiquni+ z;tVuBg(LK$?h6gi>JA1~aLbZ+YA-SflSG*+dx2G>5TfL&xq5U=fLQCDOjx#Jg(d;< zu&L!K(lay~nEaxW=V9@vkjsu?yUtQ6V%TIK6ce7Dm@q`$fwsTZF{DCu3&*QsapnH5 z#~S5OGBqTn5g8kSrG!v)010eJsk0o3vV%Til|{iKNoTTJZI7+;N3g@8Z5Mt|QYFp< z%R#E{4KkhkY?sc5(t|Kne>Gd6r-Wg0rsPf{PgomECcRfwHb1NJ@H!_40L&-(9s&?YrXzlzp3$4O zme1?mcWwM`3i=nLlPlQLsFNh}%ER=9;V(Ytl=&AL`F!4*umxB4{$K*vbtQ*?QNESf z-@dfJYNA2MLS*{95bug{=WyPEtYkHEJa`WS&i^;OImgSBxccnD7GKD2>%JtRPdaju zYeFZrb++gTJopM;q?oyu=vx6WH&z)vTWK+L@Z@7!fWIbD$ob`QOrtMO(ZLv4+N~ zil9TZPg^UWT3Pp0ZJmW`5^B3UNsd(V3N^k`#>xELkd~(NM50b@82#P6l9mH#DIT>! zF=AtvUn@tf@G$MTHeBgOGsqRU#5P?YNrP?0E=~InkuD^+rD{3WiUbqb-3CG^j(5DH?F441Y>d@iIQ%7e`pPae##N->LtHVG4_2I_Iej9=+ zo7uZPk@x$; + type Header = sp_runtime::generic::Header; + type Extra = subxt::extrinsic::DefaultExtra; + type Signature = sp_runtime::MultiSignature; + type Extrinsic = sp_runtime::OpaqueExtrinsic; +} /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; -pub(crate) type TestRuntime = crate::DefaultNodeRuntime; - pub(crate) async fn test_node_process_with( key: AccountKeyring, ) -> TestNodeProcess { - 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/substrate-subxt/tree/master#integration-testing") - } - - let proc = TestNodeProcess::::build(SUBSTRATE_NODE_PATH) + 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/substrate-subxt/tree/master#integration-testing") + } + SUBSTRATE_NODE_PATH.to_string() + }); + + let proc = TestNodeProcess::::build(path.as_str()) .with_authority(key) .scan_for_open_ports() .spawn::() @@ -47,43 +70,39 @@ pub(crate) async fn test_node_process() -> TestNodeProcess { test_node_process_with(AccountKeyring::Alice).await } -#[async_std::test] -async fn test_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 - .insert_key( - "aura".to_string(), - "//Alice".to_string(), - public.clone().into(), - ) - .await - .unwrap(); - assert!(client - .has_key(public.clone().into(), "aura".to_string()) - .await - .unwrap()); -} +// #[async_std::test] +// async fn test_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 +// .insert_key( +// "aura".to_string(), +// "//Alice".to_string(), +// public.clone().into(), +// ) +// .await +// .unwrap(); +// assert!(client +// .has_key(public.clone().into(), "aura".to_string()) +// .await +// .unwrap()); +// } #[async_std::test] async fn test_tx_transfer_balance() { + use crate::node_runtime::balances::calls::Transfer; + let mut signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); let node_process = test_node_process().await; let client = node_process.client(); - let nonce = client - .account(&AccountKeyring::Alice.to_account_id(), None) - .await - .unwrap() - .nonce; - signer.set_nonce(nonce); client .submit( - balances::TransferCall { - to: &dest, - amount: 10_000, + Transfer { + dest: &dest, + value: 10_000, }, &signer, ) @@ -94,9 +113,9 @@ async fn test_tx_transfer_balance() { signer.increment_nonce(); client .submit( - balances::TransferCall { - to: &dest, - amount: 10_000, + Transfer { + dest: &dest, + value: 10_000, }, &signer, ) @@ -104,72 +123,72 @@ async fn test_tx_transfer_balance() { .unwrap(); } -#[async_std::test] -async fn test_getting_hash() { - let node_process = test_node_process().await; - node_process.client().block_hash(None).await.unwrap(); -} - -#[async_std::test] -async fn test_getting_block() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.block_hash(None).await.unwrap(); - client.block(block_hash).await.unwrap(); -} - -#[async_std::test] -async fn test_getting_read_proof() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.block_hash(None).await.unwrap(); - client - .read_proof( - vec![ - StorageKey(well_known_keys::HEAP_PAGES.to_vec()), - StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), - ], - block_hash, - ) - .await - .unwrap(); -} - -#[async_std::test] -async fn test_chain_subscribe_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.subscribe_blocks().await.unwrap(); - blocks.next().await.unwrap(); -} - -#[async_std::test] -async fn test_chain_subscribe_finalized_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); - blocks.next().await.unwrap(); -} - -#[async_std::test] -async fn test_fetch_keys() { - let node_process = test_node_process().await; - let client = node_process.client(); - let keys = client - .fetch_keys::>(4, None, None) - .await - .unwrap(); - assert_eq!(keys.len(), 4) -} - -#[async_std::test] -async fn test_iter() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut iter = client.iter::>(None).await.unwrap(); - let mut i = 0; - while let Some(_) = iter.next().await.unwrap() { - i += 1; - } - assert_eq!(i, 13); -} +// #[async_std::test] +// async fn test_getting_hash() { +// let node_process = test_node_process().await; +// node_process.client().block_hash(None).await.unwrap(); +// } +// +// #[async_std::test] +// async fn test_getting_block() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let block_hash = client.block_hash(None).await.unwrap(); +// client.block(block_hash).await.unwrap(); +// } +// +// #[async_std::test] +// async fn test_getting_read_proof() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let block_hash = client.block_hash(None).await.unwrap(); +// client +// .read_proof( +// vec![ +// StorageKey(well_known_keys::HEAP_PAGES.to_vec()), +// StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), +// ], +// block_hash, +// ) +// .await +// .unwrap(); +// } +// +// #[async_std::test] +// async fn test_chain_subscribe_blocks() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let mut blocks = client.subscribe_blocks().await.unwrap(); +// blocks.next().await.unwrap(); +// } +// +// #[async_std::test] +// async fn test_chain_subscribe_finalized_blocks() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); +// blocks.next().await.unwrap(); +// } +// +// #[async_std::test] +// async fn test_fetch_keys() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let keys = client +// .fetch_keys::>(4, None, None) +// .await +// .unwrap(); +// assert_eq!(keys.len(), 4) +// } +// +// #[async_std::test] +// async fn test_iter() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let mut iter = client.iter::>(None).await.unwrap(); +// let mut i = 0; +// while let Some(_) = iter.next().await.unwrap() { +// i += 1; +// } +// assert_eq!(i, 13); +// } diff --git a/tests/src/node_proc.rs b/tests/src/node_proc.rs index 45b0fb0589..1d44313cae 100644 --- a/tests/src/node_proc.rs +++ b/tests/src/node_proc.rs @@ -162,15 +162,12 @@ impl TestNodeProcessBuilder { attempts, MAX_ATTEMPTS ); - let result = ClientBuilder::::new() + let result = ClientBuilder::new() .set_url(ws_url.clone()) .build() .await; match result { Ok(client) => break Ok(client), - Err(crate::Error::MissingTypeSizes(e)) => { - break Err(crate::Error::MissingTypeSizes(e)) - } Err(err) => { if attempts < MAX_ATTEMPTS { attempts += 1; From 2ef017d95d7d7ba935111fa163883dca7c28c729 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 3 Sep 2021 12:41:40 +0100 Subject: [PATCH 012/216] Change to subxt attribute macro --- proc-macro/Cargo.toml | 1 + proc-macro/src/generate_runtime.rs | 10 +++++----- proc-macro/src/lib.rs | 26 ++++++++++++++++++-------- src/lib.rs | 2 +- tests/src/lib.rs | 8 ++++++-- 5 files changed, 31 insertions(+), 16 deletions(-) diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index 9abf3e5b83..b7ef920b39 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -17,6 +17,7 @@ proc-macro = true [dependencies] async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +darling = "0.13.0" frame-metadata = { git = "https://github.com/paritytech/frame-metadata/" } heck = "0.3.2" proc-macro2 = "1.0.24" diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 113d99129a..263918e48c 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -30,7 +30,7 @@ use std::{ path, }; -pub fn generate_runtime_types

(mod_name: &str, path: P) -> TokenStream2 +pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 where P: AsRef, { @@ -45,7 +45,7 @@ where .unwrap_or_else(|e| abort_call_site!("Failed to decode metadata: {}", e)); let generator = RuntimeGenerator::new(metadata); - generator.generate_runtime(mod_name) + generator.generate_runtime(item_mod) } pub struct RuntimeGenerator { @@ -60,7 +60,7 @@ impl RuntimeGenerator { } } - pub fn generate_runtime(&self, mod_name: &str) -> TokenStream2 { + pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { let type_gen = TypeGenerator::new(&self.metadata.types, "__types"); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); @@ -121,10 +121,10 @@ impl RuntimeGenerator { } }; - let mod_name = format_ident!("{}", mod_name); + let mod_ident = item_mod.ident; quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] - pub mod #mod_name { + pub mod #mod_ident { #outer_event #( #modules )* #types_mod diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index 39a1906e17..37f3bc4ba9 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -19,22 +19,32 @@ extern crate proc_macro; mod generate_types; mod generate_runtime; +use darling::FromMeta; use generate_types::TypeGenerator; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::proc_macro_error; +use syn::parse_macro_input; -#[proc_macro] +#[derive(Debug, FromMeta)] +struct RuntimeMetadataArgs { + runtime_metadata_path: String, +} + +#[proc_macro_attribute] #[proc_macro_error] -pub fn runtime_types(input: TokenStream) -> TokenStream { - let input = input.to_string(); - let input = input.trim_matches('"'); +pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { + let attr_args = parse_macro_input!(args as syn::AttributeArgs); + let item_mod = parse_macro_input!(input as syn::ItemMod); + + let args = match RuntimeMetadataArgs::from_list(&attr_args) { + Ok(v) => v, + Err(e) => { return TokenStream::from(e.write_errors()); } + }; let root = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".into()); let root_path = std::path::Path::new(&root); - let path = root_path.join(input); - let mod_name = path.file_stem().unwrap_or_else(|| - proc_macro_error::abort_call_site!("Expected a file path")); + let path = root_path.join(args.runtime_metadata_path); - generate_runtime::generate_runtime_types(&mod_name.to_string_lossy(), &path).into() + generate_runtime::generate_runtime_types(item_mod, &path).into() } diff --git a/src/lib.rs b/src/lib.rs index ff00f6200a..3370357603 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,7 +100,7 @@ use crate::{ }, sp_runtime::traits::{Verify, Extrinsic, Member, Hash, Header, AtLeast32Bit, MaybeSerializeDeserialize}, }; -pub use subxt_proc_macro::runtime_types; +pub use subxt_proc_macro::subxt; /// Parameter trait compied from substrate::frame_support pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 6e23736a0c..e47d96484d 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -23,10 +23,14 @@ use sp_runtime::traits::BlakeTwo256; use subxt::{ PairSigner, Runtime, - runtime_types, + subxt, }; -runtime_types!("node_runtime.scale"); +#[subxt(runtime_metadata_path = "node_runtime.scale")] +mod node_runtime { + #[subxt(map_type = "sp_runtime::multiaddress::MultiAddress")] + use sp_runtime::MultiAddress; +} #[derive(Clone, Debug, Eq, PartialEq)] struct TestRuntime; From f3005cb909357d804123fb9bae5e34c2487565e4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 3 Sep 2021 17:54:02 +0100 Subject: [PATCH 013/216] WIP provide user defined type substitutes --- proc-macro/src/generate_runtime.rs | 54 ++++++++++++++++++++++++++++-- proc-macro/src/generate_types.rs | 19 +++++++++-- tests/src/lib.rs | 2 +- 3 files changed, 69 insertions(+), 6 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 263918e48c..0c456ee873 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -16,19 +16,22 @@ use codec::Decode; use crate::{TokenStream2, TypeGenerator}; +use darling::FromMeta; use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, }; use heck::SnakeCase as _; -use proc_macro_error::abort_call_site; +use proc_macro_error::{abort, abort_call_site}; use quote::{format_ident, quote}; use scale_info::form::PortableForm; use scale_info::prelude::string::ToString; use std::{ + collections::HashMap, fs, io::Read, path, }; +use syn::spanned::Spanned as _; pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 where @@ -48,6 +51,20 @@ where generator.generate_runtime(item_mod) } +#[derive(Debug, FromMeta)] +#[darling(rename_all = "snake_case")] +enum Subxt { + SubstituteType(String), +} + +impl Subxt { + fn substitute_type(&self) -> String { + match self { + Self::SubstituteType(path) => path.clone() + } + } +} + pub struct RuntimeGenerator { metadata: RuntimeMetadataV14, } @@ -61,7 +78,8 @@ impl RuntimeGenerator { } pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { - let type_gen = TypeGenerator::new(&self.metadata.types, "__types"); + let type_substitutes = Self::parse_type_substitutes(&item_mod); + let type_gen = TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); let modules = self.metadata.pallets.iter().map(|pallet| { @@ -121,6 +139,7 @@ impl RuntimeGenerator { } }; + // todo: [AJ] keep all other code items from decorated mod? let mod_ident = item_mod.ident; quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] @@ -132,6 +151,37 @@ impl RuntimeGenerator { } } + fn parse_type_substitutes(item_mod: &syn::ItemMod) -> HashMap { + if let Some(ref content) = item_mod.content { + content.1.iter() + .filter_map(|item| { + if let syn::Item::Use(use_) = item { + let substitute_attrs = + use_.attrs.iter().map(|attr| { + let meta = attr.parse_meta().unwrap_or_else(|e| + abort!(attr.span(), "Error parsing attribute: {}", e)); + let substitute_type_args = Subxt::from_meta(&meta).unwrap(); // todo + substitute_type_args + }).collect::>(); + if substitute_attrs.len() > 1 { + abort!(use_.attrs[0].span(), "Duplicate `substitute_type` attributes") + } + substitute_attrs.iter().next().map(|attr| { + let substitute_type = attr.substitute_type(); + let use_path = &use_.tree; + let use_type_path = syn::parse_quote!( #use_path ); + (substitute_type.to_string(), use_type_path) + }) + } else { + None + } + }) + .collect() + } else { + HashMap::new() + } + } + fn generate_call_structs( &self, type_gen: &TypeGenerator, diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index f9d193caa9..9d4397a402 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -16,22 +16,24 @@ use proc_macro2::{Ident, Span, TokenStream as TokenStream2, TokenStream}; use quote::{format_ident, quote, ToTokens}; -use scale_info::{form::PortableForm, Field, PortableRegistry, Type, TypeDef, TypeDefPrimitive}; -use std::collections::{BTreeMap, HashSet}; +use scale_info::{form::PortableForm, Field, PortableRegistry, Type, TypeDef, TypeDefPrimitive, Path}; +use std::collections::{BTreeMap, HashMap, HashSet}; #[derive(Debug)] pub struct TypeGenerator<'a> { root_mod_ident: Ident, type_registry: &'a PortableRegistry, + type_substitutes: HashMap, } impl<'a> TypeGenerator<'a> { /// Construct a new [`TypeGenerator`]. - pub fn new(type_registry: &'a PortableRegistry, root_mod: &'static str) -> Self { + pub fn new(type_registry: &'a PortableRegistry, root_mod: &'static str, type_substitutes: HashMap) -> Self { let root_mod_ident = Ident::new(root_mod, Span::call_site()); Self { root_mod_ident, type_registry, + type_substitutes, } } @@ -64,6 +66,11 @@ impl<'a> TypeGenerator<'a> { root_mod_ident: &Ident, module: &mut Module<'a>, ) { + let joined_path = path.join("::"); + if self.type_substitutes.contains_key(&joined_path) { + return + } + let segment = path.first().expect("path has at least one segment"); let mod_ident = Ident::new(segment, Span::call_site()); @@ -100,6 +107,12 @@ impl<'a> TypeGenerator<'a> { }; let mut ty = resolve_type(id); + + let joined_path = ty.path().segments().join("::"); + if let Some(substitute_type_path) = self.type_substitutes.get(&joined_path) { + return substitute_type_path.clone() + } + if ty.path().ident() == Some("Cow".to_string()) { ty = resolve_type( ty.type_params()[0] diff --git a/tests/src/lib.rs b/tests/src/lib.rs index e47d96484d..d9913b6fee 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -28,7 +28,7 @@ use subxt::{ #[subxt(runtime_metadata_path = "node_runtime.scale")] mod node_runtime { - #[subxt(map_type = "sp_runtime::multiaddress::MultiAddress")] + #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] use sp_runtime::MultiAddress; } From e4f137411b846bfcc89c40416f3c7ee1dbde0c65 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 6 Sep 2021 10:55:31 +0100 Subject: [PATCH 014/216] User defined type substitutes compile --- proc-macro/src/generate_runtime.rs | 8 ++-- proc-macro/src/generate_types.rs | 65 +++++++++++++++++++++++++----- proc-macro/src/lib.rs | 2 +- tests/src/lib.rs | 6 ++- 4 files changed, 65 insertions(+), 16 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 0c456ee873..9df631eb20 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -15,7 +15,9 @@ // along with substrate-subxt. If not, see . use codec::Decode; -use crate::{TokenStream2, TypeGenerator}; +use crate::{ + TokenStream2, TypeGenerator, TypePath, +}; use darling::FromMeta; use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, @@ -189,9 +191,9 @@ impl RuntimeGenerator { ) -> Vec { let ty = call.ty; let name = type_gen.resolve_type_path(ty.id(), &[]); - use crate::generate_types::TypePath; match name { - TypePath::Parameter(_) => panic!("Call type should be a Type"), + TypePath::Parameter(_) => panic!("Call type should be a Parameter"), + TypePath::Substitute(_) => panic!("Call type should not be a Substitute"), TypePath::Type(ref ty) => { let ty = ty.ty(); diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index 9d4397a402..3673508c28 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -108,11 +108,6 @@ impl<'a> TypeGenerator<'a> { let mut ty = resolve_type(id); - let joined_path = ty.path().segments().join("::"); - if let Some(substitute_type_path) = self.type_substitutes.get(&joined_path) { - return substitute_type_path.clone() - } - if ty.path().ident() == Some("Cow".to_string()) { ty = resolve_type( ty.type_params()[0] @@ -141,11 +136,20 @@ impl<'a> TypeGenerator<'a> { .map(|tp| self.resolve_type_path(*tp, parent_type_params)) .collect::>(); - TypePath::Type(TypePathType { - ty, - params, - root_mod_ident: self.root_mod_ident.clone(), - }) + let joined_path = ty.path().segments().join("::"); + if let Some(substitute_type_path) = self.type_substitutes.get(&joined_path) { + TypePath::Substitute(TypePathSubstitute { + path: substitute_type_path.clone(), + params, + }) + // todo: add tests for this type substitution + } else { + TypePath::Type(TypePathType { + ty, + params, + root_mod_ident: self.root_mod_ident.clone(), + }) + } } } @@ -444,6 +448,7 @@ impl<'a> ModuleType<'a> { pub enum TypePath { Parameter(TypeParameter), Type(TypePathType), + Substitute(TypePathSubstitute), } impl quote::ToTokens for TypePath { @@ -458,6 +463,7 @@ impl TypePath { match self { TypePath::Parameter(ty_param) => syn::Type::Path(syn::parse_quote! { #ty_param }), TypePath::Type(ty) => ty.to_syn_type(), + TypePath::Substitute(sub) => sub.to_syn_type(), } } @@ -476,6 +482,7 @@ impl TypePath { acc.insert(type_parameter.clone()); } Self::Type(type_path) => type_path.parent_type_params(acc), + Self::Substitute(sub) => sub.parent_type_params(acc), } } } @@ -610,6 +617,44 @@ impl quote::ToTokens for TypeParameter { } } +#[derive(Debug)] +pub struct TypePathSubstitute { + path: syn::TypePath, + params: Vec, +} + +impl quote::ToTokens for TypePathSubstitute { + fn to_tokens(&self, tokens: &mut TokenStream) { + if self.params.is_empty() { + self.path.to_tokens(tokens) + } else { + let substitute_path = &self.path; + let params = &self.params; + tokens.extend(quote! { + #substitute_path< #( #params ),* > + }) + } + } +} + +impl TypePathSubstitute { + fn parent_type_params(&self, acc: &mut HashSet) { + for p in &self.params { + p.parent_type_params(acc); + } + } + + fn to_syn_type(&self) -> syn::Type { + if self.params.is_empty() { + syn::Type::Path(self.path.clone()) + } else { + let substitute_path = &self.path; + let params = &self.params; + syn::parse_quote! ( #substitute_path< #( #params ),* > ) + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index 37f3bc4ba9..1f8d91012c 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -20,7 +20,7 @@ mod generate_types; mod generate_runtime; use darling::FromMeta; -use generate_types::TypeGenerator; +use generate_types::{TypeGenerator, TypePath}; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::proc_macro_error; diff --git a/tests/src/lib.rs b/tests/src/lib.rs index d9913b6fee..1c70cf7cb9 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -30,6 +30,8 @@ use subxt::{ mod node_runtime { #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] use sp_runtime::MultiAddress; + #[subxt(substitute_type = "sp_core::crypto::AccountId32")] + use sp_core::crypto::AccountId32; } #[derive(Clone, Debug, Eq, PartialEq)] @@ -105,7 +107,7 @@ async fn test_tx_transfer_balance() { client .submit( Transfer { - dest: &dest, + dest, value: 10_000, }, &signer, @@ -118,7 +120,7 @@ async fn test_tx_transfer_balance() { client .submit( Transfer { - dest: &dest, + dest, value: 10_000, }, &signer, From b98b7aaa09f402eaf0c275394a66f5fc82e0242c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 6 Sep 2021 16:47:12 +0100 Subject: [PATCH 015/216] WIP submitting transactions --- proc-macro/src/generate_runtime.rs | 15 +++-- src/client.rs | 97 +++++++++++++++--------------- src/error.rs | 5 +- src/lib.rs | 12 +++- src/metadata.rs | 64 ++++++++++++++++---- src/rpc.rs | 4 +- src/subscription.rs | 4 +- 7 files changed, 129 insertions(+), 72 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 9df631eb20..bb01f99f7c 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -19,9 +19,7 @@ use crate::{ TokenStream2, TypeGenerator, TypePath, }; use darling::FromMeta; -use frame_metadata::{ - v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, -}; +use frame_metadata::{v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, PalletMetadata}; use heck::SnakeCase as _; use proc_macro_error::{abort, abort_call_site}; use quote::{format_ident, quote}; @@ -88,7 +86,7 @@ impl RuntimeGenerator { let mod_name = format_ident!("{}", pallet.name.to_string().to_snake_case()); let mut calls = Vec::new(); for call in &pallet.calls { - let call_structs = self.generate_call_structs(&type_gen, call); + let call_structs = self.generate_call_structs(&type_gen, pallet, call); calls.extend(call_structs) } @@ -187,6 +185,7 @@ impl RuntimeGenerator { fn generate_call_structs( &self, type_gen: &TypeGenerator, + pallet: &PalletMetadata, call: &PalletCallMetadata, ) -> Vec { let ty = call.ty; @@ -213,11 +212,19 @@ impl RuntimeGenerator { }) }); + let pallet_name = &pallet.name; + let function_name = var.name().to_string(); + quote! { #[derive(Debug, ::codec::Encode, ::codec::Decode)] pub struct #name { #( #args ),* } + + impl ::subxt::Call for #name { + const PALLET: &'static str = stringify!(#pallet_name); + const FUNCTION: &'static str = stringify!(#function_name); + } } }) .collect::>() diff --git a/src/client.rs b/src/client.rs index d8056abffe..f9c67584c5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -39,6 +39,7 @@ use crate::{Error, events::EventsDecoder, extrinsic::{ self, PairSigner, Signer, + SignedExtra, UncheckedExtrinsic, }, rpc::{ ChainBlock, @@ -50,7 +51,7 @@ use crate::{Error, events::EventsDecoder, extrinsic::{ EventStorageSubscription, EventSubscription, FinalizedEventStorageSubscription, -}, BlockNumber, Metadata, ReadProof, Runtime}; +}, BlockNumber, Metadata, ReadProof, Runtime, Call, Encoded}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -310,31 +311,40 @@ impl Client { // } /// Creates a signed extrinsic. - // pub async fn create_signed + Send + Sync>( - // &self, - // call: C, - // signer: &(dyn Signer + Send + Sync), - // ) -> Result, Error> - // where - // <>::Extra as SignedExtension>::AdditionalSigned: - // Send + Sync, - // { - // let account_nonce = if let Some(nonce) = signer.nonce() { - // nonce - // } else { - // self.account(signer.account_id(), None).await?.nonce - // }; - // let call = self.encode(call)?; - // let signed = extrinsic::create_signed( - // &self.runtime_version, - // self.genesis_hash, - // account_nonce, - // call, - // signer, - // ) - // .await?; - // Ok(signed) - // } + pub async fn create_signed( + &self, + call: C, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { + let account_nonce = if let Some(nonce) = signer.nonce() { + nonce + } else { + todo!("fetch nonce if not supplied") + // self.account(signer.account_id(), None).await?.nonce + }; + let call = self.encode(call)?; + let signed = extrinsic::create_signed( + &self.runtime_version, + self.genesis_hash, + account_nonce, + call, + signer, + ) + .await?; + Ok(signed) + } + + /// Encodes a call. + pub fn encode(&self, call: C) -> Result { + Ok(self + .metadata() + .pallet(C::PALLET) + .and_then(|pallet| pallet.encode_call(call))?) + } /// Returns the events decoder. pub fn events_decoder(&self) -> &EventsDecoder { @@ -360,18 +370,18 @@ impl Client { } /// Submits a transaction to the chain. - // pub async fn submit + Send + Sync>( - // &self, - // call: C, - // signer: &(dyn Signer + Send + Sync), - // ) -> Result - // where - // <>::Extra as SignedExtension>::AdditionalSigned: - // Send + Sync, - // { - // let extrinsic = self.create_signed(call, signer).await?; - // self.submit_extrinsic(extrinsic).await - // } + pub async fn submit( + &self, + call: C, + signer: &(dyn Signer + Send + Sync), + ) -> Result + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { + let extrinsic = self.create_signed(call, signer).await?; + self.submit_extrinsic(extrinsic).await + } /// Submits transaction to the chain and watch for events. // pub async fn watch + Send + Sync>( @@ -422,14 +432,3 @@ impl Client { self.rpc.has_key(public_key, key_type).await } } - -/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of -/// the transaction payload -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct Encoded(pub Vec); - -impl codec::Encode for Encoded { - fn encode(&self) -> Vec { - self.0.to_owned() - } -} diff --git a/src/error.rs b/src/error.rs index 4ab4cb8e22..23c063cb22 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,7 +22,7 @@ use sp_runtime::{ DispatchError, }; use thiserror::Error; -use crate::metadata::InvalidMetadataError; +use crate::metadata::{InvalidMetadataError, MetadataError}; /// Error enum. #[derive(Debug, Error)] @@ -48,6 +48,9 @@ pub enum Error { /// Invalid metadata error #[error("Invalid Metadata: {0}")] InvalidMetadata(#[from] InvalidMetadataError), + /// Invalid metadata error + #[error("Metadata: {0}")] + Metadata(#[from] MetadataError), /// Runtime error. #[error("Runtime error: {0}")] Runtime(#[from] RuntimeError), diff --git a/src/lib.rs b/src/lib.rs index 3370357603..031c3012e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -167,10 +167,18 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; } +/// Call trait. +pub trait Call: Encode { + /// Module name. + const PALLET: &'static str; + /// Function name. + const FUNCTION: &'static str; +} + /// Event trait. -pub trait Event: Decode { +pub trait Event: Decode { /// Module name. - const MODULE: &'static str; + const PALLET: &'static str; /// Event name. const EVENT: &'static str; } diff --git a/src/metadata.rs b/src/metadata.rs index 7e88a04440..4780dbad9f 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -30,14 +30,14 @@ use codec::{ use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed, StorageEntryModifier, StorageEntryType, StorageHasher, META_RESERVED, RuntimeMetadataLastVersion, PalletConstantMetadata}; use sp_core::storage::StorageKey; -use crate::Encoded; +use crate::{Encoded,Call}; /// Metadata error. #[derive(Debug, thiserror::Error)] pub enum MetadataError { /// Module is not in metadata. #[error("Module {0} not found")] - ModuleNotFound(String), + PalletNotFound(String), /// Module is not in metadata. #[error("Module index {0} not found")] ModuleIndexNotFound(u8), @@ -71,19 +71,45 @@ pub enum MetadataError { #[derive(Clone, Debug)] pub struct Metadata { metadata: RuntimeMetadataLastVersion, + pallets: HashMap, } impl Metadata { - /// Returns `ModuleMetadata`. - pub fn pallet(&self, name: S) -> Result<&PalletMetadata, MetadataError> - where - S: ToString, - { - todo!() - // let name = name.to_string(); - // self.modules - // .get(&name) - // .ok_or(MetadataError::ModuleNotFound(name)) + /// Create a new indexed `Metadata` instance from the imported runtime metadata. + pub fn new(metadata: RuntimeMetadataLastVersion) -> Result { + let pallets = metadata.pallets.iter() + .map(|pallet| { + let calls = pallet.calls + .as_ref() + .map_or(Ok(HashMap::new()), |call| { + let ty = metadata.types.resolve(call.ty.id()) + .ok_or(InvalidMetadataError::MissingCallType)?; + if let scale_info::TypeDef::Variant(var) = ty.type_def() { + let calls = var.variants().iter().map(|v| (v.name().clone(), v.index())).collect(); + Ok(calls) + } else { + Err(InvalidMetadataError::CallTypeNotVariant) + } + })?; + + let pallet_metadata = PalletMetadata { + index: pallet.index, + name: pallet.name.to_string(), + calls, + storage: Default::default(), + constants: Default::default() + }; + + Ok((pallet.name.to_string(), pallet_metadata)) + }) + .collect::>()?; + Ok(Self { metadata, pallets }) + } + + /// Returns `PalletMetadata`. + pub fn pallet(&self, name: &'static str) -> Result<&PalletMetadata, MetadataError> { + self.pallets.get(name) + .ok_or(MetadataError::PalletNotFound(name.to_string())) } } @@ -91,11 +117,21 @@ impl Metadata { pub struct PalletMetadata { index: u8, name: String, + calls: HashMap, storage: HashMap, constants: HashMap, } impl PalletMetadata { + pub fn encode_call(&self, call: C) -> Result + where C: Call + { + let fn_index = self.calls.get(C::FUNCTION).ok_or(MetadataError::CallNotFound(C::FUNCTION))?; + let mut bytes = vec![self.index, *fn_index]; + bytes.extend(call.encode()); + Ok(Encoded(bytes)) + } + pub fn storage(&self, key: &'static str) -> Result<&StorageMetadata, MetadataError> { self.storage .get(key) @@ -258,6 +294,10 @@ pub enum InvalidMetadataError { InvalidPrefix, #[error("Invalid version")] InvalidVersion, + #[error("Call type missing from type registry")] + MissingCallType, + #[error("Call type was not a variant/enum type")] + CallTypeNotVariant, } impl TryFrom for Metadata { diff --git a/src/rpc.rs b/src/rpc.rs index abc5e45b36..61c2407384 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -685,8 +685,8 @@ impl ExtrinsicSuccess { /// Find the Event for the given module/variant, attempting to decode the event data. /// Returns `None` if the Event is not found. /// Returns `Err` if the data fails to decode into the supplied type. - pub fn find_event>(&self) -> Result, CodecError> { - if let Some(event) = self.find_event_raw(E::MODULE, E::EVENT) { + pub fn find_event(&self) -> Result, CodecError> { + if let Some(event) = self.find_event_raw(E::PALLET, E::EVENT) { Ok(Some(E::decode(&mut &event.data[..])?)) } else { Ok(None) diff --git a/src/subscription.rs b/src/subscription.rs index 41c2b0e643..51e7495065 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -82,8 +82,8 @@ impl<'a, T: Runtime> EventSubscription<'a, T> { } /// Filters events by type. - pub fn filter_event>(&mut self) { - self.event = Some((E::MODULE, E::EVENT)); + pub fn filter_event(&mut self) { + self.event = Some((E::PALLET, E::EVENT)); } /// Gets the next event. From e20f1233d7c37d5f9ded5366b9e6377df97a163c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 6 Sep 2021 17:01:54 +0100 Subject: [PATCH 016/216] WIP transfer balance test --- proc-macro/src/generate_runtime.rs | 2 +- src/metadata.rs | 155 +++++++---------------------- tests/src/lib.rs | 6 +- 3 files changed, 39 insertions(+), 124 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index bb01f99f7c..36861c3d30 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -208,7 +208,7 @@ impl RuntimeGenerator { field.name().map(|name| { let name = format_ident!("{}", name); let ty = type_gen.resolve_type_path(field.ty().id(), &[]); - quote! { #name: #ty } + quote! { pub #name: #ty } }) }); diff --git a/src/metadata.rs b/src/metadata.rs index 4780dbad9f..2ac1dfa174 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -75,37 +75,6 @@ pub struct Metadata { } impl Metadata { - /// Create a new indexed `Metadata` instance from the imported runtime metadata. - pub fn new(metadata: RuntimeMetadataLastVersion) -> Result { - let pallets = metadata.pallets.iter() - .map(|pallet| { - let calls = pallet.calls - .as_ref() - .map_or(Ok(HashMap::new()), |call| { - let ty = metadata.types.resolve(call.ty.id()) - .ok_or(InvalidMetadataError::MissingCallType)?; - if let scale_info::TypeDef::Variant(var) = ty.type_def() { - let calls = var.variants().iter().map(|v| (v.name().clone(), v.index())).collect(); - Ok(calls) - } else { - Err(InvalidMetadataError::CallTypeNotVariant) - } - })?; - - let pallet_metadata = PalletMetadata { - index: pallet.index, - name: pallet.name.to_string(), - calls, - storage: Default::default(), - constants: Default::default() - }; - - Ok((pallet.name.to_string(), pallet_metadata)) - }) - .collect::>()?; - Ok(Self { metadata, pallets }) - } - /// Returns `PalletMetadata`. pub fn pallet(&self, name: &'static str) -> Result<&PalletMetadata, MetadataError> { self.pallets.get(name) @@ -304,95 +273,39 @@ impl TryFrom for Metadata { type Error = InvalidMetadataError; fn try_from(metadata: RuntimeMetadataPrefixed) -> Result { - todo!() - // if metadata.0 != META_RESERVED { - // return Err(ConversionError::InvalidPrefix.into()) - // } - // let meta = match metadata.1 { - // RuntimeMetadata::V14(meta) => meta, - // _ => return Err(ConversionError::InvalidVersion.into()), - // }; - // let mut modules = HashMap::new(); - // let mut modules_with_calls = HashMap::new(); - // let mut modules_with_events = HashMap::new(); - // let mut modules_with_errors = HashMap::new(); - // for module in convert(meta.modules)?.into_iter() { - // let module_name = convert(module.name.clone())?; - // - // let mut constant_map = HashMap::new(); - // for constant in convert(module.constants)?.into_iter() { - // let constant_meta = convert_constant(constant)?; - // constant_map.insert(constant_meta.name.clone(), constant_meta); - // } - // - // let mut storage_map = HashMap::new(); - // if let Some(storage) = module.storage { - // let storage = convert(storage)?; - // let module_prefix = convert(storage.prefix)?; - // for entry in convert(storage.entries)?.into_iter() { - // let storage_prefix = convert(entry.name.clone())?; - // let entry = convert_entry( - // module_prefix.clone(), - // storage_prefix.clone(), - // entry, - // )?; - // storage_map.insert(storage_prefix, entry); - // } - // } - // modules.insert( - // module_name.clone(), - // ModuleMetadata { - // index: module.index, - // name: module_name.clone(), - // storage: storage_map, - // constants: constant_map, - // }, - // ); - // - // if let Some(calls) = module.calls { - // let mut call_map = HashMap::new(); - // for (index, call) in convert(calls)?.into_iter().enumerate() { - // let name = convert(call.name)?; - // call_map.insert(name, index as u8); - // } - // modules_with_calls.insert( - // module_name.clone(), - // ModuleWithCalls { - // index: module.index, - // calls: call_map, - // }, - // ); - // } - // if let Some(events) = module.event { - // let mut event_map = HashMap::new(); - // for (index, event) in convert(events)?.into_iter().enumerate() { - // event_map.insert(index as u8, convert_event(event)?); - // } - // modules_with_events.insert( - // module_name.clone(), - // ModuleWithEvents { - // index: module.index, - // name: module_name.clone(), - // events: event_map, - // }, - // ); - // } - // let mut error_map = HashMap::new(); - // for (index, error) in convert(module.errors)?.into_iter().enumerate() { - // error_map.insert(index as u8, convert_error(error)?); - // } - // modules_with_errors.insert( - // module_name.clone(), - // ModuleWithErrors { - // index: module.index, - // name: module_name.clone(), - // errors: error_map, - // }, - // ); - // } - // Ok(Metadata { - // pallets, - // - // }) + if metadata.0 != META_RESERVED { + return Err(InvalidMetadataError::InvalidPrefix.into()) + } + let metadata = match metadata.1 { + RuntimeMetadata::V14(meta) => meta, + _ => return Err(InvalidMetadataError::InvalidVersion.into()), + }; + let pallets = metadata.pallets.iter() + .map(|pallet| { + let calls = pallet.calls + .as_ref() + .map_or(Ok(HashMap::new()), |call| { + let ty = metadata.types.resolve(call.ty.id()) + .ok_or(InvalidMetadataError::MissingCallType)?; + if let scale_info::TypeDef::Variant(var) = ty.type_def() { + let calls = var.variants().iter().map(|v| (v.name().clone(), v.index())).collect(); + Ok(calls) + } else { + Err(InvalidMetadataError::CallTypeNotVariant) + } + })?; + + let pallet_metadata = PalletMetadata { + index: pallet.index, + name: pallet.name.to_string(), + calls, + storage: Default::default(), + constants: Default::default() + }; + + Ok((pallet.name.to_string(), pallet_metadata)) + }) + .collect::>()?; + Ok(Self { metadata, pallets }) } } diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 1c70cf7cb9..144ef43b82 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -25,6 +25,7 @@ use subxt::{ Runtime, subxt, }; +use sp_runtime::{AccountId32, MultiAddress}; #[subxt(runtime_metadata_path = "node_runtime.scale")] mod node_runtime { @@ -100,14 +101,15 @@ async fn test_tx_transfer_balance() { use crate::node_runtime::balances::calls::Transfer; let mut signer = PairSigner::new(AccountKeyring::Alice.pair()); - let dest = AccountKeyring::Bob.to_account_id().into(); + signer.set_nonce(0); // todo: auto nonce handling in client. + let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); let node_process = test_node_process().await; let client = node_process.client(); client .submit( Transfer { - dest, + dest: dest.clone(), // todo: [AJ] should we make custom types borrowed to avoid clones? value: 10_000, }, &signer, From 2cf09c11a24be18d8db8c1eb7e98d3f2b5ea7d60 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 6 Sep 2021 17:06:14 +0100 Subject: [PATCH 017/216] Fix macro --- proc-macro/src/generate_runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 36861c3d30..832fc7e42d 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -222,8 +222,8 @@ impl RuntimeGenerator { } impl ::subxt::Call for #name { - const PALLET: &'static str = stringify!(#pallet_name); - const FUNCTION: &'static str = stringify!(#function_name); + const PALLET: &'static str = #pallet_name; + const FUNCTION: &'static str = #function_name; } } }) From 56cb2a6b8d6a888ede98e3f21375c1831c41c277 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 6 Sep 2021 17:20:11 +0100 Subject: [PATCH 018/216] Cargo fmt --- proc-macro/src/generate_runtime.rs | 76 ++++++++++---- proc-macro/src/generate_types.rs | 160 +++++++++++++++++++---------- proc-macro/src/lib.rs | 11 +- src/client.rs | 77 ++++++++------ src/error.rs | 9 +- src/events.rs | 6 +- src/extrinsic/extra.rs | 8 +- src/extrinsic/mod.rs | 2 +- src/lib.rs | 22 +++- src/metadata.rs | 63 ++++++++---- src/rpc.rs | 11 +- src/subscription.rs | 4 +- tests/src/lib.rs | 13 ++- tests/src/node_proc.rs | 15 ++- 14 files changed, 311 insertions(+), 166 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 832fc7e42d..337e79739a 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -14,17 +14,33 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use codec::Decode; use crate::{ - TokenStream2, TypeGenerator, TypePath, + TokenStream2, + TypeGenerator, + TypePath, }; +use codec::Decode; use darling::FromMeta; -use frame_metadata::{v14::RuntimeMetadataV14, PalletCallMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, PalletMetadata}; +use frame_metadata::{ + v14::RuntimeMetadataV14, + PalletCallMetadata, + PalletMetadata, + RuntimeMetadata, + RuntimeMetadataPrefixed, +}; use heck::SnakeCase as _; -use proc_macro_error::{abort, abort_call_site}; -use quote::{format_ident, quote}; -use scale_info::form::PortableForm; -use scale_info::prelude::string::ToString; +use proc_macro_error::{ + abort, + abort_call_site, +}; +use quote::{ + format_ident, + quote, +}; +use scale_info::{ + form::PortableForm, + prelude::string::ToString, +}; use std::{ collections::HashMap, fs, @@ -37,8 +53,9 @@ pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream where P: AsRef, { - let mut file = fs::File::open(&path) - .unwrap_or_else(|e| abort_call_site!("Failed to open {}: {}", path.as_ref().to_string_lossy(), e)); + let mut file = fs::File::open(&path).unwrap_or_else(|e| { + abort_call_site!("Failed to open {}: {}", path.as_ref().to_string_lossy(), e) + }); let mut bytes = Vec::new(); file.read_to_end(&mut bytes) @@ -60,7 +77,7 @@ enum Subxt { impl Subxt { fn substitute_type(&self) -> String { match self { - Self::SubstituteType(path) => path.clone() + Self::SubstituteType(path) => path.clone(), } } } @@ -79,7 +96,8 @@ impl RuntimeGenerator { pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { let type_substitutes = Self::parse_type_substitutes(&item_mod); - let type_gen = TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); + let type_gen = + TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); let modules = self.metadata.pallets.iter().map(|pallet| { @@ -153,18 +171,28 @@ impl RuntimeGenerator { fn parse_type_substitutes(item_mod: &syn::ItemMod) -> HashMap { if let Some(ref content) = item_mod.content { - content.1.iter() + content + .1 + .iter() .filter_map(|item| { if let syn::Item::Use(use_) = item { - let substitute_attrs = - use_.attrs.iter().map(|attr| { - let meta = attr.parse_meta().unwrap_or_else(|e| - abort!(attr.span(), "Error parsing attribute: {}", e)); - let substitute_type_args = Subxt::from_meta(&meta).unwrap(); // todo + let substitute_attrs = use_ + .attrs + .iter() + .map(|attr| { + let meta = attr.parse_meta().unwrap_or_else(|e| { + abort!(attr.span(), "Error parsing attribute: {}", e) + }); + let substitute_type_args = + Subxt::from_meta(&meta).unwrap(); // todo substitute_type_args - }).collect::>(); + }) + .collect::>(); if substitute_attrs.len() > 1 { - abort!(use_.attrs[0].span(), "Duplicate `substitute_type` attributes") + abort!( + use_.attrs[0].span(), + "Duplicate `substitute_type` attributes" + ) } substitute_attrs.iter().next().map(|attr| { let substitute_type = attr.substitute_type(); @@ -203,11 +231,15 @@ impl RuntimeGenerator { .iter() .map(|var| { use heck::CamelCase; - let name = format_ident!("{}", var.name().to_string().to_camel_case()); + let name = format_ident!( + "{}", + var.name().to_string().to_camel_case() + ); let args = var.fields().iter().filter_map(|field| { field.name().map(|name| { let name = format_ident!("{}", name); - let ty = type_gen.resolve_type_path(field.ty().id(), &[]); + let ty = + type_gen.resolve_type_path(field.ty().id(), &[]); quote! { pub #name: #ty } }) }); @@ -234,4 +266,4 @@ impl RuntimeGenerator { } } } -} \ No newline at end of file +} diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index 3673508c28..ffaec284c9 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -14,10 +14,31 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use proc_macro2::{Ident, Span, TokenStream as TokenStream2, TokenStream}; -use quote::{format_ident, quote, ToTokens}; -use scale_info::{form::PortableForm, Field, PortableRegistry, Type, TypeDef, TypeDefPrimitive, Path}; -use std::collections::{BTreeMap, HashMap, HashSet}; +use proc_macro2::{ + Ident, + Span, + TokenStream as TokenStream2, + TokenStream, +}; +use quote::{ + format_ident, + quote, + ToTokens, +}; +use scale_info::{ + form::PortableForm, + Field, + Path, + PortableRegistry, + Type, + TypeDef, + TypeDefPrimitive, +}; +use std::collections::{ + BTreeMap, + HashMap, + HashSet, +}; #[derive(Debug)] pub struct TypeGenerator<'a> { @@ -28,7 +49,11 @@ pub struct TypeGenerator<'a> { impl<'a> TypeGenerator<'a> { /// Construct a new [`TypeGenerator`]. - pub fn new(type_registry: &'a PortableRegistry, root_mod: &'static str, type_substitutes: HashMap) -> Self { + pub fn new( + type_registry: &'a PortableRegistry, + root_mod: &'static str, + type_substitutes: HashMap, + ) -> Self { let root_mod_ident = Ident::new(root_mod, Span::call_site()); Self { root_mod_ident, @@ -39,12 +64,13 @@ impl<'a> TypeGenerator<'a> { /// Generate a module containing all types defined in the supplied type registry. pub fn generate_types_mod(&'a self) -> Module<'a> { - let mut root_mod = Module::new(self.root_mod_ident.clone(), self.root_mod_ident.clone()); + let mut root_mod = + Module::new(self.root_mod_ident.clone(), self.root_mod_ident.clone()); for (id, ty) in self.type_registry.types().iter().enumerate() { if ty.ty().path().namespace().is_empty() { // prelude types e.g. Option/Result have no namespace, so we don't generate them - continue; + continue } self.insert_type( ty.ty().clone(), @@ -91,12 +117,16 @@ impl<'a> TypeGenerator<'a> { /// # Panics /// /// If no type with the given id found in the type registry. - pub fn resolve_type_path(&self, id: u32, parent_type_params: &[TypeParameter]) -> TypePath { + pub fn resolve_type_path( + &self, + id: u32, + parent_type_params: &[TypeParameter], + ) -> TypePath { if let Some(parent_type_param) = parent_type_params .iter() .find(|tp| tp.concrete_type_id == id) { - return TypePath::Parameter(parent_type_param.clone()); + return TypePath::Parameter(parent_type_param.clone()) } let resolve_type = |id| { @@ -122,13 +152,16 @@ impl<'a> TypeGenerator<'a> { TypeDef::Sequence(seq) => vec![seq.type_param().id()], TypeDef::Tuple(tuple) => tuple.fields().iter().map(|f| f.id()).collect(), TypeDef::Compact(compact) => vec![compact.type_param().id()], - TypeDef::BitSequence(seq) => vec![seq.bit_order_type().id(), seq.bit_store_type().id()], + TypeDef::BitSequence(seq) => { + vec![seq.bit_order_type().id(), seq.bit_store_type().id()] + } TypeDef::Range(range) => vec![range.index_type().id()], - _ => ty - .type_params() - .iter() - .filter_map(|f| f.ty().map(|f| f.id())) - .collect(), + _ => { + ty.type_params() + .iter() + .filter_map(|f| f.ty().map(|f| f.id())) + .collect() + } }; let params = params_type_ids @@ -220,15 +253,17 @@ impl<'a> quote::ToTokens for ModuleType<'a> { .type_params() .iter() .enumerate() - .filter_map(|(i, tp)| match tp.ty() { - Some(ty) => { - let tp_name = format_ident!("_{}", i); - Some(TypeParameter { - concrete_type_id: ty.id(), - name: tp_name, - }) + .filter_map(|(i, tp)| { + match tp.ty() { + Some(ty) => { + let tp_name = format_ident!("_{}", i); + Some(TypeParameter { + concrete_type_id: ty.id(), + name: tp_name, + }) + } + None => None, } - None => None, }) .collect::>(); @@ -246,7 +281,8 @@ impl<'a> quote::ToTokens for ModuleType<'a> { match self.ty.type_def() { TypeDef::Composite(composite) => { let type_name = type_name.expect("structs should have a name"); - let (fields, _) = self.composite_fields(composite.fields(), &type_params, true); + let (fields, _) = + self.composite_fields(composite.fields(), &type_params, true); let ty_toks = quote! { #[derive(Debug, ::codec::Encode, ::codec::Decode)] pub struct #type_name #fields @@ -343,8 +379,10 @@ impl<'a> ModuleType<'a> { let fields = fields .iter() .map(|field| { - let name = - format_ident!("{}", field.name().expect("named field without a name")); + let name = format_ident!( + "{}", + field.name().expect("named field without a name") + ); let ty = self .type_gen .resolve_type_path(field.ty().id(), type_params); @@ -354,22 +392,25 @@ impl<'a> ModuleType<'a> { let mut fields_tokens = fields .iter() - .map(|(name, ty, ty_name)| match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! { pub #name: #ty } - } else { + .map(|(name, ty, ty_name)| { + match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! { pub #name: #ty } + } else { + quote! { #name: #ty } + } + } + None => { quote! { #name: #ty } } } - None => { - quote! { #name: #ty } - } }) .collect::>(); - let unused_params = unused_type_params(type_params, fields.iter().map(|(_, ty, _)| ty)); + let unused_params = + unused_type_params(type_params, fields.iter().map(|(_, ty, _)| ty)); if is_struct && !unused_params.is_empty() { let phantom = Self::phantom_data(&unused_params); @@ -396,18 +437,20 @@ impl<'a> ModuleType<'a> { .collect::>(); let mut fields_tokens = type_paths .iter() - .map(|(ty, ty_name)| match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! { pub #ty } - } else { + .map(|(ty, ty_name)| { + match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! { pub #ty } + } else { + quote! { #ty } + } + } + None => { quote! { #ty } } } - None => { - quote! { #ty } - } }) .collect::>(); @@ -461,7 +504,9 @@ impl quote::ToTokens for TypePath { impl TypePath { pub(crate) fn to_syn_type(&self) -> syn::Type { match self { - TypePath::Parameter(ty_param) => syn::Type::Path(syn::parse_quote! { #ty_param }), + TypePath::Parameter(ty_param) => { + syn::Type::Path(syn::parse_quote! { #ty_param }) + } TypePath::Type(ty) => ty.to_syn_type(), TypePath::Substitute(sub) => sub.to_syn_type(), } @@ -512,7 +557,8 @@ impl TypePathType { .collect::>(); if !self.ty.path().namespace().is_empty() { // types without a namespace are assumed to be globally in scope e.g. `Option`s - ty_path.insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); + ty_path + .insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); } let params = &self.params; @@ -570,8 +616,10 @@ impl TypePathType { let bit_order_type = &self.params[0]; let bit_store_type = &self.params[1]; - let mut type_path: syn::punctuated::Punctuated = - syn::parse_quote! { bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; + let mut type_path: syn::punctuated::Punctuated< + syn::PathSegment, + syn::Token![::], + > = syn::parse_quote! { bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; type_path.insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); let type_path = syn::parse_quote! { #type_path }; @@ -659,9 +707,14 @@ impl TypePathSubstitute { mod tests { use super::*; use pretty_assertions::assert_eq; - use scale_info::{meta_type, Registry, TypeInfo}; + use scale_info::{ + meta_type, + Registry, + TypeInfo, + }; - const MOD_PATH: &'static [&'static str] = &["chameleon_core", "generate_types", "tests"]; + const MOD_PATH: &'static [&'static str] = + &["chameleon_core", "generate_types", "tests"]; #[test] fn generate_struct_with_primitives() { @@ -1074,7 +1127,10 @@ mod tests { #[test] fn generate_bitvec() { use bitvec::{ - order::{Lsb0, Msb0}, + order::{ + Lsb0, + Msb0, + }, vec::BitVec, }; diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index 1f8d91012c..de881e2fcd 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -16,11 +16,14 @@ extern crate proc_macro; -mod generate_types; mod generate_runtime; +mod generate_types; use darling::FromMeta; -use generate_types::{TypeGenerator, TypePath}; +use generate_types::{ + TypeGenerator, + TypePath, +}; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::proc_macro_error; @@ -39,7 +42,9 @@ pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { let args = match RuntimeMetadataArgs::from_list(&attr_args) { Ok(v) => v, - Err(e) => { return TokenStream::from(e.write_errors()); } + Err(e) => { + return TokenStream::from(e.write_errors()) + } }; let root = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".into()); diff --git a/src/client.rs b/src/client.rs index f9c67584c5..5f336315bd 100644 --- a/src/client.rs +++ b/src/client.rs @@ -14,9 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use codec::{ - Decode, -}; +use codec::Decode; use futures::future; use jsonrpsee_http_client::HttpClientBuilder; use jsonrpsee_types::Subscription; @@ -35,23 +33,35 @@ use std::{ sync::Arc, }; -use crate::{Error, events::EventsDecoder, extrinsic::{ - self, - PairSigner, - Signer, - SignedExtra, - UncheckedExtrinsic, -}, rpc::{ - ChainBlock, - Rpc, - RpcClient, - SystemProperties, - ExtrinsicSuccess, -}, subscription::{ - EventStorageSubscription, - EventSubscription, - FinalizedEventStorageSubscription, -}, BlockNumber, Metadata, ReadProof, Runtime, Call, Encoded}; +use crate::{ + events::EventsDecoder, + extrinsic::{ + self, + PairSigner, + SignedExtra, + Signer, + UncheckedExtrinsic, + }, + rpc::{ + ChainBlock, + ExtrinsicSuccess, + Rpc, + RpcClient, + SystemProperties, + }, + subscription::{ + EventStorageSubscription, + EventSubscription, + FinalizedEventStorageSubscription, + }, + BlockNumber, + Call, + Encoded, + Error, + Metadata, + ReadProof, + Runtime, +}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -126,11 +136,10 @@ impl ClientBuilder { rpc.runtime_version(None), rpc.system_properties(), ) - .await; + .await; let metadata = metadata?; - let events_decoder = - EventsDecoder::new(metadata.clone()); + let events_decoder = EventsDecoder::new(metadata.clone()); Ok(Client { rpc, @@ -218,8 +227,8 @@ impl Client { /// Get a header pub async fn header(&self, hash: Option) -> Result, Error> - where - H: Into + 'static, + where + H: Into + 'static, { let header = self.rpc.header(hash.map(|h| h.into())).await?; Ok(header) @@ -242,8 +251,8 @@ impl Client { /// Get a block pub async fn block(&self, hash: Option) -> Result>, Error> - where - H: Into + 'static, + where + H: Into + 'static, { let block = self.rpc.block(hash.map(|h| h.into())).await?; Ok(block) @@ -255,8 +264,8 @@ impl Client { keys: Vec, hash: Option, ) -> Result, Error> - where - H: Into + 'static, + where + H: Into + 'static, { let proof = self.rpc.read_proof(keys, hash.map(|h| h.into())).await?; Ok(proof) @@ -316,8 +325,8 @@ impl Client { call: C, signer: &(dyn Signer + Send + Sync), ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: + where + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { let account_nonce = if let Some(nonce) = signer.nonce() { @@ -334,7 +343,7 @@ impl Client { call, signer, ) - .await?; + .await?; Ok(signed) } @@ -375,8 +384,8 @@ impl Client { call: C, signer: &(dyn Signer + Send + Sync), ) -> Result - where - <>::Extra as SignedExtension>::AdditionalSigned: + where + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { let extrinsic = self.create_signed(call, signer).await?; diff --git a/src/error.rs b/src/error.rs index 23c063cb22..b19ca1e635 100644 --- a/src/error.rs +++ b/src/error.rs @@ -14,7 +14,13 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::Metadata; +use crate::{ + metadata::{ + InvalidMetadataError, + MetadataError, + }, + Metadata, +}; use jsonrpsee_types::Error as RequestError; use sp_core::crypto::SecretStringError; use sp_runtime::{ @@ -22,7 +28,6 @@ use sp_runtime::{ DispatchError, }; use thiserror::Error; -use crate::metadata::{InvalidMetadataError, MetadataError}; /// Error enum. #[derive(Debug, Error)] diff --git a/src/events.rs b/src/events.rs index eeb893a4df..a66089fb19 100644 --- a/src/events.rs +++ b/src/events.rs @@ -43,11 +43,11 @@ use std::{ }; use crate::{ - Runtime, Error, - RuntimeError, Metadata, Phase, + Runtime, + RuntimeError, }; /// Raw bytes for an Event @@ -110,7 +110,7 @@ pub struct EventsDecoder { impl EventsDecoder where - T: Runtime + T: Runtime, { /// Creates a new `EventsDecoder`. pub fn new(metadata: Metadata) -> Self { diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index 928b6e4530..67a5c1edf2 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -244,9 +244,7 @@ pub struct DefaultExtra { genesis_hash: T::Hash, } -impl SignedExtra - for DefaultExtra -{ +impl SignedExtra for DefaultExtra { type Extra = ( CheckSpecVersion, CheckTxVersion, @@ -284,9 +282,7 @@ impl SignedExtra } } -impl SignedExtension - for DefaultExtra -{ +impl SignedExtension for DefaultExtra { const IDENTIFIER: &'static str = "DefaultExtra"; type AccountId = T::AccountId; type Call = (); diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index c5e6f4f8ff..f358fc8179 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -42,9 +42,9 @@ use sp_runtime::traits::SignedExtension; use sp_version::RuntimeVersion; use crate::{ - Runtime, Encoded, Error, + Runtime, }; /// UncheckedExtrinsic type. diff --git a/src/lib.rs b/src/lib.rs index 031c3012e2..4b79f99f85 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -46,7 +46,12 @@ extern crate subxt_proc_macro; pub use sp_core; pub use sp_runtime; -use codec::{Codec, Decode, EncodeLike, Encode}; +use codec::{ + Codec, + Decode, + Encode, + EncodeLike, +}; use serde::de::DeserializeOwned; use std::{ fmt::Debug, @@ -63,7 +68,10 @@ mod rpc; mod subscription; pub use crate::{ - client::{Client, ClientBuilder}, + client::{ + Client, + ClientBuilder, + }, error::{ Error, ModuleError, @@ -98,7 +106,15 @@ use crate::{ ChainBlock, Rpc, }, - sp_runtime::traits::{Verify, Extrinsic, Member, Hash, Header, AtLeast32Bit, MaybeSerializeDeserialize}, + sp_runtime::traits::{ + AtLeast32Bit, + Extrinsic, + Hash, + Header, + MaybeSerializeDeserialize, + Member, + Verify, + }, }; pub use subxt_proc_macro::subxt; diff --git a/src/metadata.rs b/src/metadata.rs index 2ac1dfa174..56bbba48b5 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -27,10 +27,22 @@ use codec::{ Error as CodecError, }; -use frame_metadata::{RuntimeMetadata, RuntimeMetadataPrefixed, StorageEntryModifier, StorageEntryType, StorageHasher, META_RESERVED, RuntimeMetadataLastVersion, PalletConstantMetadata}; +use frame_metadata::{ + PalletConstantMetadata, + RuntimeMetadata, + RuntimeMetadataLastVersion, + RuntimeMetadataPrefixed, + StorageEntryModifier, + StorageEntryType, + StorageHasher, + META_RESERVED, +}; use sp_core::storage::StorageKey; -use crate::{Encoded,Call}; +use crate::{ + Call, + Encoded, +}; /// Metadata error. #[derive(Debug, thiserror::Error)] @@ -77,8 +89,9 @@ pub struct Metadata { impl Metadata { /// Returns `PalletMetadata`. pub fn pallet(&self, name: &'static str) -> Result<&PalletMetadata, MetadataError> { - self.pallets.get(name) - .ok_or(MetadataError::PalletNotFound(name.to_string())) + self.pallets + .get(name) + .ok_or(MetadataError::PalletNotFound(name.to_string())) } } @@ -93,9 +106,13 @@ pub struct PalletMetadata { impl PalletMetadata { pub fn encode_call(&self, call: C) -> Result - where C: Call + where + C: Call, { - let fn_index = self.calls.get(C::FUNCTION).ok_or(MetadataError::CallNotFound(C::FUNCTION))?; + let fn_index = self + .calls + .get(C::FUNCTION) + .ok_or(MetadataError::CallNotFound(C::FUNCTION))?; let mut bytes = vec![self.index, *fn_index]; bytes.extend(call.encode()); Ok(Encoded(bytes)) @@ -280,27 +297,33 @@ impl TryFrom for Metadata { RuntimeMetadata::V14(meta) => meta, _ => return Err(InvalidMetadataError::InvalidVersion.into()), }; - let pallets = metadata.pallets.iter() + let pallets = metadata + .pallets + .iter() .map(|pallet| { - let calls = pallet.calls - .as_ref() - .map_or(Ok(HashMap::new()), |call| { - let ty = metadata.types.resolve(call.ty.id()) - .ok_or(InvalidMetadataError::MissingCallType)?; - if let scale_info::TypeDef::Variant(var) = ty.type_def() { - let calls = var.variants().iter().map(|v| (v.name().clone(), v.index())).collect(); - Ok(calls) - } else { - Err(InvalidMetadataError::CallTypeNotVariant) - } - })?; + let calls = pallet.calls.as_ref().map_or(Ok(HashMap::new()), |call| { + let ty = metadata + .types + .resolve(call.ty.id()) + .ok_or(InvalidMetadataError::MissingCallType)?; + if let scale_info::TypeDef::Variant(var) = ty.type_def() { + let calls = var + .variants() + .iter() + .map(|v| (v.name().clone(), v.index())) + .collect(); + Ok(calls) + } else { + Err(InvalidMetadataError::CallTypeNotVariant) + } + })?; let pallet_metadata = PalletMetadata { index: pallet.index, name: pallet.name.to_string(), calls, storage: Default::default(), - constants: Default::default() + constants: Default::default(), }; Ok((pallet.name.to_string(), pallet_metadata)) diff --git a/src/rpc.rs b/src/rpc.rs index 61c2407384..daa1b1c40a 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -70,20 +70,20 @@ use sp_runtime::{ use sp_version::RuntimeVersion; use crate::{ - Event, error::Error, events::{ EventsDecoder, RawEvent, }, - Metadata, - Runtime, subscription::{ EventStorageSubscription, EventSubscription, FinalizedEventStorageSubscription, SystemEvents, }, + Event, + Metadata, + Runtime, }; pub type ChainBlock = @@ -150,9 +150,12 @@ pub enum TransactionStatus { Invalid, } +use crate::metadata::{ + InvalidMetadataError, + MetadataError, +}; #[cfg(feature = "client")] use substrate_subxt_client::SubxtClient; -use crate::metadata::{MetadataError, InvalidMetadataError}; /// Rpc client wrapper. /// This is workaround because adding generic types causes the macros to fail. diff --git a/src/subscription.rs b/src/subscription.rs index 51e7495065..6dc3da90fd 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -35,9 +35,9 @@ use crate::{ Raw, RawEvent, }, - Phase, - Event, rpc::Rpc, + Event, + Phase, Runtime, }; diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 144ef43b82..fd0bdf2309 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -19,20 +19,23 @@ mod node_proc; pub use node_proc::TestNodeProcess; use sp_keyring::AccountKeyring; -use sp_runtime::traits::BlakeTwo256; +use sp_runtime::{ + traits::BlakeTwo256, + AccountId32, + MultiAddress, +}; use subxt::{ + subxt, PairSigner, Runtime, - subxt, }; -use sp_runtime::{AccountId32, MultiAddress}; #[subxt(runtime_metadata_path = "node_runtime.scale")] mod node_runtime { - #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] - use sp_runtime::MultiAddress; #[subxt(substitute_type = "sp_core::crypto::AccountId32")] use sp_core::crypto::AccountId32; + #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] + use sp_runtime::MultiAddress; } #[derive(Clone, Debug, Eq, PartialEq)] diff --git a/tests/src/node_proc.rs b/tests/src/node_proc.rs index 1d44313cae..24ef4993a6 100644 --- a/tests/src/node_proc.rs +++ b/tests/src/node_proc.rs @@ -14,11 +14,6 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use subxt::{ - Client, - ClientBuilder, - Runtime, -}; use sp_keyring::AccountKeyring; use std::{ ffi::{ @@ -34,6 +29,11 @@ use std::{ thread, time, }; +use subxt::{ + Client, + ClientBuilder, + Runtime, +}; /// Spawn a local substrate node for testing subxt. pub struct TestNodeProcess { @@ -162,10 +162,7 @@ impl TestNodeProcessBuilder { attempts, MAX_ATTEMPTS ); - let result = ClientBuilder::new() - .set_url(ws_url.clone()) - .build() - .await; + let result = ClientBuilder::new().set_url(ws_url.clone()).build().await; match result { Ok(client) => break Ok(client), Err(err) => { From c35d781b84e6516a99430d15a51a1a4e7fb92f77 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 7 Sep 2021 13:52:10 +0100 Subject: [PATCH 019/216] WIP generating storage hashers --- proc-macro/src/generate_runtime.rs | 187 +++++++++++++++++++++++++++-- proc-macro/src/lib.rs | 4 +- src/client.rs | 33 +++-- src/lib.rs | 61 +++++++++- tests/src/lib.rs | 1 + 5 files changed, 262 insertions(+), 24 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 337e79739a..52b4db7ccc 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -25,8 +25,12 @@ use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, PalletMetadata, + PalletStorageMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, + StorageEntryMetadata, + StorageEntryType, + StorageHasher, }; use heck::SnakeCase as _; use proc_macro_error::{ @@ -40,6 +44,7 @@ use quote::{ use scale_info::{ form::PortableForm, prelude::string::ToString, + TypeDef, }; use std::{ collections::HashMap, @@ -102,11 +107,18 @@ impl RuntimeGenerator { let types_mod_ident = types_mod.ident(); let modules = self.metadata.pallets.iter().map(|pallet| { let mod_name = format_ident!("{}", pallet.name.to_string().to_snake_case()); - let mut calls = Vec::new(); - for call in &pallet.calls { - let call_structs = self.generate_call_structs(&type_gen, pallet, call); - calls.extend(call_structs) - } + + let calls = if let Some(ref calls) = pallet.calls { + let call_structs = self.generate_call_structs(&type_gen, pallet, calls); + quote! { + pub mod calls { + use super::#types_mod_ident; + #( #call_structs )* + } + } + } else { + quote!() + }; let event = if let Some(ref event) = pallet.event { let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); @@ -114,18 +126,25 @@ impl RuntimeGenerator { pub type Event = #event_type; } } else { - quote! {} + quote!() }; - let calls = if !calls.is_empty() { + let storage = if let Some(ref storage) = pallet.storage { + let storage_types = storage + .entries + .iter() + .map(|entry| { + self.generate_storage_entry_types(&type_gen, &pallet, entry) + }) + .collect::>(); quote! { - pub mod calls { + pub mod storage { use super::#types_mod_ident; - #( #calls )* + #( #storage_types )* } } } else { - quote! {} + quote!() }; quote! { @@ -261,7 +280,153 @@ impl RuntimeGenerator { }) .collect::>() } else { - panic!("Call type should be an variant/enum type") + abort_call_site!("Call type should be an variant/enum type") + } + } + } + } + + fn generate_storage_entry_types( + &self, + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + storage_entry: &StorageEntryMetadata, + ) -> TokenStream2 { + let entry_struct_ident = format_ident!("{}", storage_entry.name); + let (entry_struct, key_impl) = match storage_entry.ty { + StorageEntryType::Plain(_) => { + let entry_struct = quote!( pub struct #entry_struct_ident; ); + let key_impl = quote!(::subxt::StorageKey::Plain); + (entry_struct, key_impl) + } + StorageEntryType::Map { + ref key, + ref hashers, + .. + } => { + let key_ty = self.metadata.types.resolve(key.id()).unwrap_or_else(|| { + abort_call_site!("Failed to resolve storage key type") + }); + let hashers = hashers.iter().map(|hasher| { + let hasher = match hasher { + StorageHasher::Blake2_128 => "Blake2_128", + StorageHasher::Blake2_256 => "Blake2_256", + StorageHasher::Blake2_128Concat => "Blake2_128Concat", + StorageHasher::Twox128 => "Twox128", + StorageHasher::Twox256 => "Twox256", + StorageHasher::Twox64Concat => "Twox64Concat", + StorageHasher::Identity => "Identity", + }; + format_ident!("::subxt::StorageHasher::{}", hasher) + }); + match key_ty.type_def() { + TypeDef::Tuple(tuple) => { + let fields = tuple + .fields() + .iter() + .map(|f| type_gen.resolve_type_path(f.id(), &[])); + let entry_struct = quote! { + pub struct #entry_struct_ident( #( #fields ),* ); + }; + let keys = (0..tuple.fields().len()) + .into_iter() + .zip(hashers) + .map(|(field, hasher)| { + quote!( ::subxt::StorageMapKey::new(self.#field, #hasher) ) + }); + let key_impl = quote! { + ::subxt::StorageKey::Map( + vec![ #( #keys ),* ] + ) + }; + (entry_struct, key_impl) + } + TypeDef::Composite(composite) => { + // todo: [AJ] extract this pattern also used in ModuleType::composite_fields? + let named = composite.fields().iter().all(|f| f.name().is_some()); + let unnamed = + composite.fields().iter().all(|f| f.name().is_none()); + + if named { + let fields = composite + .fields() + .iter() + .map(|f| { + let field_name = format_ident!( + "{}", + f.name().expect("field is named") + ); + let field_type = + type_gen.resolve_type_path(f.ty().id(), &[]); + (field_name, field_type) + }) + .collect::>(); + let fields_def = + fields.iter().map(|(name, ty)| quote!( pub #name: #ty)); + let entry_struct = quote! { + pub struct #entry_struct_ident ( + #( #fields_def, )* + ) + }; + let keys = fields + .iter() + .zip(hashers) + .map(|((field, _), hasher)| { + quote!( ::subxt::StorageMapKey::new(self.#field, #hasher) ) + }); + let key_impl = quote! { + ::subxt::StorageKey::Map( + vec![ #( #keys ),* ] + ) + }; + (entry_struct, key_impl) + } else if unnamed { + let fields = composite.fields().iter().map(|f| { + let field_type = + type_gen.resolve_type_path(f.ty().id(), &[]); + quote!( pub #field_type ) + }); + let entry_struct = quote! { + pub struct #entry_struct_ident { + #( #fields, )* + } + }; + let key_impl = quote! { + todo!() + }; + (entry_struct, key_impl) + } else { + abort_call_site!( + "Fields must be either all named or all unnamed" + ) + } + } + _ => { + abort_call_site!( + "Storage key for entry {} must be a Tuple or Composite type", + storage_entry.name + ) + } + } + } + }; + let pallet_name = &pallet.name; + let storage_name = &storage_entry.name; + let value_ty = match storage_entry.ty { + StorageEntryType::Plain(ref ty) => ty, + StorageEntryType::Map { ref value, .. } => value, + }; + let value_ty_path = type_gen.resolve_type_path(value_ty.id(), &[]); + + quote! { + #entry_struct + + impl ::subxt::StorageEntry for #entry_struct_ident { + const PALLET: &'static str = #pallet_name; + const STORAGE: &'static str = #storage_name; + type Value = #value_ty_path; + fn key(&self) -> ::subxt::StorageKey { + #key_impl } } } diff --git a/proc-macro/src/lib.rs b/proc-macro/src/lib.rs index de881e2fcd..d25da219ec 100644 --- a/proc-macro/src/lib.rs +++ b/proc-macro/src/lib.rs @@ -42,9 +42,7 @@ pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { let args = match RuntimeMetadataArgs::from_list(&attr_args) { Ok(v) => v, - Err(e) => { - return TokenStream::from(e.write_errors()) - } + Err(e) => return TokenStream::from(e.write_errors()), }; let root = std::env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".into()); diff --git a/src/client.rs b/src/client.rs index 5f336315bd..454d3d26d5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -215,6 +215,29 @@ impl Client { } } + /// Fetch a StorageKey with an optional block hash. + pub async fn fetch>( + &self, + store: &F, + hash: Option, + ) -> Result, Error> { + let key = store.key(&self.metadata)?; + self.fetch_unhashed::(key, hash).await + } + + /// Fetch a StorageKey that has a default value with an optional block hash. + pub async fn fetch_or_default>( + &self, + store: &F, + hash: Option, + ) -> Result { + if let Some(data) = self.fetch(store, hash).await? { + Ok(data) + } else { + Ok(store.default(&self.metadata)?) + } + } + /// Query historical storage entries pub async fn query_storage( &self, @@ -302,14 +325,6 @@ impl Client { Ok(headers) } - // /// Encodes a call. - // pub fn encode>(&self, call: C) -> Result { - // Ok(self - // .metadata() - // .module_with_calls(C::MODULE) - // .and_then(|module| module.call(C::FUNCTION, call))?) - // } - /// Creates an unsigned extrinsic. // pub fn create_unsigned + Send + Sync>( // &self, @@ -332,6 +347,8 @@ impl Client { let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { + self.fetch_or_default(&AccountStore { account_id }, None) + .await; todo!("fetch nonce if not supplied") // self.account(signer.account_id(), None).await?.nonce }; diff --git a/src/lib.rs b/src/lib.rs index 4b79f99f85..86be399fae 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,6 +116,7 @@ use crate::{ Verify, }, }; +pub use frame_metadata::StorageHasher; pub use subxt_proc_macro::subxt; /// Parameter trait compied from substrate::frame_support @@ -168,6 +169,10 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { type Address: Codec + Clone + PartialEq; // + Debug + Send + Sync; + /// Data to be associated with an account (other than nonce/transaction counter, which this + /// pallet does regardless). + type AccountData: Member + Clone + Default; + /// The block header. type Header: Parameter + Header @@ -185,7 +190,7 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { /// Call trait. pub trait Call: Encode { - /// Module name. + /// Pallet name. const PALLET: &'static str; /// Function name. const FUNCTION: &'static str; @@ -193,12 +198,45 @@ pub trait Call: Encode { /// Event trait. pub trait Event: Decode { - /// Module name. + /// Pallet name. const PALLET: &'static str; /// Event name. const EVENT: &'static str; } +/// Storage entry trait. +pub trait StorageEntry { + /// Pallet name. + const PALLET: &'static str; + /// Storage name. + const STORAGE: &'static str; + /// Type of the storage entry value. + type Value: Decode; + /// Get the key data for the storage. + fn key(&self) -> StorageKey; +} + +/// Storage key. +pub enum StorageKey { + Plain, + Map(Vec), +} + +/// Storage key for a Map. +pub struct StorageMapKey { + value: Vec, + hasher: StorageHasher, +} + +impl StorageMapKey { + pub fn new(value: T, hasher: StorageHasher) -> Self { + Self { + value: value.encode(), + hasher, + } + } +} + /// A phase of a block's execution. #[derive(Clone, Debug, Eq, PartialEq, Decode)] pub enum Phase { @@ -210,6 +248,25 @@ pub enum Phase { Initialization, } +/// Information of an account. COPIED FROM SUBSTRATE system: todo: collect all these types into a common module, could also impl TypeInfo and check against Metadata for validity +#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)] +pub struct AccountInfo { + /// The number of transactions this account has sent. + pub nonce: Index, + /// The number of other modules that currently depend on this account's existence. The account + /// cannot be reaped until this is zero. + pub consumers: RefCount, + /// The number of other modules that allow this account to exist. The account may not be reaped + /// until this and `sufficients` are both zero. + pub providers: RefCount, + /// The number of modules that allow this account to exist for their own purposes only. The + /// account may not be reaped until this and `providers` are both zero. + pub sufficients: RefCount, + /// The additional data that belongs to this account. Used to store the balance(s) in a lot of + /// chains. + pub data: AccountData, +} + /// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of /// the transaction payload #[derive(Clone, Debug, Eq, PartialEq)] diff --git a/tests/src/lib.rs b/tests/src/lib.rs index fd0bdf2309..5893fd528c 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -52,6 +52,7 @@ impl Runtime for TestRuntime { type Extra = subxt::extrinsic::DefaultExtra; type Signature = sp_runtime::MultiSignature; type Extrinsic = sp_runtime::OpaqueExtrinsic; + type AccountData = subxt::AccountInfo; // todo: [AJ] possibly replace this with a trait for GetNonce because we require the Balance type here which is not necessarily constant } /// substrate node should be installed on the $PATH From 4726db3569ccf9ababa4b710cd8ce79e6e565cf9 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 7 Sep 2021 14:58:26 +0100 Subject: [PATCH 020/216] WIP add AccountData trait for fetching the nonce --- src/client.rs | 78 ++++++++++++++++++++++----------------------------- src/lib.rs | 36 +++++++++++------------- 2 files changed, 50 insertions(+), 64 deletions(-) diff --git a/src/client.rs b/src/client.rs index 454d3d26d5..58a99b3286 100644 --- a/src/client.rs +++ b/src/client.rs @@ -33,35 +33,23 @@ use std::{ sync::Arc, }; -use crate::{ - events::EventsDecoder, - extrinsic::{ - self, - PairSigner, - SignedExtra, - Signer, - UncheckedExtrinsic, - }, - rpc::{ - ChainBlock, - ExtrinsicSuccess, - Rpc, - RpcClient, - SystemProperties, - }, - subscription::{ - EventStorageSubscription, - EventSubscription, - FinalizedEventStorageSubscription, - }, - BlockNumber, - Call, - Encoded, - Error, - Metadata, - ReadProof, - Runtime, -}; +use crate::{events::EventsDecoder, extrinsic::{ + self, + PairSigner, + SignedExtra, + Signer, + UncheckedExtrinsic, +}, rpc::{ + ChainBlock, + ExtrinsicSuccess, + Rpc, + RpcClient, + SystemProperties, +}, subscription::{ + EventStorageSubscription, + EventSubscription, + FinalizedEventStorageSubscription, +}, BlockNumber, Call, Encoded, Error, Metadata, ReadProof, Runtime, StorageEntry, AccountData}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -216,26 +204,28 @@ impl Client { } /// Fetch a StorageKey with an optional block hash. - pub async fn fetch>( + pub async fn fetch( &self, store: &F, hash: Option, - ) -> Result, Error> { - let key = store.key(&self.metadata)?; - self.fetch_unhashed::(key, hash).await + ) -> Result, Error> { + todo!("fetch") + // let key = store.key(&self.metadata)?; + // self.fetch_unhashed::(key, hash).await } /// Fetch a StorageKey that has a default value with an optional block hash. - pub async fn fetch_or_default>( + pub async fn fetch_or_default( &self, store: &F, hash: Option, - ) -> Result { - if let Some(data) = self.fetch(store, hash).await? { - Ok(data) - } else { - Ok(store.default(&self.metadata)?) - } + ) -> Result { + // if let Some(data) = self.fetch(store, hash).await? { + // Ok(data) + // } else { + // Ok(store.default(&self.metadata)?) + // } + todo!("fetch_or_default") } /// Query historical storage entries @@ -347,10 +337,10 @@ impl Client { let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { - self.fetch_or_default(&AccountStore { account_id }, None) - .await; - todo!("fetch nonce if not supplied") - // self.account(signer.account_id(), None).await?.nonce + let account_storage_entry = >::storage_entry(signer.account_id()); + let account_data = self.fetch_or_default(&account_storage_entry, None) + .await?; + >::nonce(&account_data) }; let call = self.encode(call)?; let signed = extrinsic::create_signed( diff --git a/src/lib.rs b/src/lib.rs index 86be399fae..e4da6840e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -171,7 +171,7 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { /// Data to be associated with an account (other than nonce/transaction counter, which this /// pallet does regardless). - type AccountData: Member + Clone + Default; + type AccountData: AccountData; /// The block header. type Header: Parameter @@ -188,6 +188,18 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; } +/// Trait to fetch data about an account. +pub trait AccountData { + /// The storage entry type. + type StorageEntryType: StorageEntry; + + /// Construct a storage entry type with the account id for the key. + fn storage_entry(account_id: &T::AccountId) -> Self::StorageEntryType; + + /// Get the nonce from the storage entry value. + fn nonce(result: &::Value) -> T::Index; +} + /// Call trait. pub trait Call: Encode { /// Pallet name. @@ -218,7 +230,9 @@ pub trait StorageEntry { /// Storage key. pub enum StorageKey { + /// Plain key. Plain, + /// Map key(s). Map(Vec), } @@ -229,6 +243,7 @@ pub struct StorageMapKey { } impl StorageMapKey { + /// Create a new [`StorageMapKey`] with the encoded data and the hasher. pub fn new(value: T, hasher: StorageHasher) -> Self { Self { value: value.encode(), @@ -248,25 +263,6 @@ pub enum Phase { Initialization, } -/// Information of an account. COPIED FROM SUBSTRATE system: todo: collect all these types into a common module, could also impl TypeInfo and check against Metadata for validity -#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)] -pub struct AccountInfo { - /// The number of transactions this account has sent. - pub nonce: Index, - /// The number of other modules that currently depend on this account's existence. The account - /// cannot be reaped until this is zero. - pub consumers: RefCount, - /// The number of other modules that allow this account to exist. The account may not be reaped - /// until this and `sufficients` are both zero. - pub providers: RefCount, - /// The number of modules that allow this account to exist for their own purposes only. The - /// account may not be reaped until this and `providers` are both zero. - pub sufficients: RefCount, - /// The additional data that belongs to this account. Used to store the balance(s) in a lot of - /// chains. - pub data: AccountData, -} - /// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of /// the transaction payload #[derive(Clone, Debug, Eq, PartialEq)] From f8f8b472c890dcc2502906c06ec0018444d90384 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 7 Sep 2021 17:45:53 +0100 Subject: [PATCH 021/216] Support single type storage map keys --- proc-macro/src/generate_runtime.rs | 36 +++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 52b4db7ccc..cbf2b127b7 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -317,8 +317,8 @@ impl RuntimeGenerator { StorageHasher::Twox64Concat => "Twox64Concat", StorageHasher::Identity => "Identity", }; - format_ident!("::subxt::StorageHasher::{}", hasher) - }); + quote!( ::subxt::StorageHasher::#hasher ) + }).collect::>(); match key_ty.type_def() { TypeDef::Tuple(tuple) => { let fields = tuple @@ -382,17 +382,24 @@ impl RuntimeGenerator { (entry_struct, key_impl) } else if unnamed { let fields = composite.fields().iter().map(|f| { - let field_type = - type_gen.resolve_type_path(f.ty().id(), &[]); - quote!( pub #field_type ) - }); + type_gen.resolve_type_path(f.ty().id(), &[]) + }).collect::>(); + let fields_def = fields.iter().map(|field_type| quote!( pub #field_type )); let entry_struct = quote! { pub struct #entry_struct_ident { #( #fields, )* } }; + let keys = fields + .iter() + .zip(hashers) + .map(|(field, hasher)| { + quote!( ::subxt::StorageMapKey::new(self.#field, #hasher) ) + }); let key_impl = quote! { - todo!() + ::subxt::StorageKey::Map( + vec![ #( #keys ),* ] + ) }; (entry_struct, key_impl) } else { @@ -402,10 +409,17 @@ impl RuntimeGenerator { } } _ => { - abort_call_site!( - "Storage key for entry {} must be a Tuple or Composite type", - storage_entry.name - ) + let ty_path = type_gen.resolve_type_path(key.id(), &[]); + let entry_struct = quote! { + pub struct #entry_struct_ident(#ty_path); + }; + let hasher = hashers.get(0).unwrap_or_else(|| abort_call_site!("No hasher found for single key")); + let key_impl = quote! { + ::subxt::StorageKey::Map( + vec![ ::subxt::StorageMapKey::new(self.0, #hasher) ] + ) + }; + (entry_struct, key_impl) } } } From 4b573f50972e51859b1c50e4fd067adcf9f7b20c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 7 Sep 2021 18:03:22 +0100 Subject: [PATCH 022/216] WIP impl AccountInfo retrieval --- proc-macro/src/generate_runtime.rs | 2 ++ tests/src/lib.rs | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index cbf2b127b7..beaeee1387 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -152,6 +152,7 @@ impl RuntimeGenerator { use super::#types_mod_ident; #calls #event + #storage } } }); @@ -317,6 +318,7 @@ impl RuntimeGenerator { StorageHasher::Twox64Concat => "Twox64Concat", StorageHasher::Identity => "Identity", }; + let hasher = format_ident!("{}", hasher); quote!( ::subxt::StorageHasher::#hasher ) }).collect::>(); match key_ty.type_def() { diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 5893fd528c..84b33a447d 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -24,11 +24,7 @@ use sp_runtime::{ AccountId32, MultiAddress, }; -use subxt::{ - subxt, - PairSigner, - Runtime, -}; +use subxt::{subxt, PairSigner, Runtime, StorageEntry}; #[subxt(runtime_metadata_path = "node_runtime.scale")] mod node_runtime { @@ -52,7 +48,20 @@ impl Runtime for TestRuntime { type Extra = subxt::extrinsic::DefaultExtra; type Signature = sp_runtime::MultiSignature; type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = subxt::AccountInfo; // todo: [AJ] possibly replace this with a trait for GetNonce because we require the Balance type here which is not necessarily constant + type AccountData = Self; // todo: [AJ] possibly replace this with a trait for GetNonce because we require the Balance type here which is not necessarily constant +} + +impl subxt::AccountData for TestRuntime { + // todo: impl on actual storage Type rather than assoc type here? + type StorageEntryType = node_runtime::__types::frame_system::storage::Account; + + fn storage_entry(account_id: &::AccountId) -> Self::StorageEntryType { + >::StorageEntryType (account_id) + } + + fn nonce(result: &::Value) -> ::Index { + result.nonce + } } /// substrate node should be installed on the $PATH @@ -104,8 +113,7 @@ pub(crate) async fn test_node_process() -> TestNodeProcess { async fn test_tx_transfer_balance() { use crate::node_runtime::balances::calls::Transfer; - let mut signer = PairSigner::new(AccountKeyring::Alice.pair()); - signer.set_nonce(0); // todo: auto nonce handling in client. + let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); let node_process = test_node_process().await; From a6e7225ab024259a49909cbc9aee09c6cda40c40 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 09:27:34 +0100 Subject: [PATCH 023/216] Fix up storage struct generation --- proc-macro/src/generate_runtime.rs | 19 +++++++++---------- proc-macro/src/generate_types.rs | 1 - tests/src/lib.rs | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index beaeee1387..da233f392c 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -25,7 +25,6 @@ use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, PalletMetadata, - PalletStorageMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, StorageEntryMetadata, @@ -334,7 +333,8 @@ impl RuntimeGenerator { .into_iter() .zip(hashers) .map(|(field, hasher)| { - quote!( ::subxt::StorageMapKey::new(self.#field, #hasher) ) + let index = syn::Index::from(field); + quote!( ::subxt::StorageMapKey::new(self.#index, #hasher) ) }); let key_impl = quote! { ::subxt::StorageKey::Map( @@ -366,9 +366,9 @@ impl RuntimeGenerator { let fields_def = fields.iter().map(|(name, ty)| quote!( pub #name: #ty)); let entry_struct = quote! { - pub struct #entry_struct_ident ( + pub struct #entry_struct_ident { #( #fields_def, )* - ) + } }; let keys = fields .iter() @@ -388,15 +388,14 @@ impl RuntimeGenerator { }).collect::>(); let fields_def = fields.iter().map(|field_type| quote!( pub #field_type )); let entry_struct = quote! { - pub struct #entry_struct_ident { - #( #fields, )* - } + pub struct #entry_struct_ident( #( #fields_def, )* ); }; - let keys = fields - .iter() + let keys = (0..fields.len()) + .into_iter() .zip(hashers) .map(|(field, hasher)| { - quote!( ::subxt::StorageMapKey::new(self.#field, #hasher) ) + let index = syn::Index::from(field); + quote!( ::subxt::StorageMapKey::new(self.#index, #hasher) ) }); let key_impl = quote! { ::subxt::StorageKey::Map( diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index ffaec284c9..e6afa65c4a 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -28,7 +28,6 @@ use quote::{ use scale_info::{ form::PortableForm, Field, - Path, PortableRegistry, Type, TypeDef, diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 84b33a447d..f9d440e76c 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -48,7 +48,7 @@ impl Runtime for TestRuntime { type Extra = subxt::extrinsic::DefaultExtra; type Signature = sp_runtime::MultiSignature; type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = Self; // todo: [AJ] possibly replace this with a trait for GetNonce because we require the Balance type here which is not necessarily constant + type AccountData = Self; } impl subxt::AccountData for TestRuntime { From d2bd669d8d06b92ae6c1258175861d637e8418b4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 09:45:56 +0100 Subject: [PATCH 024/216] Implement AccountData triait directly on storage entry --- proc-macro/src/generate_runtime.rs | 1 + src/client.rs | 2 +- src/lib.rs | 9 +++------ tests/src/lib.rs | 13 +++++-------- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index da233f392c..a172d29c38 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -143,6 +143,7 @@ impl RuntimeGenerator { } } } else { + println!("No storage for {}", mod_name); quote!() }; diff --git a/src/client.rs b/src/client.rs index 58a99b3286..0e181dde10 100644 --- a/src/client.rs +++ b/src/client.rs @@ -337,7 +337,7 @@ impl Client { let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { - let account_storage_entry = >::storage_entry(signer.account_id()); + let account_storage_entry = >::new(signer.account_id().clone()); let account_data = self.fetch_or_default(&account_storage_entry, None) .await?; >::nonce(&account_data) diff --git a/src/lib.rs b/src/lib.rs index e4da6840e6..a8bed3c977 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -189,15 +189,12 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { } /// Trait to fetch data about an account. -pub trait AccountData { - /// The storage entry type. - type StorageEntryType: StorageEntry; - +pub trait AccountData: StorageEntry { /// Construct a storage entry type with the account id for the key. - fn storage_entry(account_id: &T::AccountId) -> Self::StorageEntryType; + fn new(account_id: T::AccountId) -> Self; /// Get the nonce from the storage entry value. - fn nonce(result: &::Value) -> T::Index; + fn nonce(result: &::Value) -> T::Index; } /// Call trait. diff --git a/tests/src/lib.rs b/tests/src/lib.rs index f9d440e76c..f7910a0bcb 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -48,18 +48,15 @@ impl Runtime for TestRuntime { type Extra = subxt::extrinsic::DefaultExtra; type Signature = sp_runtime::MultiSignature; type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = Self; + type AccountData = node_runtime::system::storage::Account; } -impl subxt::AccountData for TestRuntime { - // todo: impl on actual storage Type rather than assoc type here? - type StorageEntryType = node_runtime::__types::frame_system::storage::Account; - - fn storage_entry(account_id: &::AccountId) -> Self::StorageEntryType { - >::StorageEntryType (account_id) +impl subxt::AccountData for node_runtime::system::storage::Account { + fn new(account_id: ::AccountId) -> Self { + Self(account_id) } - fn nonce(result: &::Value) -> ::Index { + fn nonce(result: &::Value) -> ::Index { result.nonce } } From 11248d0893be8f46ddb87766751c3a3225fc957d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 10:06:20 +0100 Subject: [PATCH 025/216] Borrow storage map key and convert account id --- proc-macro/src/generate_runtime.rs | 9 ++++----- src/lib.rs | 2 +- tests/src/lib.rs | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index a172d29c38..2a3ac5452d 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -143,7 +143,6 @@ impl RuntimeGenerator { } } } else { - println!("No storage for {}", mod_name); quote!() }; @@ -335,7 +334,7 @@ impl RuntimeGenerator { .zip(hashers) .map(|(field, hasher)| { let index = syn::Index::from(field); - quote!( ::subxt::StorageMapKey::new(self.#index, #hasher) ) + quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) }); let key_impl = quote! { ::subxt::StorageKey::Map( @@ -375,7 +374,7 @@ impl RuntimeGenerator { .iter() .zip(hashers) .map(|((field, _), hasher)| { - quote!( ::subxt::StorageMapKey::new(self.#field, #hasher) ) + quote!( ::subxt::StorageMapKey::new(&self.#field, #hasher) ) }); let key_impl = quote! { ::subxt::StorageKey::Map( @@ -396,7 +395,7 @@ impl RuntimeGenerator { .zip(hashers) .map(|(field, hasher)| { let index = syn::Index::from(field); - quote!( ::subxt::StorageMapKey::new(self.#index, #hasher) ) + quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) }); let key_impl = quote! { ::subxt::StorageKey::Map( @@ -418,7 +417,7 @@ impl RuntimeGenerator { let hasher = hashers.get(0).unwrap_or_else(|| abort_call_site!("No hasher found for single key")); let key_impl = quote! { ::subxt::StorageKey::Map( - vec![ ::subxt::StorageMapKey::new(self.0, #hasher) ] + vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] ) }; (entry_struct, key_impl) diff --git a/src/lib.rs b/src/lib.rs index a8bed3c977..a9e3f5772a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -241,7 +241,7 @@ pub struct StorageMapKey { impl StorageMapKey { /// Create a new [`StorageMapKey`] with the encoded data and the hasher. - pub fn new(value: T, hasher: StorageHasher) -> Self { + pub fn new(value: &T, hasher: StorageHasher) -> Self { Self { value: value.encode(), hasher, diff --git a/tests/src/lib.rs b/tests/src/lib.rs index f7910a0bcb..7381c87680 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -53,7 +53,7 @@ impl Runtime for TestRuntime { impl subxt::AccountData for node_runtime::system::storage::Account { fn new(account_id: ::AccountId) -> Self { - Self(account_id) + Self(account_id.into()) // todo: [AJ] why is Account.0 a [u8;32] and not AccountId32? } fn nonce(result: &::Value) -> ::Index { @@ -110,7 +110,7 @@ pub(crate) async fn test_node_process() -> TestNodeProcess { async fn test_tx_transfer_balance() { use crate::node_runtime::balances::calls::Transfer; - let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let mut signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); let node_process = test_node_process().await; From b9ad905a3f8f0fdf820319e051d09c43a0ad2df7 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 11:05:28 +0100 Subject: [PATCH 026/216] Implement storage fetch client methods --- proc-macro/src/generate_runtime.rs | 12 +++--- src/client.rs | 19 ++++----- src/lib.rs | 62 ++++++++++++++++++++++++------ 3 files changed, 67 insertions(+), 26 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 2a3ac5452d..6773294bc3 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -296,7 +296,7 @@ impl RuntimeGenerator { let (entry_struct, key_impl) = match storage_entry.ty { StorageEntryType::Plain(_) => { let entry_struct = quote!( pub struct #entry_struct_ident; ); - let key_impl = quote!(::subxt::StorageKey::Plain); + let key_impl = quote!(::subxt::StorageEntryKey::Plain); (entry_struct, key_impl) } StorageEntryType::Map { @@ -337,7 +337,7 @@ impl RuntimeGenerator { quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) }); let key_impl = quote! { - ::subxt::StorageKey::Map( + ::subxt::StorageEntryKey::Map( vec![ #( #keys ),* ] ) }; @@ -377,7 +377,7 @@ impl RuntimeGenerator { quote!( ::subxt::StorageMapKey::new(&self.#field, #hasher) ) }); let key_impl = quote! { - ::subxt::StorageKey::Map( + ::subxt::StorageEntryKey::Map( vec![ #( #keys ),* ] ) }; @@ -398,7 +398,7 @@ impl RuntimeGenerator { quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) }); let key_impl = quote! { - ::subxt::StorageKey::Map( + ::subxt::StorageEntryKey::Map( vec![ #( #keys ),* ] ) }; @@ -416,7 +416,7 @@ impl RuntimeGenerator { }; let hasher = hashers.get(0).unwrap_or_else(|| abort_call_site!("No hasher found for single key")); let key_impl = quote! { - ::subxt::StorageKey::Map( + ::subxt::StorageEntryKey::Map( vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] ) }; @@ -440,7 +440,7 @@ impl RuntimeGenerator { const PALLET: &'static str = #pallet_name; const STORAGE: &'static str = #storage_name; type Value = #value_ty_path; - fn key(&self) -> ::subxt::StorageKey { + fn key(&self) -> ::subxt::StorageEntryKey { #key_impl } } diff --git a/src/client.rs b/src/client.rs index 0e181dde10..5c8fec73c5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -209,9 +209,8 @@ impl Client { store: &F, hash: Option, ) -> Result, Error> { - todo!("fetch") - // let key = store.key(&self.metadata)?; - // self.fetch_unhashed::(key, hash).await + let key = store.key().final_key::(); + self.fetch_unhashed::(key, hash).await } /// Fetch a StorageKey that has a default value with an optional block hash. @@ -220,12 +219,14 @@ impl Client { store: &F, hash: Option, ) -> Result { - // if let Some(data) = self.fetch(store, hash).await? { - // Ok(data) - // } else { - // Ok(store.default(&self.metadata)?) - // } - todo!("fetch_or_default") + if let Some(data) = self.fetch(store, hash).await? { + Ok(data) + } else { + let pallet_metadata = self.metadata.pallet(F::PALLET)?; + let storage_metadata = pallet_metadata.storage(F::STORAGE)?; + let default = storage_metadata.default()?; + Ok(default) + } } /// Query historical storage entries diff --git a/src/lib.rs b/src/lib.rs index a9e3f5772a..83485ba05e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,19 +106,20 @@ use crate::{ ChainBlock, Rpc, }, - sp_runtime::traits::{ - AtLeast32Bit, - Extrinsic, - Hash, - Header, - MaybeSerializeDeserialize, - Member, - Verify, - }, }; pub use frame_metadata::StorageHasher; pub use subxt_proc_macro::subxt; +use sp_runtime::traits::{ + AtLeast32Bit, + Extrinsic, + Hash, + Header, + MaybeSerializeDeserialize, + Member, + Verify, +}; + /// Parameter trait compied from substrate::frame_support pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} @@ -222,17 +223,56 @@ pub trait StorageEntry { /// Type of the storage entry value. type Value: Decode; /// Get the key data for the storage. - fn key(&self) -> StorageKey; + fn key(&self) -> StorageEntryKey; } /// Storage key. -pub enum StorageKey { +pub enum StorageEntryKey { /// Plain key. Plain, /// Map key(s). Map(Vec), } +impl StorageEntryKey { + /// Construct the final [`sp_core::storage::StorageKey`] for the storage entry. + pub fn final_key(&self) -> sp_core::storage::StorageKey { + let mut bytes = sp_core::twox_128(T::PALLET.as_bytes()).to_vec(); + bytes.extend(&sp_core::twox_128(T::STORAGE.as_bytes())[..]); + if let Self::Map(map_keys) = self { + for map_key in map_keys { + bytes.extend(Self::hash(&map_key.hasher, &map_key.value)) + } + } + sp_core::storage::StorageKey(bytes) + } + + fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { + match hasher { + StorageHasher::Identity => bytes.to_vec(), + StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), + StorageHasher::Blake2_128Concat => { + // copied from substrate Blake2_128Concat::hash since StorageHasher is not public + sp_core::blake2_128(bytes) + .iter() + .chain(bytes) + .cloned() + .collect() + } + StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), + StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), + StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), + StorageHasher::Twox64Concat => { + sp_core::twox_64(bytes) + .iter() + .chain(bytes) + .cloned() + .collect() + } + } + } +} + /// Storage key for a Map. pub struct StorageMapKey { value: Vec, From f98d95a92da358b8ed01a296aecb0718743311ea Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 11:08:11 +0100 Subject: [PATCH 027/216] Remove legacy metadata storage key construction --- src/metadata.rs | 123 ------------------------------------------------ 1 file changed, 123 deletions(-) diff --git a/src/metadata.rs b/src/metadata.rs index 56bbba48b5..236dac9562 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -145,133 +145,10 @@ pub struct StorageMetadata { } impl StorageMetadata { - pub fn prefix(&self) -> StorageKey { - let mut bytes = sp_core::twox_128(self.module_prefix.as_bytes()).to_vec(); - bytes.extend(&sp_core::twox_128(self.storage_prefix.as_bytes())[..]); - StorageKey(bytes) - } - pub fn default(&self) -> Result { Decode::decode(&mut &self.default[..]).map_err(MetadataError::DefaultError) } - pub fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { - match hasher { - StorageHasher::Identity => bytes.to_vec(), - StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), - StorageHasher::Blake2_128Concat => { - // copied from substrate Blake2_128Concat::hash since StorageHasher is not public - sp_core::blake2_128(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), - StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), - StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), - StorageHasher::Twox64Concat => { - sp_core::twox_64(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - } - } - - pub fn hash_key(hasher: &StorageHasher, key: &K) -> Vec { - Self::hash(hasher, &key.encode()) - } - - pub fn plain(&self) -> Result { - match &self.ty { - StorageEntryType::Plain(_) => { - Ok(StoragePlain { - prefix: self.prefix().0, - }) - } - _ => Err(MetadataError::StorageTypeError), - } - } - - pub fn map(&self) -> Result, MetadataError> { - todo!() - // match &self.ty { - // StorageEntryType::Map { hasher, .. } => { - // Ok(StorageMap { - // _marker: PhantomData, - // prefix: self.prefix().0, - // hasher: hasher.clone(), - // }) - // } - // _ => Err(MetadataError::StorageTypeError), - // } - } - - pub fn double_map( - &self, - ) -> Result, MetadataError> { - todo!() - // match &self.ty { - // StorageEntryType::DoubleMap { - // hasher, - // key2_hasher, - // .. - // } => { - // Ok(StorageDoubleMap { - // _marker: PhantomData, - // prefix: self.prefix().0, - // hasher1: hasher.clone(), - // hasher2: key2_hasher.clone(), - // }) - // } - // _ => Err(MetadataError::StorageTypeError), - // } - } -} - -#[derive(Clone, Debug)] -pub struct StoragePlain { - prefix: Vec, -} - -impl StoragePlain { - pub fn key(&self) -> StorageKey { - StorageKey(self.prefix.clone()) - } -} - -#[derive(Clone, Debug)] -pub struct StorageMap { - _marker: PhantomData, - prefix: Vec, - hasher: StorageHasher, -} - -impl StorageMap { - pub fn key(&self, key: &K) -> StorageKey { - let mut bytes = self.prefix.clone(); - bytes.extend(StorageMetadata::hash_key(&self.hasher, key)); - StorageKey(bytes) - } -} - -#[derive(Clone, Debug)] -pub struct StorageDoubleMap { - _marker: PhantomData<(K1, K2)>, - prefix: Vec, - hasher1: StorageHasher, - hasher2: StorageHasher, -} - -impl StorageDoubleMap { - pub fn key(&self, key1: &K1, key2: &K2) -> StorageKey { - let mut bytes = self.prefix.clone(); - bytes.extend(StorageMetadata::hash_key(&self.hasher1, key1)); - bytes.extend(StorageMetadata::hash_key(&self.hasher2, key2)); - StorageKey(bytes) - } } #[derive(Debug, thiserror::Error)] From a8ca64ade68c241b162edf2cace9c17a354428d2 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 11:18:31 +0100 Subject: [PATCH 028/216] Rename CheckEra to CheckMortality --- src/extrinsic/extra.rs | 10 +++++----- src/extrinsic/mod.rs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index 67a5c1edf2..e386cdf45f 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -136,7 +136,7 @@ where /// returned via `additional_signed()`. It assumes therefore `Era::Immortal` (The transaction is /// valid forever) #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] -pub struct CheckEra( +pub struct CheckMortality( /// The default structure for the Extra encoding pub (Era, PhantomData), /// Local genesis hash to be used for `AdditionalSigned` @@ -144,11 +144,11 @@ pub struct CheckEra( pub T::Hash, ); -impl SignedExtension for CheckEra +impl SignedExtension for CheckMortality where T: Runtime + Clone + Debug + Eq + Send + Sync, { - const IDENTIFIER: &'static str = "CheckEra"; + const IDENTIFIER: &'static str = "CheckMortality"; type AccountId = u64; type Call = (); type AdditionalSigned = T::Hash; @@ -249,7 +249,7 @@ impl SignedExtra for DefaultEx CheckSpecVersion, CheckTxVersion, CheckGenesis, - CheckEra, + CheckMortality, CheckNonce, CheckWeight, ChargeTransactionPayment, @@ -274,7 +274,7 @@ impl SignedExtra for DefaultEx CheckSpecVersion(PhantomData, self.spec_version), CheckTxVersion(PhantomData, self.tx_version), CheckGenesis(PhantomData, self.genesis_hash), - CheckEra((Era::Immortal, PhantomData), self.genesis_hash), + CheckMortality((Era::Immortal, PhantomData), self.genesis_hash), CheckNonce(self.nonce), CheckWeight(PhantomData), ChargeTransactionPayment(u128::default()), diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index f358fc8179..1516ae019a 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -22,7 +22,7 @@ mod signer; pub use self::{ extra::{ ChargeTransactionPayment, - CheckEra, + CheckMortality, CheckGenesis, CheckNonce, CheckSpecVersion, From 9eac4868d2172d4a6c67348d147d8aacf33baf57 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 8 Sep 2021 15:32:09 +0100 Subject: [PATCH 029/216] Substitute perthings types for compact impls --- proc-macro/src/generate_runtime.rs | 6 ++++- proc-macro/src/generate_types.rs | 37 +++++++++++++++++++++--------- tests/Cargo.toml | 1 + tests/src/lib.rs | 27 +++++++++++++--------- 4 files changed, 48 insertions(+), 23 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 6773294bc3..4afbe31554 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -259,7 +259,11 @@ impl RuntimeGenerator { let name = format_ident!("{}", name); let ty = type_gen.resolve_type_path(field.ty().id(), &[]); - quote! { pub #name: #ty } + if ty.is_compact() { + quote! { #[codec(compact)] pub #name: #ty } + } else { + quote! { pub #name: #ty } + } }) }); diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index e6afa65c4a..356d7dad46 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -392,18 +392,25 @@ impl<'a> ModuleType<'a> { let mut fields_tokens = fields .iter() .map(|(name, ty, ty_name)| { - match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! { pub #name: #ty } - } else { - quote! { #name: #ty } + let field_type = + match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! ( pub #name: #ty ) + } else { + quote! ( #name: #ty ) + } } - } - None => { - quote! { #name: #ty } - } + None => { + quote! ( #name: #ty ) + } + }; + if ty.is_compact() { + // todo: [AJ] figure out way to ensure AsCompact generated for target type in scale_info. + quote!( #[codec(compact)] #field_type ) + } else { + quote!( #field_type ) } }) .collect::>(); @@ -511,6 +518,10 @@ impl TypePath { } } + pub(crate) fn is_compact(&self) -> bool { + matches!(self, Self::Type(ty) if ty.is_compact()) + } + /// Returns the type parameters in a path which are inherited from the containing type. /// /// # Example @@ -543,6 +554,10 @@ impl TypePathType { &self.ty } + pub(crate) fn is_compact(&self) -> bool { + matches!(self.ty.type_def(), TypeDef::Compact(_)) + } + fn to_syn_type(&self) -> syn::Type { let params = &self.params; match self.ty.type_def() { diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 71ac56dc51..90ea2e7190 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -8,6 +8,7 @@ subxt = { package = "substrate-subxt", path = ".." } codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } +sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/" } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/" } sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/" } diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 7381c87680..1262b27483 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -32,6 +32,11 @@ mod node_runtime { use sp_core::crypto::AccountId32; #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] use sp_runtime::MultiAddress; + + #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] + use sp_arithmetic::per_things::Perquintill; + #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] + use sp_arithmetic::per_things::Perbill; } #[derive(Clone, Debug, Eq, PartialEq)] @@ -127,17 +132,17 @@ async fn test_tx_transfer_balance() { .unwrap(); // check that nonce is handled correctly - signer.increment_nonce(); - client - .submit( - Transfer { - dest, - value: 10_000, - }, - &signer, - ) - .await - .unwrap(); + // signer.increment_nonce(); + // client + // .submit( + // Transfer { + // dest, + // value: 10_000, + // }, + // &signer, + // ) + // .await + // .unwrap(); } // #[async_std::test] From a5281fcf89fd13e54a08ed5fb2909cf43a7455cf Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 09:50:00 +0100 Subject: [PATCH 030/216] Fmt --- proc-macro/src/generate_runtime.rs | 44 ++++++++++++++---------- proc-macro/src/generate_types.rs | 23 ++++++------- src/client.rs | 55 +++++++++++++++++++----------- src/extrinsic/mod.rs | 2 +- src/lib.rs | 10 +++--- src/metadata.rs | 1 - tests/src/lib.rs | 11 ++++-- 7 files changed, 85 insertions(+), 61 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 4afbe31554..6a36c9cbb1 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -311,19 +311,22 @@ impl RuntimeGenerator { let key_ty = self.metadata.types.resolve(key.id()).unwrap_or_else(|| { abort_call_site!("Failed to resolve storage key type") }); - let hashers = hashers.iter().map(|hasher| { - let hasher = match hasher { - StorageHasher::Blake2_128 => "Blake2_128", - StorageHasher::Blake2_256 => "Blake2_256", - StorageHasher::Blake2_128Concat => "Blake2_128Concat", - StorageHasher::Twox128 => "Twox128", - StorageHasher::Twox256 => "Twox256", - StorageHasher::Twox64Concat => "Twox64Concat", - StorageHasher::Identity => "Identity", - }; - let hasher = format_ident!("{}", hasher); - quote!( ::subxt::StorageHasher::#hasher ) - }).collect::>(); + let hashers = hashers + .iter() + .map(|hasher| { + let hasher = match hasher { + StorageHasher::Blake2_128 => "Blake2_128", + StorageHasher::Blake2_256 => "Blake2_256", + StorageHasher::Blake2_128Concat => "Blake2_128Concat", + StorageHasher::Twox128 => "Twox128", + StorageHasher::Twox256 => "Twox256", + StorageHasher::Twox64Concat => "Twox64Concat", + StorageHasher::Identity => "Identity", + }; + let hasher = format_ident!("{}", hasher); + quote!( ::subxt::StorageHasher::#hasher ) + }) + .collect::>(); match key_ty.type_def() { TypeDef::Tuple(tuple) => { let fields = tuple @@ -387,10 +390,13 @@ impl RuntimeGenerator { }; (entry_struct, key_impl) } else if unnamed { - let fields = composite.fields().iter().map(|f| { - type_gen.resolve_type_path(f.ty().id(), &[]) - }).collect::>(); - let fields_def = fields.iter().map(|field_type| quote!( pub #field_type )); + let fields = composite + .fields() + .iter() + .map(|f| type_gen.resolve_type_path(f.ty().id(), &[])) + .collect::>(); + let fields_def = + fields.iter().map(|field_type| quote!( pub #field_type )); let entry_struct = quote! { pub struct #entry_struct_ident( #( #fields_def, )* ); }; @@ -418,7 +424,9 @@ impl RuntimeGenerator { let entry_struct = quote! { pub struct #entry_struct_ident(#ty_path); }; - let hasher = hashers.get(0).unwrap_or_else(|| abort_call_site!("No hasher found for single key")); + let hasher = hashers.get(0).unwrap_or_else(|| { + abort_call_site!("No hasher found for single key") + }); let key_impl = quote! { ::subxt::StorageEntryKey::Map( vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index 356d7dad46..438bef64cc 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -392,20 +392,19 @@ impl<'a> ModuleType<'a> { let mut fields_tokens = fields .iter() .map(|(name, ty, ty_name)| { - let field_type = - match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! ( pub #name: #ty ) - } else { - quote! ( #name: #ty ) - } - } - None => { + let field_type = match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! ( pub #name: #ty ) + } else { quote! ( #name: #ty ) } - }; + } + None => { + quote! ( #name: #ty ) + } + }; if ty.is_compact() { // todo: [AJ] figure out way to ensure AsCompact generated for target type in scale_info. quote!( #[codec(compact)] #field_type ) diff --git a/src/client.rs b/src/client.rs index 5c8fec73c5..0d9e37981b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -33,23 +33,37 @@ use std::{ sync::Arc, }; -use crate::{events::EventsDecoder, extrinsic::{ - self, - PairSigner, - SignedExtra, - Signer, - UncheckedExtrinsic, -}, rpc::{ - ChainBlock, - ExtrinsicSuccess, - Rpc, - RpcClient, - SystemProperties, -}, subscription::{ - EventStorageSubscription, - EventSubscription, - FinalizedEventStorageSubscription, -}, BlockNumber, Call, Encoded, Error, Metadata, ReadProof, Runtime, StorageEntry, AccountData}; +use crate::{ + events::EventsDecoder, + extrinsic::{ + self, + PairSigner, + SignedExtra, + Signer, + UncheckedExtrinsic, + }, + rpc::{ + ChainBlock, + ExtrinsicSuccess, + Rpc, + RpcClient, + SystemProperties, + }, + subscription::{ + EventStorageSubscription, + EventSubscription, + FinalizedEventStorageSubscription, + }, + AccountData, + BlockNumber, + Call, + Encoded, + Error, + Metadata, + ReadProof, + Runtime, + StorageEntry, +}; /// ClientBuilder for constructing a Client. #[derive(Default)] @@ -338,9 +352,10 @@ impl Client { let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { - let account_storage_entry = >::new(signer.account_id().clone()); - let account_data = self.fetch_or_default(&account_storage_entry, None) - .await?; + let account_storage_entry = + >::new(signer.account_id().clone()); + let account_data = + self.fetch_or_default(&account_storage_entry, None).await?; >::nonce(&account_data) }; let call = self.encode(call)?; diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index 1516ae019a..592c549575 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -22,8 +22,8 @@ mod signer; pub use self::{ extra::{ ChargeTransactionPayment, - CheckMortality, CheckGenesis, + CheckMortality, CheckNonce, CheckSpecVersion, CheckTxVersion, diff --git a/src/lib.rs b/src/lib.rs index 83485ba05e..cdbd380707 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,6 +67,10 @@ mod metadata; mod rpc; mod subscription; +use crate::rpc::{ + ChainBlock, + Rpc, +}; pub use crate::{ client::{ Client, @@ -101,12 +105,6 @@ pub use crate::{ FinalizedEventStorageSubscription, }, }; -use crate::{ - rpc::{ - ChainBlock, - Rpc, - }, -}; pub use frame_metadata::StorageHasher; pub use subxt_proc_macro::subxt; diff --git a/src/metadata.rs b/src/metadata.rs index 236dac9562..28b0364edd 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -148,7 +148,6 @@ impl StorageMetadata { pub fn default(&self) -> Result { Decode::decode(&mut &self.default[..]).map_err(MetadataError::DefaultError) } - } #[derive(Debug, thiserror::Error)] diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 1262b27483..9289a02503 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -24,7 +24,12 @@ use sp_runtime::{ AccountId32, MultiAddress, }; -use subxt::{subxt, PairSigner, Runtime, StorageEntry}; +use subxt::{ + subxt, + PairSigner, + Runtime, + StorageEntry, +}; #[subxt(runtime_metadata_path = "node_runtime.scale")] mod node_runtime { @@ -33,10 +38,10 @@ mod node_runtime { #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] use sp_runtime::MultiAddress; - #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] - use sp_arithmetic::per_things::Perquintill; #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] use sp_arithmetic::per_things::Perbill; + #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] + use sp_arithmetic::per_things::Perquintill; } #[derive(Clone, Debug, Eq, PartialEq)] From bbb4530e4643c8aa2f359d98b1ba6ac233e7cf16 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 11:41:20 +0100 Subject: [PATCH 031/216] Downgrade dyn-clone for cargo-contract compat --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e5b6016219..6c6022fccb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } chameleon = "0.1.0" scale-info = "0.12.0" -dyn-clone = "1.0.4" +dyn-clone = "1.0.3" futures = "0.3.13" hex = "0.4.3" jsonrpsee-proc-macros = "0.3.0" From 2d7bed8f348ee84fb4238a52c45cb6bcb338c4bf Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 12:01:26 +0100 Subject: [PATCH 032/216] Scale-fo 1.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6c6022fccb..79e98534ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } chameleon = "0.1.0" -scale-info = "0.12.0" +scale-info = "1.0.0" dyn-clone = "1.0.3" futures = "0.3.13" hex = "0.4.3" From 8ab79765eb05da6d34c87085d2c21295571bf2b6 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 12:03:45 +0100 Subject: [PATCH 033/216] scale-info 1.0 --- proc-macro/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index b7ef920b39..e0c7de17e9 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -25,7 +25,7 @@ proc-macro-crate = "0.1.5" proc-macro-error = "1.0.4" quote = "1.0.8" syn = "1.0.58" -scale-info = "0.12.0" +scale-info = "1.0.0" [dev-dependencies] codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } From 6ac3f42dc95dd46821a7bff67f6595f3ab0d93da Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 12:06:03 +0100 Subject: [PATCH 034/216] Remove special range handling --- proc-macro/src/generate_types.rs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index 438bef64cc..704898457f 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -154,13 +154,6 @@ impl<'a> TypeGenerator<'a> { TypeDef::BitSequence(seq) => { vec![seq.bit_order_type().id(), seq.bit_store_type().id()] } - TypeDef::Range(range) => vec![range.index_type().id()], - _ => { - ty.type_params() - .iter() - .filter_map(|f| f.ty().map(|f| f.id())) - .collect() - } }; let params = params_type_ids @@ -638,15 +631,6 @@ impl TypePathType { syn::Type::Path(type_path) } - TypeDef::Range(range) => { - let idx = &self.params[0]; - let type_path = if range.inclusive() { - syn::parse_quote! { ::core::ops::RangeInclusive<#idx> } - } else { - syn::parse_quote! { ::core::ops::Range<#idx> } - }; - syn::Type::Path(type_path) - } } } From c935dc1898dfa8dd20698f90a6fb9b50f99c02a4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 12:09:51 +0100 Subject: [PATCH 035/216] Restore wildcard type params --- proc-macro/src/generate_types.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index 704898457f..3f01f6f4c1 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -154,6 +154,12 @@ impl<'a> TypeGenerator<'a> { TypeDef::BitSequence(seq) => { vec![seq.bit_order_type().id(), seq.bit_store_type().id()] } + _ => { + ty.type_params() + .iter() + .filter_map(|f| f.ty().map(|f| f.id())) + .collect() + } }; let params = params_type_ids From 13f69a3cc7fa0f19eed31b01929dd11d1e1a5ac6 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 12:14:56 +0100 Subject: [PATCH 036/216] Frame metadata 14.0 --- Cargo.toml | 2 +- proc-macro/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 79e98534ab..5fdbd0975b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,4 +48,4 @@ sp-rpc = { package = "sp-rpc", git = "https://github.com/paritytech/substrate/" sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/" } sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/" } -frame-metadata = { git = "https://github.com/paritytech/frame-metadata/" } +frame-metadata = "14.0.0" \ No newline at end of file diff --git a/proc-macro/Cargo.toml b/proc-macro/Cargo.toml index e0c7de17e9..f146b3f098 100644 --- a/proc-macro/Cargo.toml +++ b/proc-macro/Cargo.toml @@ -18,7 +18,7 @@ proc-macro = true async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } darling = "0.13.0" -frame-metadata = { git = "https://github.com/paritytech/frame-metadata/" } +frame-metadata = "14.0" heck = "0.3.2" proc-macro2 = "1.0.24" proc-macro-crate = "0.1.5" From af7c4ce1d1ae849b264330bf01f1e9f8736cb247 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 9 Sep 2021 17:33:17 +0100 Subject: [PATCH 037/216] WIP decoding events --- src/events.rs | 116 ++++++++++++++++++++--------------------- src/metadata.rs | 123 +++++++++++++++++++++++++++++++++++--------- src/rpc.rs | 2 +- src/subscription.rs | 2 +- 4 files changed, 158 insertions(+), 85 deletions(-) diff --git a/src/events.rs b/src/events.rs index a66089fb19..3f976db128 100644 --- a/src/events.rs +++ b/src/events.rs @@ -43,6 +43,7 @@ use std::{ }; use crate::{ + metadata::EventMetadata, Error, Metadata, Phase, @@ -52,8 +53,8 @@ use crate::{ /// Raw bytes for an Event pub struct RawEvent { - /// The name of the module from whence the Event originated - pub module: String, + /// The name of the pallet from whence the Event originated + pub pallet: String, /// The name of the Event pub variant: String, /// The raw Event data @@ -63,7 +64,7 @@ pub struct RawEvent { impl std::fmt::Debug for RawEvent { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("RawEvent") - .field("module", &self.module) + .field("module", &self.pallet) .field("variant", &self.variant) .field("data", &hex::encode(&self.data)) .finish() @@ -122,66 +123,63 @@ where /// Decode events. pub fn decode_events(&self, input: &mut &[u8]) -> Result, Error> { - todo!() - // let compact_len = >::decode(input)?; - // let len = compact_len.0 as usize; - // - // let mut r = Vec::new(); - // for _ in 0..len { - // // decode EventRecord - // let phase = Phase::decode(input)?; - // let module_variant = input.read_byte()?; - // - // let module = self.metadata.module_with_events(module_variant)?; - // let event_variant = input.read_byte()?; - // let event_metadata = module.event(event_variant)?; - // - // log::debug!( - // "received event '{}::{}' ({:?})", - // module.name(), - // event_metadata.name, - // event_metadata.arguments() - // ); - // - // let mut event_data = Vec::::new(); - // let mut event_errors = Vec::::new(); - // let result = self.decode_raw_bytes( - // &event_metadata.arguments(), - // input, - // &mut event_data, - // &mut event_errors, - // ); - // let raw = match result { - // Ok(()) => { - // log::debug!("raw bytes: {}", hex::encode(&event_data),); - // - // let event = RawEvent { - // module: module.name().to_string(), - // variant: event_metadata.name.clone(), - // data: event_data, - // }; - // - // // topics come after the event data in EventRecord - // let _topics = Vec::::decode(input)?; - // Raw::Event(event) - // } - // Err(err) => return Err(err), - // }; - // - // if event_errors.is_empty() { - // r.push((phase.clone(), raw)); - // } - // - // for err in event_errors { - // r.push((phase.clone(), Raw::Error(err))); - // } - // } - // Ok(r) + let compact_len = >::decode(input)?; + let len = compact_len.0 as usize; + + let mut r = Vec::new(); + for _ in 0..len { + // decode EventRecord + let phase = Phase::decode(input)?; + let pallet_index = input.read_byte()?; + let event_variant = input.read_byte()?; + + let event_metadata = self.metadata.event(pallet_index, event_variant)?; + + log::debug!( + "received event '{}::{}'", + event_metadata.pallet(), + event_metadata.event(), + ); + + let mut event_data = Vec::::new(); + let mut event_errors = Vec::::new(); + let result = self.decode_raw_bytes( + &event_metadata, + input, + &mut event_data, + &mut event_errors, + ); + let raw = match result { + Ok(()) => { + log::debug!("raw bytes: {}", hex::encode(&event_data),); + + let event = RawEvent { + pallet: event_metadata.pallet().to_string(), + variant: event_metadata.event().to_string(), + data: event_data, + }; + + // topics come after the event data in EventRecord + let _topics = Vec::::decode(input)?; + Raw::Event(event) + } + Err(err) => return Err(err), + }; + + if event_errors.is_empty() { + r.push((phase.clone(), raw)); + } + + for err in event_errors { + r.push((phase.clone(), Raw::Error(err))); + } + } + Ok(r) } fn decode_raw_bytes( &self, - _args: &scale_info::Variant, + _event_metadata: &EventMetadata, _input: &mut &[u8], _output: &mut W, _errors: &mut Vec, diff --git a/src/metadata.rs b/src/metadata.rs index 28b0364edd..13c8d46887 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -29,6 +29,7 @@ use codec::{ use frame_metadata::{ PalletConstantMetadata, + PalletEventMetadata, RuntimeMetadata, RuntimeMetadataLastVersion, RuntimeMetadataPrefixed, @@ -43,6 +44,13 @@ use crate::{ Call, Encoded, }; +use scale_info::{ + form::{ + Form, + PortableForm, + }, + Variant, +}; /// Metadata error. #[derive(Debug, thiserror::Error)] @@ -57,8 +65,8 @@ pub enum MetadataError { #[error("Call {0} not found")] CallNotFound(&'static str), /// Event is not in metadata. - #[error("Event {0} not found")] - EventNotFound(u8), + #[error("Pallet {0}, Event {0} not found")] + EventNotFound(u8, u8), /// Event is not in metadata. #[error("Error {0} not found")] ErrorNotFound(u8), @@ -84,6 +92,7 @@ pub enum MetadataError { pub struct Metadata { metadata: RuntimeMetadataLastVersion, pallets: HashMap, + events: HashMap<(u8, u8), EventMetadata>, } impl Metadata { @@ -93,6 +102,19 @@ impl Metadata { .get(name) .ok_or(MetadataError::PalletNotFound(name.to_string())) } + + /// Returns the variant for the event at the given pallet and event indices. + pub fn event( + &self, + pallet_index: u8, + event_index: u8, + ) -> Result<&EventMetadata, MetadataError> { + let event = self + .events + .get(&(pallet_index, event_index)) + .ok_or(MetadataError::EventNotFound(pallet_index, event_index))?; + Ok(event) + } } #[derive(Clone, Debug)] @@ -101,7 +123,7 @@ pub struct PalletMetadata { name: String, calls: HashMap, storage: HashMap, - constants: HashMap, + constants: HashMap>, } impl PalletMetadata { @@ -128,19 +150,38 @@ impl PalletMetadata { pub fn constant( &self, key: &'static str, - ) -> Result<&PalletConstantMetadata, MetadataError> { + ) -> Result<&PalletConstantMetadata, MetadataError> { self.constants .get(key) .ok_or(MetadataError::ConstantNotFound(key)) } } +#[derive(Clone, Debug)] +pub struct EventMetadata { + pallet: String, + event: String, + variant: Variant, +} + +impl EventMetadata { + /// Get the name of the pallet from which the event was emitted. + pub fn pallet(&self) -> &str { + &self.pallet + } + + /// Get the name of the pallet event which was emitted. + pub fn event(&self) -> &str { + &self.event + } +} + #[derive(Clone, Debug)] pub struct StorageMetadata { module_prefix: String, storage_prefix: String, modifier: StorageEntryModifier, - ty: StorageEntryType, + ty: StorageEntryType, default: Vec, } @@ -156,10 +197,10 @@ pub enum InvalidMetadataError { InvalidPrefix, #[error("Invalid version")] InvalidVersion, - #[error("Call type missing from type registry")] - MissingCallType, - #[error("Call type was not a variant/enum type")] - CallTypeNotVariant, + #[error("Type {0} missing from type registry")] + MissingType(u32), + #[error("Type {0} was not a variant/enum type")] + TypeDefNotVariant(u32), } impl TryFrom for Metadata { @@ -173,25 +214,30 @@ impl TryFrom for Metadata { RuntimeMetadata::V14(meta) => meta, _ => return Err(InvalidMetadataError::InvalidVersion.into()), }; + + let get_type_def_variant = |type_id: u32| { + let ty = metadata + .types + .resolve(type_id) + .ok_or(InvalidMetadataError::MissingType(type_id))?; + if let scale_info::TypeDef::Variant(var) = ty.type_def() { + Ok(var) + } else { + Err(InvalidMetadataError::TypeDefNotVariant(type_id)) + } + }; let pallets = metadata .pallets .iter() .map(|pallet| { let calls = pallet.calls.as_ref().map_or(Ok(HashMap::new()), |call| { - let ty = metadata - .types - .resolve(call.ty.id()) - .ok_or(InvalidMetadataError::MissingCallType)?; - if let scale_info::TypeDef::Variant(var) = ty.type_def() { - let calls = var - .variants() - .iter() - .map(|v| (v.name().clone(), v.index())) - .collect(); - Ok(calls) - } else { - Err(InvalidMetadataError::CallTypeNotVariant) - } + let type_def_variant = get_type_def_variant(call.ty.id())?; + let calls = type_def_variant + .variants() + .iter() + .map(|v| (v.name().clone(), v.index())) + .collect(); + Ok(calls) })?; let pallet_metadata = PalletMetadata { @@ -205,6 +251,35 @@ impl TryFrom for Metadata { Ok((pallet.name.to_string(), pallet_metadata)) }) .collect::>()?; - Ok(Self { metadata, pallets }) + let pallet_events = metadata + .pallets + .iter() + .filter_map(|pallet| { + pallet.event.as_ref().map(|event| { + let type_def_variant = get_type_def_variant(event.ty.id())?; + Ok((pallet, type_def_variant)) + }) + }) + .collect::, _>>()?; + + let events = pallet_events + .iter() + .flat_map(|(pallet, type_def_variant)| { + type_def_variant.variants().iter().map(move |var| { + let key = (pallet.index, var.index()); + let value = EventMetadata { + pallet: pallet.name.clone(), + event: var.name().clone(), + variant: var.clone(), + }; + (key, value) + }) + }) + .collect(); + Ok(Self { + metadata, + pallets, + events, + }) } } diff --git a/src/rpc.rs b/src/rpc.rs index daa1b1c40a..fe824a4607 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -682,7 +682,7 @@ impl ExtrinsicSuccess { pub fn find_event_raw(&self, module: &str, variant: &str) -> Option<&RawEvent> { self.events .iter() - .find(|raw| raw.module == module && raw.variant == variant) + .find(|raw| raw.pallet == module && raw.variant == variant) } /// Find the Event for the given module/variant, attempting to decode the event data. diff --git a/src/subscription.rs b/src/subscription.rs index 6dc3da90fd..de525e81ac 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -122,7 +122,7 @@ impl<'a, T: Runtime> EventSubscription<'a, T> { Raw::Error(err) => return Some(Err(err.into())), }; if let Some((module, variant)) = self.event { - if event.module != module || event.variant != variant { + if event.pallet != module || event.variant != variant { continue } } From 4e47acd30ffee231dcd099e2979b6dd8bd791d9b Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 10 Sep 2021 12:31:38 +0100 Subject: [PATCH 038/216] WIP more dynamically decoding events --- src/events.rs | 129 +++++++++++++++++++++++++++++++++++++++++++++--- src/metadata.rs | 21 ++++++-- 2 files changed, 139 insertions(+), 11 deletions(-) diff --git a/src/events.rs b/src/events.rs index 3f976db128..ff5e092b7f 100644 --- a/src/events.rs +++ b/src/events.rs @@ -43,13 +43,17 @@ use std::{ }; use crate::{ - metadata::EventMetadata, + metadata::{ + EventMetadata, + MetadataError, + }, Error, Metadata, Phase, Runtime, RuntimeError, }; +use scale_info::{form::PortableForm, TypeDef, TypeDefPrimitive}; /// Raw bytes for an Event pub struct RawEvent { @@ -143,7 +147,7 @@ where let mut event_data = Vec::::new(); let mut event_errors = Vec::::new(); - let result = self.decode_raw_bytes( + let result = self.decode_raw_event( &event_metadata, input, &mut event_data, @@ -177,14 +181,17 @@ where Ok(r) } - fn decode_raw_bytes( + fn decode_raw_event( &self, - _event_metadata: &EventMetadata, - _input: &mut &[u8], - _output: &mut W, + event_metadata: &EventMetadata, + input: &mut &[u8], + output: &mut Vec, _errors: &mut Vec, ) -> Result<(), Error> { - todo!() + for arg in event_metadata.variant().fields() { + self.decode_type(arg.ty().id(), input, output)? + } + Ok(()) // for arg in args { // match arg { // EventArg::Vec(arg) => { @@ -236,6 +243,114 @@ where // } // Ok(()) } + + fn decode_type( + &self, + type_id: u32, + input: &mut &[u8], + output: &mut Vec, + ) -> Result<(), Error> { + let ty = self.metadata.resolve_type(type_id) + .ok_or(MetadataError::TypeNotFound(type_id))?; + + fn decode_raw( + input: &mut &[u8], + output: &mut Vec, + ) -> Result<(), Error> { + let decoded = T::decode(input)?; + decoded.encode_to(output); + Ok(()) + } + + match ty.type_def() { + TypeDef::Composite(composite) => { + for field in composite.fields() { + self.decode_type(field.ty().id(), input, output)? + } + Ok(()) + } + TypeDef::Variant(variant) => { + // todo: [AJ] handle if variant is DispatchError? + for v in variant.variants() { + for field in v.fields() { + self.decode_type(field.ty().id(), input, output)?; + } + } + Ok(()) + } + TypeDef::Sequence(seq) => { + let len = >::decode(input)?; + len.encode_to(output); + for _ in 0..len.0 { + self.decode_type(seq.type_param().id(), input, output)?; + } + Ok(()) + } + TypeDef::Array(arr) => { + for _ in 0..arr.len() { + self.decode_type(arr.type_param().id(), input, output)?; + } + Ok(()) + } + TypeDef::Tuple(tuple) => { + for field in tuple.fields() { + self.decode_type(field.id(), input, output)?; + } + Ok(()) + } + TypeDef::Primitive(primitive) => { + match primitive { + TypeDefPrimitive::Bool => decode_raw::(input, output), + TypeDefPrimitive::Char => todo!("Err: scale codec not implemented for char"), + TypeDefPrimitive::Str => decode_raw::(input, output), + TypeDefPrimitive::U8 => decode_raw::(input, output), + TypeDefPrimitive::U16 => decode_raw::(input, output), + TypeDefPrimitive::U32 => decode_raw::(input, output), + TypeDefPrimitive::U64 => decode_raw::(input, output), + TypeDefPrimitive::U128 => decode_raw::(input, output), + TypeDefPrimitive::U256 => todo!("Err: U256 currently not supported"), + TypeDefPrimitive::I8 => decode_raw::(input, output), + TypeDefPrimitive::I16 => decode_raw::(input, output), + TypeDefPrimitive::I32 => decode_raw::(input, output), + TypeDefPrimitive::I64 => decode_raw::(input, output), + TypeDefPrimitive::I128 => decode_raw::(input, output), + TypeDefPrimitive::I256 => todo!("Err(I256 currently not supported)"), + } + } + TypeDef::Compact(compact) => { + let inner = self.metadata.resolve_type(type_id) + .ok_or(MetadataError::TypeNotFound(type_id))?; + match inner.type_def() { + TypeDef::Primitive(primitive) => { + match primitive { + TypeDefPrimitive::U8 => decode_raw::>(input, output), + TypeDefPrimitive::U16 => decode_raw::>(input, output), + TypeDefPrimitive::U32 => decode_raw::>(input, output), + TypeDefPrimitive::U64 => decode_raw::>(input, output), + TypeDefPrimitive::U128 => decode_raw::>(input, output), + _ => todo!("Add custom err: Compact only supported for unsigned int primitives"), + } + } + // todo: [AJ] single field struct with primitive?, extract primitive decoding as above + _ => todo!("Add custom err: Compact only supported for unsigned int primitives"), + } + }, + TypeDef::BitSequence(_bitseq) => { + // decode_raw:: + todo!() + }, + } + } + + fn decode_raw( + &self, + input: &mut &[u8], + output: &mut Vec, + ) -> Result<(), Error> { + let decoded = C::decode(input)?; + decoded.encode_to(output); + Ok(()) + } } /// Raw event or error event diff --git a/src/metadata.rs b/src/metadata.rs index 13c8d46887..8e06f0f633 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -49,6 +49,7 @@ use scale_info::{ Form, PortableForm, }, + Type, Variant, }; @@ -56,11 +57,11 @@ use scale_info::{ #[derive(Debug, thiserror::Error)] pub enum MetadataError { /// Module is not in metadata. - #[error("Module {0} not found")] + #[error("Pallet {0} not found")] PalletNotFound(String), - /// Module is not in metadata. - #[error("Module index {0} not found")] - ModuleIndexNotFound(u8), + /// Pallet is not in metadata. + #[error("Pallet index {0} not found")] + PalletIndexNotFound(u8), /// Call is not in metadata. #[error("Call {0} not found")] CallNotFound(&'static str), @@ -85,6 +86,8 @@ pub enum MetadataError { /// Constant is not in metadata. #[error("Constant {0} not found")] ConstantNotFound(&'static str), + #[error("Type {0} missing from type registry")] + TypeNotFound(u32), } /// Runtime metadata. @@ -115,6 +118,11 @@ impl Metadata { .ok_or(MetadataError::EventNotFound(pallet_index, event_index))?; Ok(event) } + + /// Resolve a type definition. + pub fn resolve_type(&self, id: u32) -> Option<&Type> { + self.metadata.types.resolve(id) + } } #[derive(Clone, Debug)] @@ -174,6 +182,11 @@ impl EventMetadata { pub fn event(&self) -> &str { &self.event } + + /// Get the type def variant for the pallet event. + pub fn variant(&self) -> &Variant { + &self.variant + } } #[derive(Clone, Debug)] From 7e2ed947e4bbda559b14996291a8dde1126edd65 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 10 Sep 2021 12:33:19 +0100 Subject: [PATCH 039/216] Fmt --- src/events.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/events.rs b/src/events.rs index ff5e092b7f..c177b4f8c8 100644 --- a/src/events.rs +++ b/src/events.rs @@ -53,7 +53,11 @@ use crate::{ Runtime, RuntimeError, }; -use scale_info::{form::PortableForm, TypeDef, TypeDefPrimitive}; +use scale_info::{ + form::PortableForm, + TypeDef, + TypeDefPrimitive, +}; /// Raw bytes for an Event pub struct RawEvent { @@ -250,7 +254,9 @@ where input: &mut &[u8], output: &mut Vec, ) -> Result<(), Error> { - let ty = self.metadata.resolve_type(type_id) + let ty = self + .metadata + .resolve_type(type_id) .ok_or(MetadataError::TypeNotFound(type_id))?; fn decode_raw( @@ -301,7 +307,9 @@ where TypeDef::Primitive(primitive) => { match primitive { TypeDefPrimitive::Bool => decode_raw::(input, output), - TypeDefPrimitive::Char => todo!("Err: scale codec not implemented for char"), + TypeDefPrimitive::Char => { + todo!("Err: scale codec not implemented for char") + } TypeDefPrimitive::Str => decode_raw::(input, output), TypeDefPrimitive::U8 => decode_raw::(input, output), TypeDefPrimitive::U16 => decode_raw::(input, output), @@ -318,7 +326,9 @@ where } } TypeDef::Compact(compact) => { - let inner = self.metadata.resolve_type(type_id) + let inner = self + .metadata + .resolve_type(type_id) .ok_or(MetadataError::TypeNotFound(type_id))?; match inner.type_def() { TypeDef::Primitive(primitive) => { @@ -334,11 +344,11 @@ where // todo: [AJ] single field struct with primitive?, extract primitive decoding as above _ => todo!("Add custom err: Compact only supported for unsigned int primitives"), } - }, + } TypeDef::BitSequence(_bitseq) => { // decode_raw:: todo!() - }, + } } } From a2bb550b366049c87bfb457367243d079f1cf678 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 10 Sep 2021 17:44:39 +0100 Subject: [PATCH 040/216] Decode events, handle errors --- src/error.rs | 19 +++++++------ src/events.rs | 66 ++++++------------------------------------- src/metadata.rs | 74 ++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 89 insertions(+), 70 deletions(-) diff --git a/src/error.rs b/src/error.rs index b19ca1e635..e68c6267fd 100644 --- a/src/error.rs +++ b/src/error.rs @@ -123,13 +123,12 @@ impl RuntimeError { error, message: _, } => { - todo!() - // let module = metadata.module_with_errors(index)?; - // let error = module.error(error)?; - // Ok(Self::Module(ModuleError { - // module: module.name().to_string(), - // error: error.to_string(), - // })) + let error = metadata.error(index, error)?; + Ok(Self::Module(ModuleError { + pallet: error.pallet().to_string(), + error: error.error().to_string(), + description: error.description().to_vec(), + })) } DispatchError::BadOrigin => Ok(Self::BadOrigin), DispatchError::CannotLookup => Ok(Self::CannotLookup), @@ -144,10 +143,12 @@ impl RuntimeError { /// Module error. #[derive(Clone, Debug, Eq, Error, PartialEq)] -#[error("{error} from {module}")] +#[error("{error} from {pallet}")] pub struct ModuleError { /// The module where the error originated. - pub module: String, + pub pallet: String, /// The actual error code. pub error: String, + /// The error description. + pub description: Vec, } diff --git a/src/events.rs b/src/events.rs index c177b4f8c8..4cfa461931 100644 --- a/src/events.rs +++ b/src/events.rs @@ -23,10 +23,6 @@ use codec::{ Output, }; use dyn_clone::DynClone; -use sp_runtime::{ - DispatchError, - DispatchResult, -}; use std::{ collections::{ hash_map::{ @@ -190,62 +186,18 @@ where event_metadata: &EventMetadata, input: &mut &[u8], output: &mut Vec, - _errors: &mut Vec, + errors: &mut Vec, ) -> Result<(), Error> { for arg in event_metadata.variant().fields() { - self.decode_type(arg.ty().id(), input, output)? + if event_metadata.pallet() == "System" && event_metadata.event() == "ExtrinsicFailed" { + let dispatch_error = sp_runtime::DispatchError::decode(input)?; + let runtime_error = RuntimeError::from_dispatch(&self.metadata, dispatch_error)?; + errors.push(runtime_error) + } else { + self.decode_type(arg.ty().id(), input, output)? + } } Ok(()) - // for arg in args { - // match arg { - // EventArg::Vec(arg) => { - // let len = >::decode(input)?; - // len.encode_to(output); - // for _ in 0..len.0 { - // self.decode_raw_bytes(&[*arg.clone()], input, output, errors)? - // } - // } - // EventArg::Option(arg) => { - // match input.read_byte()? { - // 0 => output.push_byte(0), - // 1 => { - // output.push_byte(1); - // self.decode_raw_bytes(&[*arg.clone()], input, output, errors)? - // } - // _ => { - // return Err(Error::Other( - // "unexpected first byte decoding Option".into(), - // )) - // } - // } - // } - // EventArg::Tuple(args) => { - // self.decode_raw_bytes(args, input, output, errors)? - // } - // EventArg::Primitive(name) => { - // let result = match name.as_str() { - // "DispatchResult" => DispatchResult::decode(input)?, - // "DispatchError" => Err(DispatchError::decode(input)?), - // _ => { - // if let Some(seg) = self.event_type_registry.resolve(name) { - // let mut buf = Vec::::new(); - // seg.segment(input, &mut buf)?; - // output.write(&buf); - // Ok(()) - // } else { - // return Err(Error::TypeSizeUnavailable(name.to_owned())) - // } - // } - // }; - // if let Err(error) = result { - // // since the input may contain any number of args we propagate - // // runtime errors to the caller for handling - // errors.push(RuntimeError::from_dispatch(&self.metadata, error)?); - // } - // } - // } - // } - // Ok(()) } fn decode_type( @@ -347,7 +299,7 @@ where } TypeDef::BitSequence(_bitseq) => { // decode_raw:: - todo!() + todo!("BitVec") } } } diff --git a/src/metadata.rs b/src/metadata.rs index 8e06f0f633..5dab356903 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -69,8 +69,8 @@ pub enum MetadataError { #[error("Pallet {0}, Event {0} not found")] EventNotFound(u8, u8), /// Event is not in metadata. - #[error("Error {0} not found")] - ErrorNotFound(u8), + #[error("Pallet {0}, Error {0} not found")] + ErrorNotFound(u8, u8), /// Storage is not in metadata. #[error("Storage {0} not found")] StorageNotFound(&'static str), @@ -96,6 +96,7 @@ pub struct Metadata { metadata: RuntimeMetadataLastVersion, pallets: HashMap, events: HashMap<(u8, u8), EventMetadata>, + errors: HashMap<(u8, u8), ErrorMetadata>, } impl Metadata { @@ -106,7 +107,7 @@ impl Metadata { .ok_or(MetadataError::PalletNotFound(name.to_string())) } - /// Returns the variant for the event at the given pallet and event indices. + /// Returns the metadata for the event at the given pallet and event indices. pub fn event( &self, pallet_index: u8, @@ -119,6 +120,19 @@ impl Metadata { Ok(event) } + /// Returns the metadata for the error at the given pallet and error indices. + pub fn error( + &self, + pallet_index: u8, + error_index: u8, + ) -> Result<&ErrorMetadata, MetadataError> { + let error = self + .errors + .get(&(pallet_index, error_index)) + .ok_or(MetadataError::ErrorNotFound(pallet_index, error_index))?; + Ok(error) + } + /// Resolve a type definition. pub fn resolve_type(&self, id: u32) -> Option<&Type> { self.metadata.types.resolve(id) @@ -189,6 +203,31 @@ impl EventMetadata { } } +#[derive(Clone, Debug)] +pub struct ErrorMetadata { + pallet: String, + error: String, + variant: Variant, +} + +impl ErrorMetadata { + /// Get the name of the pallet from which the error originates. + pub fn pallet(&self) -> &str { + &self.pallet + } + + /// Get the name of the specific pallet error. + pub fn error(&self) -> &str { + &self.error + } + + /// Get the description of the specific pallet error. + pub fn description(&self) -> &[String] { + self.variant.docs() + } +} + + #[derive(Clone, Debug)] pub struct StorageMetadata { module_prefix: String, @@ -264,6 +303,7 @@ impl TryFrom for Metadata { Ok((pallet.name.to_string(), pallet_metadata)) }) .collect::>()?; + let pallet_events = metadata .pallets .iter() @@ -274,7 +314,6 @@ impl TryFrom for Metadata { }) }) .collect::, _>>()?; - let events = pallet_events .iter() .flat_map(|(pallet, type_def_variant)| { @@ -289,10 +328,37 @@ impl TryFrom for Metadata { }) }) .collect(); + + let pallet_errors = metadata + .pallets + .iter() + .filter_map(|pallet| { + pallet.error.as_ref().map(|error| { + let type_def_variant = get_type_def_variant(error.ty.id())?; + Ok((pallet, type_def_variant)) + }) + }) + .collect::, _>>()?; + let errors = pallet_errors + .iter() + .flat_map(|(pallet, type_def_variant)| { + type_def_variant.variants().iter().map(move |var| { + let key = (pallet.index, var.index()); + let value = ErrorMetadata { + pallet: pallet.name.clone(), + error: var.name().clone(), + variant: var.clone(), + }; + (key, value) + }) + }) + .collect(); + Ok(Self { metadata, pallets, events, + errors, }) } } From 0b233e0a64f7f85c20cc43a7fa88e81a0d742b02 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 10:26:27 +0100 Subject: [PATCH 041/216] Uncomment some tests --- tests/src/lib.rs | 69 ++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 41 deletions(-) diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 9289a02503..5356889343 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -135,34 +135,21 @@ async fn test_tx_transfer_balance() { ) .await .unwrap(); +} - // check that nonce is handled correctly - // signer.increment_nonce(); - // client - // .submit( - // Transfer { - // dest, - // value: 10_000, - // }, - // &signer, - // ) - // .await - // .unwrap(); +#[async_std::test] +async fn test_getting_hash() { + let node_process = test_node_process().await; + node_process.client().block_hash(None).await.unwrap(); } -// #[async_std::test] -// async fn test_getting_hash() { -// let node_process = test_node_process().await; -// node_process.client().block_hash(None).await.unwrap(); -// } -// -// #[async_std::test] -// async fn test_getting_block() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let block_hash = client.block_hash(None).await.unwrap(); -// client.block(block_hash).await.unwrap(); -// } +#[async_std::test] +async fn test_getting_block() { + let node_process = test_node_process().await; + let client = node_process.client(); + let block_hash = client.block_hash(None).await.unwrap(); + client.block(block_hash).await.unwrap(); +} // // #[async_std::test] // async fn test_getting_read_proof() { @@ -180,22 +167,22 @@ async fn test_tx_transfer_balance() { // .await // .unwrap(); // } -// -// #[async_std::test] -// async fn test_chain_subscribe_blocks() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let mut blocks = client.subscribe_blocks().await.unwrap(); -// blocks.next().await.unwrap(); -// } -// -// #[async_std::test] -// async fn test_chain_subscribe_finalized_blocks() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); -// blocks.next().await.unwrap(); -// } + +#[async_std::test] +async fn test_chain_subscribe_blocks() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut blocks = client.subscribe_blocks().await.unwrap(); + blocks.next().await.unwrap(); +} + +#[async_std::test] +async fn test_chain_subscribe_finalized_blocks() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); + blocks.next().await.unwrap(); +} // // #[async_std::test] // async fn test_fetch_keys() { From 09c58889b2f04f83717988128ec73a71e79c3ea7 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 10:28:36 +0100 Subject: [PATCH 042/216] Remove unused get_mod function --- proc-macro/src/generate_types.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index 3f01f6f4c1..ea9181d7be 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -220,18 +220,6 @@ impl<'a> Module<'a> { } } - /// Returns the module with the given path, if any. - pub fn get_mod(&'a self, path_segs: &[&'static str]) -> Option<&'a Module<'a>> { - let (mod_name, rest) = path_segs.split_first()?; - let mod_ident = Ident::new(mod_name, Span::call_site()); - let module = self.children.get(&mod_ident)?; - if rest.is_empty() { - Some(module) - } else { - module.get_mod(rest) - } - } - /// Returns the module ident. pub fn ident(&self) -> &Ident { &self.name From 93c121d8bdfa3dcd9e602ae6f480d70f40bab49f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 10:32:16 +0100 Subject: [PATCH 043/216] Fix some warnings --- src/lib.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index cdbd380707..6f58cb282e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,11 +40,9 @@ )] #![allow(clippy::type_complexity)] -#[macro_use] -extern crate subxt_proc_macro; - pub use sp_core; pub use sp_runtime; +pub use subxt_proc_macro::subxt; use codec::{ Codec, @@ -53,11 +51,7 @@ use codec::{ EncodeLike, }; use serde::de::DeserializeOwned; -use std::{ - fmt::Debug, - marker::PhantomData, - sync::Arc, -}; +use std::fmt::Debug; mod client; mod error; @@ -67,10 +61,6 @@ mod metadata; mod rpc; mod subscription; -use crate::rpc::{ - ChainBlock, - Rpc, -}; pub use crate::{ client::{ Client, @@ -106,7 +96,6 @@ pub use crate::{ }, }; pub use frame_metadata::StorageHasher; -pub use subxt_proc_macro::subxt; use sp_runtime::traits::{ AtLeast32Bit, From a50391148813e83b36ece8c165b228fd10822ac0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 10:34:52 +0100 Subject: [PATCH 044/216] Fix some more warnings --- src/client.rs | 2 -- src/events.rs | 19 ------------------- tests/src/lib.rs | 2 +- 3 files changed, 1 insertion(+), 22 deletions(-) diff --git a/src/client.rs b/src/client.rs index 0d9e37981b..5bd66165b8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -71,7 +71,6 @@ pub struct ClientBuilder { url: Option, client: Option, page_size: Option, - skip_type_sizes_check: bool, accept_weak_inclusion: bool, } @@ -82,7 +81,6 @@ impl ClientBuilder { url: None, client: None, page_size: None, - skip_type_sizes_check: false, accept_weak_inclusion: false, } } diff --git a/src/events.rs b/src/events.rs index 4cfa461931..c8c8ecf3ab 100644 --- a/src/events.rs +++ b/src/events.rs @@ -20,18 +20,9 @@ use codec::{ Decode, Encode, Input, - Output, }; use dyn_clone::DynClone; use std::{ - collections::{ - hash_map::{ - Entry, - HashMap, - }, - HashSet, - }, - fmt, marker::{ PhantomData, Send, @@ -303,16 +294,6 @@ where } } } - - fn decode_raw( - &self, - input: &mut &[u8], - output: &mut Vec, - ) -> Result<(), Error> { - let decoded = C::decode(input)?; - decoded.encode_to(output); - Ok(()) - } } /// Raw event or error event diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 5356889343..61cff134f0 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -120,7 +120,7 @@ pub(crate) async fn test_node_process() -> TestNodeProcess { async fn test_tx_transfer_balance() { use crate::node_runtime::balances::calls::Transfer; - let mut signer = PairSigner::new(AccountKeyring::Alice.pair()); + let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); let node_process = test_node_process().await; From b362dfd70dbfbdc4d52ca029b5cef8d334a9a51c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 10:57:09 +0100 Subject: [PATCH 045/216] Fix some more warnings --- src/events.rs | 3 +-- src/metadata.rs | 8 +------- src/rpc.rs | 5 +---- tests/src/lib.rs | 6 +++--- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/events.rs b/src/events.rs index c8c8ecf3ab..cfb19992b1 100644 --- a/src/events.rs +++ b/src/events.rs @@ -41,7 +41,6 @@ use crate::{ RuntimeError, }; use scale_info::{ - form::PortableForm, TypeDef, TypeDefPrimitive, }; @@ -268,7 +267,7 @@ where TypeDefPrimitive::I256 => todo!("Err(I256 currently not supported)"), } } - TypeDef::Compact(compact) => { + TypeDef::Compact(_compact) => { let inner = self .metadata .resolve_type(type_id) diff --git a/src/metadata.rs b/src/metadata.rs index 5dab356903..8526d6e29d 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -17,28 +17,23 @@ use std::{ collections::HashMap, convert::TryFrom, - marker::PhantomData, - str::FromStr, }; use codec::{ Decode, - Encode, Error as CodecError, }; use frame_metadata::{ PalletConstantMetadata, - PalletEventMetadata, RuntimeMetadata, RuntimeMetadataLastVersion, RuntimeMetadataPrefixed, StorageEntryModifier, StorageEntryType, - StorageHasher, META_RESERVED, }; -use sp_core::storage::StorageKey; + use crate::{ Call, @@ -46,7 +41,6 @@ use crate::{ }; use scale_info::{ form::{ - Form, PortableForm, }, Type, diff --git a/src/rpc.rs b/src/rpc.rs index fe824a4607..43b02f4988 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -150,10 +150,7 @@ pub enum TransactionStatus { Invalid, } -use crate::metadata::{ - InvalidMetadataError, - MetadataError, -}; + #[cfg(feature = "client")] use substrate_subxt_client::SubxtClient; diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 61cff134f0..dbf195d1d6 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -45,7 +45,7 @@ mod node_runtime { } #[derive(Clone, Debug, Eq, PartialEq)] -struct TestRuntime; +pub struct TestRuntime; impl Runtime for TestRuntime { type Index = u32; @@ -74,7 +74,7 @@ impl subxt::AccountData for node_runtime::system::storage::Account /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; -pub(crate) async fn test_node_process_with( +pub async fn test_node_process_with( key: AccountKeyring, ) -> TestNodeProcess { let path = std::env::var("SUBSTRATE_NODE_PATH").unwrap_or_else(|_| { @@ -93,7 +93,7 @@ pub(crate) async fn test_node_process_with( proc.unwrap() } -pub(crate) async fn test_node_process() -> TestNodeProcess { +pub async fn test_node_process() -> TestNodeProcess { test_node_process_with(AccountKeyring::Alice).await } From 8357031e502bd2090903eb0f64101cf52e99521d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 11:00:50 +0100 Subject: [PATCH 046/216] Add tests mod --- tests/src/node-runtime/mod.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/src/node-runtime/mod.rs diff --git a/tests/src/node-runtime/mod.rs b/tests/src/node-runtime/mod.rs new file mode 100644 index 0000000000..8c7ba44c39 --- /dev/null +++ b/tests/src/node-runtime/mod.rs @@ -0,0 +1,17 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +mod balances; \ No newline at end of file From e5333f176864751ff2904d76a02e99eda00fd06f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 17:41:03 +0100 Subject: [PATCH 047/216] Rename node-runtime tests mod to frame --- tests/src/frame/balances.rs | 184 ++++++++++ .../src/{node-runtime => frame}/contracts.rs | 0 tests/src/{node-runtime => frame}/mod.rs | 2 +- tests/src/{node-runtime => frame}/session.rs | 0 tests/src/{node-runtime => frame}/staking.rs | 0 tests/src/{node-runtime => frame}/sudo.rs | 0 tests/src/{node-runtime => frame}/system.rs | 0 tests/src/lib.rs | 7 +- tests/src/node-runtime/balances.rs | 317 ------------------ 9 files changed, 187 insertions(+), 323 deletions(-) create mode 100644 tests/src/frame/balances.rs rename tests/src/{node-runtime => frame}/contracts.rs (100%) rename tests/src/{node-runtime => frame}/mod.rs (98%) rename tests/src/{node-runtime => frame}/session.rs (100%) rename tests/src/{node-runtime => frame}/staking.rs (100%) rename tests/src/{node-runtime => frame}/sudo.rs (100%) rename tests/src/{node-runtime => frame}/system.rs (100%) delete mode 100644 tests/src/node-runtime/balances.rs diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs new file mode 100644 index 0000000000..ca78c99f4d --- /dev/null +++ b/tests/src/frame/balances.rs @@ -0,0 +1,184 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +//! Implements support for the pallet_balances module. + +use crate::{test_node_process, TestRuntime, node_runtime}; +use codec::{ + Decode, + Encode, +}; +use core::marker::PhantomData; +use sp_runtime::traits::{ + AtLeast32Bit, + MaybeSerialize, + Member, +}; +use std::fmt::Debug; + +use subxt::{ + Error, + ModuleError, + RuntimeError, + extrinsic::{ + PairSigner, + Signer, + }, + EventSubscription, +}; +use sp_core::{ + sr25519::Pair, + Pair as _, +}; +use sp_keyring::AccountKeyring; + +#[async_std::test] +async fn test_basic_transfer() { + env_logger::try_init().ok(); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let bob_address = bob.account_id().clone().into(); + let test_node_proc = test_node_process().await; + let client = test_node_proc.client(); + + let alice_pre = client.account(alice.account_id(), None).await.unwrap(); + let bob_pre = client.account(bob.account_id(), None).await.unwrap(); + + let event = client + .transfer_and_watch(&alice, &bob_address, 10_000) + .await + .expect("sending an xt works") + .transfer() + .unwrap() + .unwrap(); + let expected_event = TransferEvent { + from: alice.account_id().clone(), + to: bob.account_id().clone(), + amount: 10_000, + }; + assert_eq!(event, expected_event); + + let alice_post = client.account(alice.account_id(), None).await.unwrap(); + let bob_post = client.account(bob.account_id(), None).await.unwrap(); + + assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); + assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); +} + +// #[async_std::test] +// async fn test_state_total_issuance() { +// env_logger::try_init().ok(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let total_issuance = client.total_issuance(None).await.unwrap(); +// assert_ne!(total_issuance, 0); +// } +// +// #[async_std::test] +// async fn test_state_read_free_balance() { +// env_logger::try_init().ok(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let account = AccountKeyring::Alice.to_account_id(); +// let info = client.account(&account, None).await.unwrap(); +// assert_ne!(info.data.free, 0); +// } +// +// #[async_std::test] +// async fn test_state_balance_lock() -> Result<(), crate::Error> { +// +// env_logger::try_init().ok(); +// let bob = PairSigner::::new(AccountKeyring::Bob.pair()); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// +// client +// .bond_and_watch( +// &bob, +// &AccountKeyring::Charlie.to_account_id().into(), +// 100_000_000_000_000, +// RewardDestination::Stash, +// ) +// .await?; +// +// let locks = client +// .locks(&AccountKeyring::Bob.to_account_id(), None) +// .await?; +// +// assert_eq!( +// locks, +// vec![BalanceLock { +// id: *b"staking ", +// amount: 100_000_000_000_000, +// reasons: Reasons::All, +// }] +// ); +// +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_transfer_error() { +// env_logger::try_init().ok(); +// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +// let alice_addr = alice.account_id().clone().into(); +// let hans = PairSigner::::new(Pair::generate().0); +// let hans_address = hans.account_id().clone().into(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// client +// .transfer_and_watch(&alice, &hans_address, 100_000_000_000_000_000) +// .await +// .unwrap(); +// let res = client +// .transfer_and_watch(&hans, &alice_addr, 100_000_000_000_000_000) +// .await; +// +// if let Err(Error::Runtime(RuntimeError::Module(error))) = res { +// let error2 = ModuleError { +// module: "Balances".into(), +// error: "InsufficientBalance".into(), +// }; +// assert_eq!(error, error2); +// } else { +// panic!("expected an error"); +// } +// } +// +// #[async_std::test] +// async fn test_transfer_subscription() { +// env_logger::try_init().ok(); +// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +// let bob = AccountKeyring::Bob.to_account_id(); +// let bob_addr = bob.clone().into(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let sub = client.subscribe_events().await.unwrap(); +// let decoder = client.events_decoder(); +// let mut sub = EventSubscription::::new(sub, &decoder); +// sub.filter_event::>(); +// client.transfer(&alice, &bob_addr, 10_000).await.unwrap(); +// let raw = sub.next().await.unwrap().unwrap(); +// let event = TransferEvent::::decode(&mut &raw.data[..]).unwrap(); +// assert_eq!( +// event, +// TransferEvent { +// from: alice.account_id().clone(), +// to: bob.clone(), +// amount: 10_000, +// } +// ); +// } diff --git a/tests/src/node-runtime/contracts.rs b/tests/src/frame/contracts.rs similarity index 100% rename from tests/src/node-runtime/contracts.rs rename to tests/src/frame/contracts.rs diff --git a/tests/src/node-runtime/mod.rs b/tests/src/frame/mod.rs similarity index 98% rename from tests/src/node-runtime/mod.rs rename to tests/src/frame/mod.rs index 8c7ba44c39..b50f09b98b 100644 --- a/tests/src/node-runtime/mod.rs +++ b/tests/src/frame/mod.rs @@ -14,4 +14,4 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -mod balances; \ No newline at end of file +mod balances; diff --git a/tests/src/node-runtime/session.rs b/tests/src/frame/session.rs similarity index 100% rename from tests/src/node-runtime/session.rs rename to tests/src/frame/session.rs diff --git a/tests/src/node-runtime/staking.rs b/tests/src/frame/staking.rs similarity index 100% rename from tests/src/node-runtime/staking.rs rename to tests/src/frame/staking.rs diff --git a/tests/src/node-runtime/sudo.rs b/tests/src/frame/sudo.rs similarity index 100% rename from tests/src/node-runtime/sudo.rs rename to tests/src/frame/sudo.rs diff --git a/tests/src/node-runtime/system.rs b/tests/src/frame/system.rs similarity index 100% rename from tests/src/node-runtime/system.rs rename to tests/src/frame/system.rs diff --git a/tests/src/lib.rs b/tests/src/lib.rs index dbf195d1d6..8a03c75e37 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . +mod frame; mod node_proc; pub use node_proc::TestNodeProcess; @@ -74,9 +75,7 @@ impl subxt::AccountData for node_runtime::system::storage::Account /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; -pub async fn test_node_process_with( - key: AccountKeyring, -) -> TestNodeProcess { +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. \ @@ -150,7 +149,6 @@ async fn test_getting_block() { let block_hash = client.block_hash(None).await.unwrap(); client.block(block_hash).await.unwrap(); } -// // #[async_std::test] // async fn test_getting_read_proof() { // let node_process = test_node_process().await; @@ -183,7 +181,6 @@ async fn test_chain_subscribe_finalized_blocks() { let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); blocks.next().await.unwrap(); } -// // #[async_std::test] // async fn test_fetch_keys() { // let node_process = test_node_process().await; diff --git a/tests/src/node-runtime/balances.rs b/tests/src/node-runtime/balances.rs deleted file mode 100644 index f88102a81f..0000000000 --- a/tests/src/node-runtime/balances.rs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -//! Implements support for the pallet_balances module. - -use crate::frame::system::System; -use codec::{ - Decode, - Encode, -}; -use core::marker::PhantomData; -use frame_support::{ - traits::LockIdentifier, - Parameter, -}; -use sp_runtime::traits::{ - AtLeast32Bit, - MaybeSerialize, - Member, -}; -use std::fmt::Debug; - -/// The subset of the `pallet_balances::Trait` that a client must implement. -#[module] -pub trait Balances: System { - /// The balance of an account. - type Balance: Parameter - + Member - + AtLeast32Bit - + codec::Codec - + Default - + Copy - + MaybeSerialize - + Debug - + From<::BlockNumber>; -} - -/// All balance information for an account. -#[derive(Clone, Debug, Eq, PartialEq, Default, Decode, Encode)] -pub struct AccountData { - /// Non-reserved part of the balance. There may still be restrictions on this, but it is the - /// total pool what may in principle be transferred, reserved and used for tipping. - /// - /// This is the only balance that matters in terms of most operations on tokens. It - /// alone is used to determine the balance when in the contract execution environment. - pub free: Balance, - /// Balance which is reserved and may not be used at all. - /// - /// This can still get slashed, but gets slashed last of all. - /// - /// This balance is a 'reserve' balance that other subsystems use in order to set aside tokens - /// that are still 'owned' by the account holder, but which are suspendable. - pub reserved: Balance, - /// The amount that `free` may not drop below when withdrawing for *anything except transaction - /// fee payment*. - pub misc_frozen: Balance, - /// The amount that `free` may not drop below when withdrawing specifically for transaction - /// fee payment. - pub fee_frozen: Balance, -} - -/// The total issuance of the balances module. -#[derive(Clone, Debug, Eq, PartialEq, Store, Encode)] -pub struct TotalIssuanceStore { - #[store(returns = T::Balance)] - /// Runtime marker. - pub _runtime: PhantomData, -} - -/// The locks of the balances module. -#[derive(Clone, Debug, Eq, PartialEq, Store, Encode, Decode)] -pub struct LocksStore<'a, T: Balances> { - #[store(returns = Vec>)] - /// Account to retrieve the balance locks for. - pub account_id: &'a T::AccountId, -} - -/// A single lock on a balance. There can be many of these on an account and they "overlap", so the -/// same balance is frozen by multiple locks. -#[derive(Clone, PartialEq, Eq, Encode, Decode)] -pub struct BalanceLock { - /// An identifier for this lock. Only one lock may be in existence for each identifier. - pub id: LockIdentifier, - /// The amount which the free balance may not drop below when this lock is in effect. - pub amount: Balance, - /// If true, then the lock remains in effect even for payment of transaction fees. - pub reasons: Reasons, -} - -impl Debug for BalanceLock { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - f.debug_struct("BalanceLock") - .field("id", &String::from_utf8_lossy(&self.id)) - .field("amount", &self.amount) - .field("reasons", &self.reasons) - .finish() - } -} - -/// Simplified reasons for withdrawing balance. -#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, Debug)] -pub enum Reasons { - /// Paying system transaction fees. - Fee, - /// Any reason other than paying system transaction fees. - Misc, - /// Any reason at all. - All, -} - -/// Transfer some liquid free balance to another account. -/// -/// `transfer` will set the `FreeBalance` of the sender and receiver. -/// It will decrease the total issuance of the system by the `TransferFee`. -/// If the sender's account is below the existential deposit as a result -/// of the transfer, the account will be reaped. -#[derive(Clone, Debug, PartialEq, Call, Encode)] -pub struct TransferCall<'a, T: Balances> { - /// Destination of the transfer. - pub to: &'a ::Address, - /// Amount to transfer. - #[codec(compact)] - pub amount: T::Balance, -} - -/// Transfer event. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct TransferEvent { - /// Account balance was transfered from. - pub from: ::AccountId, - /// Account balance was transfered to. - pub to: ::AccountId, - /// Amount of balance that was transfered. - pub amount: T::Balance, -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::{ - error::{ - Error, - ModuleError, - RuntimeError, - }, - extrinsic::{ - PairSigner, - Signer, - }, - subscription::EventSubscription, - system::AccountStoreExt, - tests::{ - test_node_process, - TestRuntime, - }, - }; - use sp_core::{ - sr25519::Pair, - Pair as _, - }; - use sp_keyring::AccountKeyring; - - #[async_std::test] - async fn test_basic_transfer() { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); - let bob_address = bob.account_id().clone().into(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - - let alice_pre = client.account(alice.account_id(), None).await.unwrap(); - let bob_pre = client.account(bob.account_id(), None).await.unwrap(); - - let event = client - .transfer_and_watch(&alice, &bob_address, 10_000) - .await - .expect("sending an xt works") - .transfer() - .unwrap() - .unwrap(); - let expected_event = TransferEvent { - from: alice.account_id().clone(), - to: bob.account_id().clone(), - amount: 10_000, - }; - assert_eq!(event, expected_event); - - let alice_post = client.account(alice.account_id(), None).await.unwrap(); - let bob_post = client.account(bob.account_id(), None).await.unwrap(); - - assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); - assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); - } - - #[async_std::test] - async fn test_state_total_issuance() { - env_logger::try_init().ok(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let total_issuance = client.total_issuance(None).await.unwrap(); - assert_ne!(total_issuance, 0); - } - - #[async_std::test] - async fn test_state_read_free_balance() { - env_logger::try_init().ok(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let account = AccountKeyring::Alice.to_account_id(); - let info = client.account(&account, None).await.unwrap(); - assert_ne!(info.data.free, 0); - } - - #[async_std::test] - async fn test_state_balance_lock() -> Result<(), crate::Error> { - use crate::frame::staking::{ - BondCallExt, - RewardDestination, - }; - - env_logger::try_init().ok(); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - - client - .bond_and_watch( - &bob, - &AccountKeyring::Charlie.to_account_id().into(), - 100_000_000_000_000, - RewardDestination::Stash, - ) - .await?; - - let locks = client - .locks(&AccountKeyring::Bob.to_account_id(), None) - .await?; - - assert_eq!( - locks, - vec![BalanceLock { - id: *b"staking ", - amount: 100_000_000_000_000, - reasons: Reasons::All, - }] - ); - - Ok(()) - } - - #[async_std::test] - async fn test_transfer_error() { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let alice_addr = alice.account_id().clone().into(); - let hans = PairSigner::::new(Pair::generate().0); - let hans_address = hans.account_id().clone().into(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - client - .transfer_and_watch(&alice, &hans_address, 100_000_000_000_000_000) - .await - .unwrap(); - let res = client - .transfer_and_watch(&hans, &alice_addr, 100_000_000_000_000_000) - .await; - - if let Err(Error::Runtime(RuntimeError::Module(error))) = res { - let error2 = ModuleError { - module: "Balances".into(), - error: "InsufficientBalance".into(), - }; - assert_eq!(error, error2); - } else { - panic!("expected an error"); - } - } - - #[async_std::test] - async fn test_transfer_subscription() { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id(); - let bob_addr = bob.clone().into(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let sub = client.subscribe_events().await.unwrap(); - let decoder = client.events_decoder(); - let mut sub = EventSubscription::::new(sub, &decoder); - sub.filter_event::>(); - client.transfer(&alice, &bob_addr, 10_000).await.unwrap(); - let raw = sub.next().await.unwrap().unwrap(); - let event = TransferEvent::::decode(&mut &raw.data[..]).unwrap(); - assert_eq!( - event, - TransferEvent { - from: alice.account_id().clone(), - to: bob.clone(), - amount: 10_000, - } - ); - } -} From 5405fb705e2d8316e54821909b3f89a7500efd40 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 17:42:07 +0100 Subject: [PATCH 048/216] Fix some warnings --- src/metadata.rs | 6 +----- src/rpc.rs | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/metadata.rs b/src/metadata.rs index 8526d6e29d..1546cc5ef4 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -34,15 +34,12 @@ use frame_metadata::{ META_RESERVED, }; - use crate::{ Call, Encoded, }; use scale_info::{ - form::{ - PortableForm, - }, + form::PortableForm, Type, Variant, }; @@ -221,7 +218,6 @@ impl ErrorMetadata { } } - #[derive(Clone, Debug)] pub struct StorageMetadata { module_prefix: String, diff --git a/src/rpc.rs b/src/rpc.rs index 43b02f4988..d1562ab118 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -150,7 +150,6 @@ pub enum TransactionStatus { Invalid, } - #[cfg(feature = "client")] use substrate_subxt_client::SubxtClient; From 1034b681cfd3d14be287dec345c3f6c68342c73a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 17:42:42 +0100 Subject: [PATCH 049/216] Fmt --- src/events.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/events.rs b/src/events.rs index cfb19992b1..431b25fefc 100644 --- a/src/events.rs +++ b/src/events.rs @@ -22,11 +22,9 @@ use codec::{ Input, }; use dyn_clone::DynClone; -use std::{ - marker::{ - PhantomData, - Send, - }, +use std::marker::{ + PhantomData, + Send, }; use crate::{ @@ -179,9 +177,12 @@ where errors: &mut Vec, ) -> Result<(), Error> { for arg in event_metadata.variant().fields() { - if event_metadata.pallet() == "System" && event_metadata.event() == "ExtrinsicFailed" { + if event_metadata.pallet() == "System" + && event_metadata.event() == "ExtrinsicFailed" + { let dispatch_error = sp_runtime::DispatchError::decode(input)?; - let runtime_error = RuntimeError::from_dispatch(&self.metadata, dispatch_error)?; + let runtime_error = + RuntimeError::from_dispatch(&self.metadata, dispatch_error)?; errors.push(runtime_error) } else { self.decode_type(arg.ty().id(), input, output)? From 8556bc0e9bd8a20cf55ae786b986f6f18441e92d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 17:50:45 +0100 Subject: [PATCH 050/216] WIP generate storage client with getters --- proc-macro/src/generate_runtime.rs | 137 +++++++++++++++++++++-------- proc-macro/src/generate_types.rs | 6 +- 2 files changed, 101 insertions(+), 42 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 6a36c9cbb1..fcf1acf2b9 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -28,6 +28,7 @@ use frame_metadata::{ RuntimeMetadata, RuntimeMetadataPrefixed, StorageEntryMetadata, + StorageEntryModifier, StorageEntryType, StorageHasher, }; @@ -128,22 +129,17 @@ impl RuntimeGenerator { quote!() }; - let storage = if let Some(ref storage) = pallet.storage { - let storage_types = storage + let (storage_structs, storage_fns) = if let Some(ref storage) = pallet.storage { + let (storage_structs, storage_fns) = storage .entries .iter() .map(|entry| { - self.generate_storage_entry_types(&type_gen, &pallet, entry) + self.generate_storage_entry_fns(&type_gen, &pallet, entry) }) - .collect::>(); - quote! { - pub mod storage { - use super::#types_mod_ident; - #( #storage_types )* - } - } + .unzip(); + (storage_structs, storage_fns) } else { - quote!() + (Vec::new(), Vec::new()) }; quote! { @@ -151,7 +147,20 @@ impl RuntimeGenerator { use super::#types_mod_ident; #calls #event - #storage + + #( #storage_structs )* + + pub struct StorageClient<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, + } + + impl<'a, T: ::subxt::Runtime> StorageClient<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + + #( #storage_fns )* + } } } }); @@ -290,18 +299,21 @@ impl RuntimeGenerator { } } - fn generate_storage_entry_types( + fn generate_storage_entry_fns( &self, type_gen: &TypeGenerator, pallet: &PalletMetadata, storage_entry: &StorageEntryMetadata, - ) -> TokenStream2 { + ) -> (TokenStream2, TokenStream2) { let entry_struct_ident = format_ident!("{}", storage_entry.name); - let (entry_struct, key_impl) = match storage_entry.ty { - StorageEntryType::Plain(_) => { + let (fields, entry_struct, constructor, key_impl) = match storage_entry.ty { + StorageEntryType::Plain(ty) => { + let ty_path = type_gen.resolve_type_path(ty.id(), &[]); + let fields = vec![(format_ident!("_0"), ty_path)]; let entry_struct = quote!( pub struct #entry_struct_ident; ); + let constructor = quote!( #entry_struct_ident ); let key_impl = quote!(::subxt::StorageEntryKey::Plain); - (entry_struct, key_impl) + (fields, entry_struct, constructor, key_impl) } StorageEntryType::Map { ref key, @@ -332,10 +344,23 @@ impl RuntimeGenerator { let fields = tuple .fields() .iter() - .map(|f| type_gen.resolve_type_path(f.id(), &[])); + .enumerate() + .map(|(i, f)| { + let field_name = format_ident!("_{}", syn::Index::from(i)); + let field_type = type_gen.resolve_type_path(f.id(), &[]); + (field_name, field_type) + }) + .collect::>(); + let tuple_struct_fields = fields + .iter() + .map(|(_, field_type)| field_type); + let field_names = fields + .iter() + .map(|(field_name, _)| field_name); let entry_struct = quote! { - pub struct #entry_struct_ident( #( #fields ),* ); + pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); }; + let constructor = quote!( #entry_struct_ident( #( #field_names ),* ) ); let keys = (0..tuple.fields().len()) .into_iter() .zip(hashers) @@ -348,7 +373,7 @@ impl RuntimeGenerator { vec![ #( #keys ),* ] ) }; - (entry_struct, key_impl) + (fields, entry_struct, constructor, key_impl) } TypeDef::Composite(composite) => { // todo: [AJ] extract this pattern also used in ModuleType::composite_fields? @@ -377,6 +402,8 @@ impl RuntimeGenerator { #( #fields_def, )* } }; + let field_names = fields.iter().map(|(name, _)| name); + let constructor = quote!( #entry_struct_ident { #( #field_names ),* } ); let keys = fields .iter() .zip(hashers) @@ -388,18 +415,26 @@ impl RuntimeGenerator { vec![ #( #keys ),* ] ) }; - (entry_struct, key_impl) + (fields, entry_struct, constructor, key_impl) } else if unnamed { let fields = composite .fields() .iter() - .map(|f| type_gen.resolve_type_path(f.ty().id(), &[])) + .enumerate() + .map(|(i, f)| { + let field_name = format_ident!("_{}", syn::Index::from(i)); + let field_type = type_gen.resolve_type_path(f.ty().id(), &[]); + (field_name, field_type) + }) .collect::>(); let fields_def = - fields.iter().map(|field_type| quote!( pub #field_type )); + fields.iter().map(|(_, field_type) | quote!( pub #field_type )); let entry_struct = quote! { pub struct #entry_struct_ident( #( #fields_def, )* ); }; + let field_names = fields.iter().map(|(name, _)| name); + let constructor = quote!( #entry_struct_ident( #( #field_names ),* ) ); + let keys = (0..fields.len()) .into_iter() .zip(hashers) @@ -412,7 +447,7 @@ impl RuntimeGenerator { vec![ #( #keys ),* ] ) }; - (entry_struct, key_impl) + (fields, entry_struct, constructor, key_impl) } else { abort_call_site!( "Fields must be either all named or all unnamed" @@ -421,9 +456,11 @@ impl RuntimeGenerator { } _ => { let ty_path = type_gen.resolve_type_path(key.id(), &[]); + let fields = vec![(format_ident!("_0"), ty_path.clone())]; let entry_struct = quote! { - pub struct #entry_struct_ident(#ty_path); + pub struct #entry_struct_ident( #ty_path ); }; + let constructor = quote!( #entry_struct_ident(_0) ); let hasher = hashers.get(0).unwrap_or_else(|| { abort_call_site!("No hasher found for single key") }); @@ -432,30 +469,52 @@ impl RuntimeGenerator { vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] ) }; - (entry_struct, key_impl) + (fields, entry_struct, constructor, key_impl) } } } }; let pallet_name = &pallet.name; let storage_name = &storage_entry.name; - let value_ty = match storage_entry.ty { + let fn_name = format_ident!("{}", storage_entry.name.to_snake_case()); + let return_ty = match storage_entry.ty { StorageEntryType::Plain(ref ty) => ty, StorageEntryType::Map { ref value, .. } => value, }; - let value_ty_path = type_gen.resolve_type_path(value_ty.id(), &[]); + let return_ty_path = type_gen.resolve_type_path(return_ty.id(), &[]); + let return_ty = match storage_entry.modifier { + StorageEntryModifier::Default => quote!( #return_ty_path ), + StorageEntryModifier::Optional => quote!( Option<#return_ty_path> ), + }; - quote! { - #entry_struct - - impl ::subxt::StorageEntry for #entry_struct_ident { - const PALLET: &'static str = #pallet_name; - const STORAGE: &'static str = #storage_name; - type Value = #value_ty_path; - fn key(&self) -> ::subxt::StorageEntryKey { - #key_impl + let storage_entry_type = + quote! { + #entry_struct + + impl ::subxt::StorageEntry for #entry_struct_ident { + const PALLET: &'static str = #pallet_name; + const STORAGE: &'static str = #storage_name; + type Value = #return_ty_path; + fn key(&self) -> ::subxt::StorageEntryKey { + #key_impl + } } - } - } + }; + + let key_args = + fields.iter().map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? + let client_fn = + quote! { + pub async fn #fn_name( + &self, + #( #key_args, )* + hash: ::core::option::Option, + ) -> ::core::result::Result<#return_ty, ::subxt::Error> { + let entry = #constructor; + self.client.fetch_or_default(&entry, hash) + } + }; + + (storage_entry_type, client_fn) } } diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index ea9181d7be..d325d3544a 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -479,7 +479,7 @@ impl<'a> ModuleType<'a> { } } -#[derive(Debug)] +#[derive(Clone, Debug)] pub enum TypePath { Parameter(TypeParameter), Type(TypePathType), @@ -528,7 +528,7 @@ impl TypePath { } } -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct TypePathType { ty: Type, params: Vec, @@ -656,7 +656,7 @@ impl quote::ToTokens for TypeParameter { } } -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct TypePathSubstitute { path: syn::TypePath, params: Vec, From ed0d1bc9045661f2d4fa267e9889149d8ad8ed88 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 13 Sep 2021 20:06:53 +0100 Subject: [PATCH 051/216] Storage client compiling --- proc-macro/src/generate_runtime.rs | 42 ++++++++++++++++++------------ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index fcf1acf2b9..93b5127eff 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -142,26 +142,36 @@ impl RuntimeGenerator { (Vec::new(), Vec::new()) }; - quote! { - pub mod #mod_name { - use super::#types_mod_ident; - #calls - #event + let storage_mod = if !storage_structs.is_empty() { + quote! { + pub mod storage { + use super::#types_mod_ident; + #( #storage_structs )* - #( #storage_structs )* + pub struct StorageClient<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, + } - pub struct StorageClient<'a, T: ::subxt::Runtime> { - client: &'a ::subxt::Client, - } + impl<'a, T: ::subxt::Runtime> StorageClient<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } - impl<'a, T: ::subxt::Runtime> StorageClient<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + #( #storage_fns )* } - - #( #storage_fns )* } } + } else { + quote!() + }; + + quote! { + pub mod #mod_name { + use super::#types_mod_ident; + #calls + #event + #storage_mod + } } }); @@ -494,7 +504,7 @@ impl RuntimeGenerator { impl ::subxt::StorageEntry for #entry_struct_ident { const PALLET: &'static str = #pallet_name; const STORAGE: &'static str = #storage_name; - type Value = #return_ty_path; + type Value = #return_ty; fn key(&self) -> ::subxt::StorageEntryKey { #key_impl } @@ -511,7 +521,7 @@ impl RuntimeGenerator { hash: ::core::option::Option, ) -> ::core::result::Result<#return_ty, ::subxt::Error> { let entry = #constructor; - self.client.fetch_or_default(&entry, hash) + self.client.fetch_or_default(&entry, hash).await } }; From 327a215870160b65db16772080f9d3e8cde26099 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 14 Sep 2021 10:12:18 +0100 Subject: [PATCH 052/216] Generate storage client api --- proc-macro/src/generate_runtime.rs | 49 ++++++++++++++++++++++-------- tests/src/frame/balances.rs | 5 +-- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 93b5127eff..bf148531d7 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -105,9 +105,8 @@ impl RuntimeGenerator { TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); - let modules = self.metadata.pallets.iter().map(|pallet| { - let mod_name = format_ident!("{}", pallet.name.to_string().to_snake_case()); - + let pallet_mod_names = self.metadata.pallets.iter().map(|pallet| format_ident!("{}", pallet.name.to_string().to_snake_case())).collect::>(); + let modules = self.metadata.pallets.iter().zip(pallet_mod_names.iter()).map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { let call_structs = self.generate_call_structs(&type_gen, pallet, calls); quote! { @@ -142,28 +141,25 @@ impl RuntimeGenerator { (Vec::new(), Vec::new()) }; - let storage_mod = if !storage_structs.is_empty() { + let storage_mod = quote! { pub mod storage { use super::#types_mod_ident; #( #storage_structs )* - pub struct StorageClient<'a, T: ::subxt::Runtime> { - client: &'a ::subxt::Client, + pub struct StorageApi { + client: ::std::sync::Arc<::subxt::Client>, } - impl<'a, T: ::subxt::Runtime> StorageClient<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { + impl StorageApi { + pub fn new(client: ::std::sync::Arc<::subxt::Client>) -> Self { Self { client } } #( #storage_fns )* } } - } - } else { - quote!() - }; + }; quote! { pub mod #mod_name { @@ -197,12 +193,41 @@ impl RuntimeGenerator { // todo: [AJ] keep all other code items from decorated mod? let mod_ident = item_mod.ident; + let pallet_storage_cli_fields = pallet_mod_names.iter().map(|pallet_mod_name| quote! { + pub #pallet_mod_name: #pallet_mod_name::storage::StorageApi + }); + let pallet_storage_cli_fields_init = pallet_mod_names.iter().map(|pallet_mod_name| quote! { + #pallet_mod_name: #pallet_mod_name::storage::StorageApi::new(client.clone()) + }); quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod #mod_ident { #outer_event #( #modules )* #types_mod + + pub struct RuntimeApi { + pub client: ::std::sync::Arc<::subxt::Client>, + pub storage: StorageApi, + } + + impl RuntimeApi { + pub fn new(client: ::subxt::Client) -> Self { + let client = ::std::sync::Arc::new(client); + Self { + client: client.clone(), + storage: StorageApi { + client: client.clone(), + #( #pallet_storage_cli_fields_init, )* + }, + } + } + } + + pub struct StorageApi { + client: ::std::sync::Arc<::subxt::Client>, + #( #pallet_storage_cli_fields, )* + } } } } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index ca78c99f4d..e6df0d7f91 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -53,9 +53,10 @@ async fn test_basic_transfer() { let bob_address = bob.account_id().clone().into(); let test_node_proc = test_node_process().await; let client = test_node_proc.client(); + let api = crate::node_runtime::RuntimeApi::::new(client.clone()); - let alice_pre = client.account(alice.account_id(), None).await.unwrap(); - let bob_pre = client.account(bob.account_id(), None).await.unwrap(); + let alice_pre = api.storage.system.account(alice.account_id(), None).await.unwrap(); + let bob_pre = api.storage.system.account(bob.account_id(), None).await.unwrap(); let event = client .transfer_and_watch(&alice, &bob_address, 10_000) From e70534e19f386a3cecbbc057ecbc4921fc9ee9a9 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 14 Sep 2021 10:16:00 +0100 Subject: [PATCH 053/216] Fix up system account query account ids --- tests/src/frame/balances.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index e6df0d7f91..26a58ca632 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -55,8 +55,8 @@ async fn test_basic_transfer() { let client = test_node_proc.client(); let api = crate::node_runtime::RuntimeApi::::new(client.clone()); - let alice_pre = api.storage.system.account(alice.account_id(), None).await.unwrap(); - let bob_pre = api.storage.system.account(bob.account_id(), None).await.unwrap(); + let alice_pre = api.storage.system.account(alice.account_id().clone().into(), None).await.unwrap(); + let bob_pre = api.storage.system.account(bob.account_id().clone().into(), None).await.unwrap(); let event = client .transfer_and_watch(&alice, &bob_address, 10_000) @@ -72,8 +72,8 @@ async fn test_basic_transfer() { }; assert_eq!(event, expected_event); - let alice_post = client.account(alice.account_id(), None).await.unwrap(); - let bob_post = client.account(bob.account_id(), None).await.unwrap(); + let alice_post = api.storage.system.account(alice.account_id().clone().into(), None).await.unwrap(); + let bob_post = api.storage.system.account(bob.account_id().clone().into(), None).await.unwrap(); assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); @@ -109,7 +109,7 @@ async fn test_basic_transfer() { // client // .bond_and_watch( // &bob, -// &AccountKeyring::Charlie.to_account_id().into(), +// &AccountKeyring::Charlie.to_account_id().clone().into(), // 100_000_000_000_000, // RewardDestination::Stash, // ) From d75d1f0fd4567e0bc30666a1008dbc06ab0c21fc Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 14 Sep 2021 17:07:58 +0100 Subject: [PATCH 054/216] WIP generating tx api fns --- proc-macro/src/generate_runtime.rs | 85 +++++++++++++++++++++++------- src/client.rs | 29 ++++++++++ tests/src/frame/balances.rs | 16 +++--- 3 files changed, 102 insertions(+), 28 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index bf148531d7..55c32b524e 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -108,11 +108,23 @@ impl RuntimeGenerator { let pallet_mod_names = self.metadata.pallets.iter().map(|pallet| format_ident!("{}", pallet.name.to_string().to_snake_case())).collect::>(); let modules = self.metadata.pallets.iter().zip(pallet_mod_names.iter()).map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { - let call_structs = self.generate_call_structs(&type_gen, pallet, calls); + let (call_structs, call_fns) = self.generate_call_structs(&type_gen, pallet, calls); quote! { pub mod calls { use super::#types_mod_ident; #( #call_structs )* + + pub struct TransactionApi { + client: ::std::sync::Arc<::subxt::Client>, + } + + impl TransactionApi { + pub fn new(client: ::std::sync::Arc<::subxt::Client>) -> Self { + Self { client } + } + + #( #call_fns )* + } } } } else { @@ -199,6 +211,11 @@ impl RuntimeGenerator { let pallet_storage_cli_fields_init = pallet_mod_names.iter().map(|pallet_mod_name| quote! { #pallet_mod_name: #pallet_mod_name::storage::StorageApi::new(client.clone()) }); + let (pallet_calls_cli_fields, pallet_calls_cli_fields_init): (Vec<_>, Vec<_>) = pallet_mod_names.iter().map(|pallet_mod_name| { + let cli_field = quote!( pub #pallet_mod_name: #pallet_mod_name::calls::TransactionApi ); + let cli_field_init = quote!( #pallet_mod_name::calls::TransactionApi::new(client.clone()) ); + (cli_field, cli_field_init) + }).unzip(); quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod #mod_ident { @@ -209,6 +226,7 @@ impl RuntimeGenerator { pub struct RuntimeApi { pub client: ::std::sync::Arc<::subxt::Client>, pub storage: StorageApi, + pub tx: TransactionApi, } impl RuntimeApi { @@ -220,6 +238,10 @@ impl RuntimeGenerator { client: client.clone(), #( #pallet_storage_cli_fields_init, )* }, + tx: TransactionApi { + client: client.clone(), + #( #pallet_calls_cli_fields_init, )* + } } } } @@ -228,6 +250,11 @@ impl RuntimeGenerator { client: ::std::sync::Arc<::subxt::Client>, #( #pallet_storage_cli_fields, )* } + + pub struct TransactionApi { + client: ::std::sync::Arg<::subxt::Client>, + #( #pallet_calls_cli_fields, )* + } } } } @@ -278,7 +305,7 @@ impl RuntimeGenerator { type_gen: &TypeGenerator, pallet: &PalletMetadata, call: &PalletCallMetadata, - ) -> Vec { + ) -> (Vec, Vec) { let ty = call.ty; let name = type_gen.resolve_type_path(ty.id(), &[]); match name { @@ -298,35 +325,54 @@ impl RuntimeGenerator { "{}", var.name().to_string().to_camel_case() ); - let args = var.fields().iter().filter_map(|field| { + let args_name_and_type = var.fields().iter().filter_map(|field| { field.name().map(|name| { let name = format_ident!("{}", name); let ty = type_gen.resolve_type_path(field.ty().id(), &[]); - if ty.is_compact() { - quote! { #[codec(compact)] pub #name: #ty } - } else { - quote! { pub #name: #ty } - } + (name, ty) }) + }).collect::>(); + let args = args_name_and_type.iter().map(|(name, ty)| { + if ty.is_compact() { + quote! { #[codec(compact)] pub #name: #ty } + } else { + quote! { pub #name: #ty } + } }); + let call_fn_args = args_name_and_type.iter().map(|(name, ty)| { + quote!( #name: #ty ) + }).collect::>(); let pallet_name = &pallet.name; let function_name = var.name().to_string(); + let fn_name = function_name.to_camel_case(); - quote! { - #[derive(Debug, ::codec::Encode, ::codec::Decode)] - pub struct #name { - #( #args ),* - } + let call_struct = + quote! { + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct #name { + #( #args ),* + } - impl ::subxt::Call for #name { - const PALLET: &'static str = #pallet_name; - const FUNCTION: &'static str = #function_name; - } - } + impl ::subxt::Call for #name { + const PALLET: &'static str = #pallet_name; + const FUNCTION: &'static str = #function_name; + } + }; + let client_fn = + quote! { + pub async fn #fn_name( + &self, + #( #call_fn_args, )* + ) -> ::subxt::SubmittableExtrinsic { + let call = #name { #( #call_fn_args, )* }; + ::subxt::SubmittableExtrinsic::new(self.client.clone(), call) + } + }; + (call_struct, client_fn) }) - .collect::>() + .unzip() } else { abort_call_site!("Call type should be an variant/enum type") } @@ -386,6 +432,7 @@ impl RuntimeGenerator { (field_name, field_type) }) .collect::>(); + // toddo: [AJ] use unzip here? let tuple_struct_fields = fields .iter() .map(|(_, field_type)| field_type); diff --git a/src/client.rs b/src/client.rs index 5bd66165b8..f058334c1d 100644 --- a/src/client.rs +++ b/src/client.rs @@ -462,3 +462,32 @@ impl Client { self.rpc.has_key(public_key, key_type).await } } + +pub struct SubmittableExtrinsic { + client: Arc>, + call: C, +} + +impl SubmittableExtrinsic +where + T: Runtime, + C: Call + Send + Sync, + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, +{ + pub fn new(client: Arc>, call: C) -> Self { + Self { client, call } + } + + /// Create and submit an extrinsic and return corresponding Event if successful + /// todo: [AJ] could do a type builder interface like `xt.sign(&signer).watch_events().submit()` + pub async fn sign_and_submit_then_watch(self, signer: &(dyn Signer + Send + Sync)) -> Result, Error> { + let extrinsic= self.client.create_signed(self.call, signer).await?; + self.client.submit_and_watch_extrinsic(extrinsic).await + } + + /// Submits a transaction to the chain. + pub async fn sign_and_submit(self, signer: &(dyn Signer + Send + Sync)) -> Result { + let extrinsic= self.client.create_signed(self.call, signer).await?; + self.client.submit_extrinsic(extrinsic).await + } +} diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 26a58ca632..9785be9223 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -16,7 +16,9 @@ //! Implements support for the pallet_balances module. -use crate::{test_node_process, TestRuntime, node_runtime}; +use crate::{ + test_node_process, TestRuntime, node_runtime::{RuntimeApi, balances}, +}; use codec::{ Decode, Encode, @@ -58,14 +60,10 @@ async fn test_basic_transfer() { let alice_pre = api.storage.system.account(alice.account_id().clone().into(), None).await.unwrap(); let bob_pre = api.storage.system.account(bob.account_id().clone().into(), None).await.unwrap(); - let event = client - .transfer_and_watch(&alice, &bob_address, 10_000) - .await - .expect("sending an xt works") - .transfer() - .unwrap() - .unwrap(); - let expected_event = TransferEvent { + let extrinsic = api.tx.balances.transfer(&bob_address, 10_000).await.unwrap(); + let result = extrinsic.sign_and_submit_then_watch(&alice).await.unwrap(); + let event = result.find_event::().unwrap().unwrap(); + let expected_event = balances::events::Transfer { from: alice.account_id().clone(), to: bob.account_id().clone(), amount: 10_000, From 634f21f94371e3fb5946b896fedf7ebe813d4db9 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 14 Sep 2021 17:39:25 +0100 Subject: [PATCH 055/216] Only generate tx api fields when calls available --- proc-macro/src/generate_runtime.rs | 40 +++++++++++++++++++----------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 55c32b524e..f2606f6ddb 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -105,8 +105,8 @@ impl RuntimeGenerator { TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); - let pallet_mod_names = self.metadata.pallets.iter().map(|pallet| format_ident!("{}", pallet.name.to_string().to_snake_case())).collect::>(); - let modules = self.metadata.pallets.iter().zip(pallet_mod_names.iter()).map(|(pallet, mod_name)| { + let pallets_with_mod_names = self.metadata.pallets.iter().map(|pallet| (pallet, format_ident!("{}", pallet.name.to_string().to_snake_case()))).collect::>(); + let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { let (call_structs, call_fns) = self.generate_call_structs(&type_gen, pallet, calls); quote! { @@ -123,7 +123,7 @@ impl RuntimeGenerator { Self { client } } - #( #call_fns )* + // #( #call_fns )* } } } @@ -205,17 +205,27 @@ impl RuntimeGenerator { // todo: [AJ] keep all other code items from decorated mod? let mod_ident = item_mod.ident; - let pallet_storage_cli_fields = pallet_mod_names.iter().map(|pallet_mod_name| quote! { - pub #pallet_mod_name: #pallet_mod_name::storage::StorageApi - }); - let pallet_storage_cli_fields_init = pallet_mod_names.iter().map(|pallet_mod_name| quote! { - #pallet_mod_name: #pallet_mod_name::storage::StorageApi::new(client.clone()) - }); - let (pallet_calls_cli_fields, pallet_calls_cli_fields_init): (Vec<_>, Vec<_>) = pallet_mod_names.iter().map(|pallet_mod_name| { - let cli_field = quote!( pub #pallet_mod_name: #pallet_mod_name::calls::TransactionApi ); - let cli_field_init = quote!( #pallet_mod_name::calls::TransactionApi::new(client.clone()) ); - (cli_field, cli_field_init) + let (pallet_storage_cli_fields, pallet_storage_cli_fields_init): (Vec<_>, Vec<_>) = pallets_with_mod_names.iter().filter_map(|(pallet, pallet_mod_name)| { + if pallet.storage.is_some() { + let pallet_storage_cli_field = quote!( pub #pallet_mod_name: #pallet_mod_name::storage::StorageApi ); + let pallet_storage_cli_field_init = quote!( #pallet_mod_name: #pallet_mod_name::storage::StorageApi::new(client.clone()) ); + Some((pallet_storage_cli_field, pallet_storage_cli_field_init)) + } else { + None + } }).unzip(); + let (pallet_calls_cli_fields, pallet_calls_cli_fields_init): (Vec<_>, Vec<_>) = pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + if pallet.calls.is_some() { + let cli_field = quote!( pub #pallet_mod_name: #pallet_mod_name::calls::TransactionApi ); + let cli_field_init = quote!( #pallet_mod_name: #pallet_mod_name::calls::TransactionApi::new(client.clone()) ); + Some((cli_field, cli_field_init)) + } else { + None + } + }) + .unzip(); quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod #mod_ident { @@ -252,7 +262,7 @@ impl RuntimeGenerator { } pub struct TransactionApi { - client: ::std::sync::Arg<::subxt::Client>, + client: ::std::sync::Arc<::subxt::Client>, #( #pallet_calls_cli_fields, )* } } @@ -346,7 +356,7 @@ impl RuntimeGenerator { let pallet_name = &pallet.name; let function_name = var.name().to_string(); - let fn_name = function_name.to_camel_case(); + let fn_name = format_ident!("{}", function_name.to_snake_case()); let call_struct = quote! { From cedf27e3333272d4ff9268c69b70cd8ddf780b66 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 15 Sep 2021 12:16:14 +0100 Subject: [PATCH 056/216] Fix tx api call fns --- proc-macro/src/generate_runtime.rs | 10 +++++----- src/client.rs | 2 ++ src/lib.rs | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index f2606f6ddb..adb99a2e79 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -123,7 +123,7 @@ impl RuntimeGenerator { Self { client } } - // #( #call_fns )* + #( #call_fns )* } } } @@ -350,9 +350,9 @@ impl RuntimeGenerator { quote! { pub #name: #ty } } }); - let call_fn_args = args_name_and_type.iter().map(|(name, ty)| { - quote!( #name: #ty ) - }).collect::>(); + let (call_fn_args, call_args): (Vec<_>, Vec<_>) = args_name_and_type.iter().map(|(name, ty)| { + (quote!( #name: #ty ), name) + }).unzip(); let pallet_name = &pallet.name; let function_name = var.name().to_string(); @@ -376,7 +376,7 @@ impl RuntimeGenerator { &self, #( #call_fn_args, )* ) -> ::subxt::SubmittableExtrinsic { - let call = #name { #( #call_fn_args, )* }; + let call = #name { #( #call_args, )* }; ::subxt::SubmittableExtrinsic::new(self.client.clone(), call) } }; diff --git a/src/client.rs b/src/client.rs index f058334c1d..e81a40266a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -463,6 +463,7 @@ impl Client { } } +/// A constructed call ready to be signed and submitted. pub struct SubmittableExtrinsic { client: Arc>, call: C, @@ -474,6 +475,7 @@ where C: Call + Send + Sync, <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { + /// Create a new [`SubmittableExtrinsic`]. pub fn new(client: Arc>, call: C) -> Self { Self { client, call } } diff --git a/src/lib.rs b/src/lib.rs index 6f58cb282e..51ec4f938a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,6 +65,7 @@ pub use crate::{ client::{ Client, ClientBuilder, + SubmittableExtrinsic, }, error::{ Error, From 690e079338c3e5cc0dfd0629f82ff97905224311 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 15 Sep 2021 12:23:05 +0100 Subject: [PATCH 057/216] Fmt --- proc-macro/src/generate_runtime.rs | 93 +++++++++++++++++------------- src/client.rs | 17 ++++-- tests/src/frame/balances.rs | 63 +++++++++++++++----- 3 files changed, 113 insertions(+), 60 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index adb99a2e79..2626c92537 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -105,7 +105,17 @@ impl RuntimeGenerator { TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); - let pallets_with_mod_names = self.metadata.pallets.iter().map(|pallet| (pallet, format_ident!("{}", pallet.name.to_string().to_snake_case()))).collect::>(); + let pallets_with_mod_names = self + .metadata + .pallets + .iter() + .map(|pallet| { + ( + pallet, + format_ident!("{}", pallet.name.to_string().to_snake_case()), + ) + }) + .collect::>(); let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { let (call_structs, call_fns) = self.generate_call_structs(&type_gen, pallet, calls); @@ -437,22 +447,21 @@ impl RuntimeGenerator { .iter() .enumerate() .map(|(i, f)| { - let field_name = format_ident!("_{}", syn::Index::from(i)); + let field_name = + format_ident!("_{}", syn::Index::from(i)); let field_type = type_gen.resolve_type_path(f.id(), &[]); (field_name, field_type) }) .collect::>(); // toddo: [AJ] use unzip here? - let tuple_struct_fields = fields - .iter() - .map(|(_, field_type)| field_type); - let field_names = fields - .iter() - .map(|(field_name, _)| field_name); + let tuple_struct_fields = + fields.iter().map(|(_, field_type)| field_type); + let field_names = fields.iter().map(|(field_name, _)| field_name); let entry_struct = quote! { pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); }; - let constructor = quote!( #entry_struct_ident( #( #field_names ),* ) ); + let constructor = + quote!( #entry_struct_ident( #( #field_names ),* ) ); let keys = (0..tuple.fields().len()) .into_iter() .zip(hashers) @@ -495,7 +504,8 @@ impl RuntimeGenerator { } }; let field_names = fields.iter().map(|(name, _)| name); - let constructor = quote!( #entry_struct_ident { #( #field_names ),* } ); + let constructor = + quote!( #entry_struct_ident { #( #field_names ),* } ); let keys = fields .iter() .zip(hashers) @@ -514,18 +524,22 @@ impl RuntimeGenerator { .iter() .enumerate() .map(|(i, f)| { - let field_name = format_ident!("_{}", syn::Index::from(i)); - let field_type = type_gen.resolve_type_path(f.ty().id(), &[]); + let field_name = + format_ident!("_{}", syn::Index::from(i)); + let field_type = + type_gen.resolve_type_path(f.ty().id(), &[]); (field_name, field_type) }) .collect::>(); - let fields_def = - fields.iter().map(|(_, field_type) | quote!( pub #field_type )); + let fields_def = fields + .iter() + .map(|(_, field_type)| quote!( pub #field_type )); let entry_struct = quote! { pub struct #entry_struct_ident( #( #fields_def, )* ); }; let field_names = fields.iter().map(|(name, _)| name); - let constructor = quote!( #entry_struct_ident( #( #field_names ),* ) ); + let constructor = + quote!( #entry_struct_ident( #( #field_names ),* ) ); let keys = (0..fields.len()) .into_iter() @@ -579,33 +593,32 @@ impl RuntimeGenerator { StorageEntryModifier::Optional => quote!( Option<#return_ty_path> ), }; - let storage_entry_type = - quote! { - #entry_struct - - impl ::subxt::StorageEntry for #entry_struct_ident { - const PALLET: &'static str = #pallet_name; - const STORAGE: &'static str = #storage_name; - type Value = #return_ty; - fn key(&self) -> ::subxt::StorageEntryKey { - #key_impl - } - } - }; + let storage_entry_type = quote! { + #entry_struct - let key_args = - fields.iter().map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? - let client_fn = - quote! { - pub async fn #fn_name( - &self, - #( #key_args, )* - hash: ::core::option::Option, - ) -> ::core::result::Result<#return_ty, ::subxt::Error> { - let entry = #constructor; - self.client.fetch_or_default(&entry, hash).await + impl ::subxt::StorageEntry for #entry_struct_ident { + const PALLET: &'static str = #pallet_name; + const STORAGE: &'static str = #storage_name; + type Value = #return_ty; + fn key(&self) -> ::subxt::StorageEntryKey { + #key_impl } - }; + } + }; + + let key_args = fields + .iter() + .map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? + let client_fn = quote! { + pub async fn #fn_name( + &self, + #( #key_args, )* + hash: ::core::option::Option, + ) -> ::core::result::Result<#return_ty, ::subxt::Error> { + let entry = #constructor; + self.client.fetch_or_default(&entry, hash).await + } + }; (storage_entry_type, client_fn) } diff --git a/src/client.rs b/src/client.rs index e81a40266a..bef35619a2 100644 --- a/src/client.rs +++ b/src/client.rs @@ -473,7 +473,8 @@ impl SubmittableExtrinsic where T: Runtime, C: Call + Send + Sync, - <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, { /// Create a new [`SubmittableExtrinsic`]. pub fn new(client: Arc>, call: C) -> Self { @@ -482,14 +483,20 @@ where /// Create and submit an extrinsic and return corresponding Event if successful /// todo: [AJ] could do a type builder interface like `xt.sign(&signer).watch_events().submit()` - pub async fn sign_and_submit_then_watch(self, signer: &(dyn Signer + Send + Sync)) -> Result, Error> { - let extrinsic= self.client.create_signed(self.call, signer).await?; + pub async fn sign_and_submit_then_watch( + self, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> { + let extrinsic = self.client.create_signed(self.call, signer).await?; self.client.submit_and_watch_extrinsic(extrinsic).await } /// Submits a transaction to the chain. - pub async fn sign_and_submit(self, signer: &(dyn Signer + Send + Sync)) -> Result { - let extrinsic= self.client.create_signed(self.call, signer).await?; + pub async fn sign_and_submit( + self, + signer: &(dyn Signer + Send + Sync), + ) -> Result { + let extrinsic = self.client.create_signed(self.call, signer).await?; self.client.submit_extrinsic(extrinsic).await } } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 9785be9223..afaaeecfb4 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -17,7 +17,12 @@ //! Implements support for the pallet_balances module. use crate::{ - test_node_process, TestRuntime, node_runtime::{RuntimeApi, balances}, + node_runtime::{ + balances, + RuntimeApi, + }, + test_node_process, + TestRuntime, }; use codec::{ Decode, @@ -31,21 +36,21 @@ use sp_runtime::traits::{ }; use std::fmt::Debug; +use sp_core::{ + sr25519::Pair, + Pair as _, +}; +use sp_keyring::AccountKeyring; use subxt::{ - Error, - ModuleError, - RuntimeError, extrinsic::{ PairSigner, Signer, }, + Error, EventSubscription, + ModuleError, + RuntimeError, }; -use sp_core::{ - sr25519::Pair, - Pair as _, -}; -use sp_keyring::AccountKeyring; #[async_std::test] async fn test_basic_transfer() { @@ -57,12 +62,30 @@ async fn test_basic_transfer() { let client = test_node_proc.client(); let api = crate::node_runtime::RuntimeApi::::new(client.clone()); - let alice_pre = api.storage.system.account(alice.account_id().clone().into(), None).await.unwrap(); - let bob_pre = api.storage.system.account(bob.account_id().clone().into(), None).await.unwrap(); + let alice_pre = api + .storage + .system + .account(alice.account_id().clone().into(), None) + .await + .unwrap(); + let bob_pre = api + .storage + .system + .account(bob.account_id().clone().into(), None) + .await + .unwrap(); - let extrinsic = api.tx.balances.transfer(&bob_address, 10_000).await.unwrap(); + let extrinsic = api + .tx + .balances + .transfer(&bob_address, 10_000) + .await + .unwrap(); let result = extrinsic.sign_and_submit_then_watch(&alice).await.unwrap(); - let event = result.find_event::().unwrap().unwrap(); + let event = result + .find_event::() + .unwrap() + .unwrap(); let expected_event = balances::events::Transfer { from: alice.account_id().clone(), to: bob.account_id().clone(), @@ -70,8 +93,18 @@ async fn test_basic_transfer() { }; assert_eq!(event, expected_event); - let alice_post = api.storage.system.account(alice.account_id().clone().into(), None).await.unwrap(); - let bob_post = api.storage.system.account(bob.account_id().clone().into(), None).await.unwrap(); + let alice_post = api + .storage + .system + .account(alice.account_id().clone().into(), None) + .await + .unwrap(); + let bob_post = api + .storage + .system + .account(bob.account_id().clone().into(), None) + .await + .unwrap(); assert!(alice_pre.data.free - 10_000 >= alice_post.data.free); assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); From b82d4e8a961c418c9664b84825a747c081aaa1d2 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 16 Sep 2021 11:04:44 +0100 Subject: [PATCH 058/216] WIP generate event structs --- proc-macro/src/generate_runtime.rs | 230 +++++++++++++++++++---------- proc-macro/src/generate_types.rs | 4 - 2 files changed, 154 insertions(+), 80 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 2626c92537..ee8af9708e 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -24,6 +24,7 @@ use darling::FromMeta; use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, + PalletEventMetadata, PalletMetadata, RuntimeMetadata, RuntimeMetadataPrefixed, @@ -32,7 +33,10 @@ use frame_metadata::{ StorageEntryType, StorageHasher, }; -use heck::SnakeCase as _; +use heck::{ + CamelCase as _, + SnakeCase as _, +}; use proc_macro_error::{ abort, abort_call_site, @@ -118,7 +122,7 @@ impl RuntimeGenerator { .collect::>(); let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { - let (call_structs, call_fns) = self.generate_call_structs(&type_gen, pallet, calls); + let (call_structs, call_fns) = self.generate_calls(&type_gen, pallet, calls); quote! { pub mod calls { use super::#types_mod_ident; @@ -128,7 +132,11 @@ impl RuntimeGenerator { client: ::std::sync::Arc<::subxt::Client>, } - impl TransactionApi { + impl TransactionApi + where + <>::Extra as ::subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: + Send + Sync + { pub fn new(client: ::std::sync::Arc<::subxt::Client>) -> Self { Self { client } } @@ -143,8 +151,13 @@ impl RuntimeGenerator { let event = if let Some(ref event) = pallet.event { let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); + let event_structs = self.generate_event_structs(&type_gen, pallet, event); quote! { pub type Event = #event_type; + pub mod events { + use super::#types_mod_ident; + #( #event_structs )* + } } } else { quote!() @@ -249,7 +262,11 @@ impl RuntimeGenerator { pub tx: TransactionApi, } - impl RuntimeApi { + impl RuntimeApi + where + <>::Extra as ::subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: + Send + Sync + { pub fn new(client: ::subxt::Client) -> Self { let client = ::std::sync::Arc::new(client); Self { @@ -320,83 +337,98 @@ impl RuntimeGenerator { } } - fn generate_call_structs( + fn generate_calls( &self, type_gen: &TypeGenerator, pallet: &PalletMetadata, call: &PalletCallMetadata, ) -> (Vec, Vec) { - let ty = call.ty; - let name = type_gen.resolve_type_path(ty.id(), &[]); - match name { - TypePath::Parameter(_) => panic!("Call type should be a Parameter"), - TypePath::Substitute(_) => panic!("Call type should not be a Substitute"), - TypePath::Type(ref ty) => { - let ty = ty.ty(); - - let type_def = ty.type_def(); - if let scale_info::TypeDef::Variant(variant) = type_def { - variant - .variants() - .iter() - .map(|var| { - use heck::CamelCase; - let name = format_ident!( - "{}", - var.name().to_string().to_camel_case() - ); - let args_name_and_type = var.fields().iter().filter_map(|field| { - field.name().map(|name| { - let name = format_ident!("{}", name); - let ty = - type_gen.resolve_type_path(field.ty().id(), &[]); - (name, ty) - }) - }).collect::>(); - let args = args_name_and_type.iter().map(|(name, ty)| { - if ty.is_compact() { - quote! { #[codec(compact)] pub #name: #ty } - } else { - quote! { pub #name: #ty } - } - }); - let (call_fn_args, call_args): (Vec<_>, Vec<_>) = args_name_and_type.iter().map(|(name, ty)| { - (quote!( #name: #ty ), name) - }).unzip(); - - let pallet_name = &pallet.name; - let function_name = var.name().to_string(); - let fn_name = format_ident!("{}", function_name.to_snake_case()); - - let call_struct = - quote! { - #[derive(Debug, ::codec::Encode, ::codec::Decode)] - pub struct #name { - #( #args ),* - } - - impl ::subxt::Call for #name { - const PALLET: &'static str = #pallet_name; - const FUNCTION: &'static str = #function_name; - } - }; - let client_fn = - quote! { - pub async fn #fn_name( - &self, - #( #call_fn_args, )* - ) -> ::subxt::SubmittableExtrinsic { - let call = #name { #( #call_args, )* }; - ::subxt::SubmittableExtrinsic::new(self.client.clone(), call) - } - }; - (call_struct, client_fn) - }) - .unzip() - } else { - abort_call_site!("Call type should be an variant/enum type") - } - } + let struct_defs = + self.generate_structs_from_variants(type_gen, call.ty.id(), "Call"); + struct_defs + .iter() + .map(|struct_def| { + let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def + .fields + .iter() + .map(|(name, ty)| (quote!( #name: #ty ), name)) + .unzip(); + + let pallet_name = &pallet.name; + let call_struct_name = &struct_def.name; + let function_name = struct_def.name.to_string(); + let fn_name = format_ident!("{}", function_name.to_snake_case()); + + let call_struct = quote! { + #struct_def + + impl ::subxt::Call for #call_struct_name { + const PALLET: &'static str = #pallet_name; + const FUNCTION: &'static str = #function_name; + } + }; + let client_fn = quote! { + pub async fn #fn_name( + &self, + #( #call_fn_args, )* + ) -> ::subxt::SubmittableExtrinsic { + let call = #call_struct_name { #( #call_args, )* }; + ::subxt::SubmittableExtrinsic::new(self.client.clone(), call) + } + }; + (call_struct, client_fn) + }) + .unzip() + } + + fn generate_event_structs( + &self, + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + event: &PalletEventMetadata, + ) -> Vec { + let struct_defs = + self.generate_structs_from_variants(type_gen, event.ty.id(), "Event"); + struct_defs + .iter() + .map(|struct_def| { + let pallet_name = &pallet.name; + let event_struct = &struct_def.name; + let event_name = struct_def.name.to_string(); + + let event_struct = quote! { + #struct_def + + impl ::subxt::Event for #event_struct { + const PALLET: &'static str = #pallet_name; + const EVENT: &'static str = #event_name; + } + }; + event_struct + }) + .collect() + } + + fn generate_structs_from_variants( + &self, + type_gen: &TypeGenerator, + type_id: u32, + error_message_type_name: &str, + ) -> Vec { + let ty = self.metadata.types.resolve(type_id).unwrap_or_else(|| { + abort_call_site!("Failed to resolve {} type", error_message_type_name) + }); + if let scale_info::TypeDef::Variant(variant) = ty.type_def() { + variant + .variants() + .iter() + .map(|var| StructDef::from_variant(var, type_gen)) + .collect() + } else { + abort_call_site!( + "{} type should be an variant/enum type", + error_message_type_name + ) } } @@ -623,3 +655,49 @@ impl RuntimeGenerator { (storage_entry_type, client_fn) } } + +#[derive(Debug)] +pub struct StructDef { + name: syn::Ident, + fields: Vec<(syn::Ident, TypePath)>, +} + +impl StructDef { + pub fn from_variant( + variant: &scale_info::Variant, + type_gen: &TypeGenerator, + ) -> Self { + let name = format_ident!("{}", variant.name().to_string().to_camel_case()); + let fields = variant + .fields() + .iter() + .filter_map(|field| { + field.name().map(|name| { + let name = format_ident!("{}", name); + let ty = type_gen.resolve_type_path(field.ty().id(), &[]); + (name, ty) + }) + }) + .collect::>(); + Self { name, fields } + } +} + +impl quote::ToTokens for StructDef { + fn to_tokens(&self, tokens: &mut TokenStream2) { + let fields = self.fields.iter().map(|(name, ty)| { + if ty.is_compact() { + quote! { #[codec(compact)] pub #name: #ty } + } else { + quote! { pub #name: #ty } + } + }); + let name = &self.name; + tokens.extend(quote! { + #[derive(Debug, ::codec::Encode, ::codec::Decode)] + pub struct #name { + #( #fields ),* + } + }) + } +} diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index d325d3544a..fd9a135d4a 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -536,10 +536,6 @@ pub struct TypePathType { } impl TypePathType { - pub(crate) fn ty(&self) -> &Type { - &self.ty - } - pub(crate) fn is_compact(&self) -> bool { matches!(self.ty.type_def(), TypeDef::Compact(_)) } From 8342c31809f8374e8d305cde1be18b4ef79e4531 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 16 Sep 2021 14:34:29 +0100 Subject: [PATCH 059/216] call functions not async --- proc-macro/src/generate_runtime.rs | 2 +- tests/src/frame/balances.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index ee8af9708e..728757327a 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -368,7 +368,7 @@ impl RuntimeGenerator { } }; let client_fn = quote! { - pub async fn #fn_name( + pub fn #fn_name( &self, #( #call_fn_args, )* ) -> ::subxt::SubmittableExtrinsic { diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index afaaeecfb4..ea858f2924 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -78,9 +78,7 @@ async fn test_basic_transfer() { let extrinsic = api .tx .balances - .transfer(&bob_address, 10_000) - .await - .unwrap(); + .transfer(bob_address, 10_000); let result = extrinsic.sign_and_submit_then_watch(&alice).await.unwrap(); let event = result .find_event::() From 4cb16a3e2dbcae8fbea239e55c59ff533611bb32 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 16 Sep 2021 14:37:34 +0100 Subject: [PATCH 060/216] Derive Eq for comparison on generated types --- proc-macro/src/generate_runtime.rs | 4 +-- proc-macro/src/generate_types.rs | 46 +++++++++++++++--------------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 728757327a..b90322cba6 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -220,7 +220,7 @@ impl RuntimeGenerator { }); let outer_event = quote! { - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub enum Event { #( #outer_event_variants )* } @@ -694,7 +694,7 @@ impl quote::ToTokens for StructDef { }); let name = &self.name; tokens.extend(quote! { - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct #name { #( #fields ),* } diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index fd9a135d4a..da84a913b8 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -270,7 +270,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { let (fields, _) = self.composite_fields(composite.fields(), &type_params, true); let ty_toks = quote! { - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct #type_name #fields }; tokens.extend(ty_toks); @@ -310,7 +310,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { } let ty_toks = quote! { - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub enum #type_name { #( #variants, )* } @@ -727,7 +727,7 @@ mod tests { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { pub a: bool, pub b: u32, @@ -768,12 +768,12 @@ mod tests { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Child { pub a: i32, } - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Parent { pub a: bool, pub b: root::chameleon_core::generate_types::tests::Child, @@ -808,10 +808,10 @@ mod tests { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Child(pub i32,); - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Parent(pub bool, pub root::chameleon_core::generate_types::tests::Child,); } } @@ -842,7 +842,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub enum E { A, B (bool,), @@ -875,7 +875,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { pub a: [u8; 32usize], } @@ -907,7 +907,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { pub a: Option, pub b: Option, @@ -944,7 +944,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { pub a: std::boxed::Box, pub b: std::boxed::Box, @@ -979,7 +979,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub enum E { A(std::boxed::Box,), B { a: std::boxed::Box, }, @@ -1012,7 +1012,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { pub a: ::core::ops::Range, pub b: ::core::ops::RangeInclusive, @@ -1051,12 +1051,12 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Bar { pub b: root::chameleon_core::generate_types::tests::Foo, pub c: root::chameleon_core::generate_types::tests::Foo, } - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Foo<_0> { pub a: _0, } @@ -1094,12 +1094,12 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Bar<_0> { pub b: root::chameleon_core::generate_types::tests::Foo<_0, u32>, } - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Foo<_0, _1> { pub a: _0, pub b: Option<(_0, _1,)>, @@ -1141,7 +1141,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { pub lsb: root::bitvec::vec::BitVec, pub msb: root::bitvec::vec::BitVec, @@ -1189,12 +1189,12 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct NamedFields<_0> { pub b: u32, pub __chameleon_unused_type_params: ::core::marker::PhantomData<_0>, } - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct UnnamedFields<_0, _1> ( pub (u32, u32,), pub ::core::marker::PhantomData<(_0, _1)>, @@ -1252,20 +1252,20 @@ mod tests { pub mod b { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Bar { pub a: root::chameleon_core::generate_types::tests::modules::a::Foo, } } - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Foo {} } pub mod c { use super::root; - #[derive(Debug, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Foo { pub a: root::chameleon_core::generate_types::tests::modules::a::b::Bar, } From 97308a9944ba76c842d9d22b149018d2efda5dbd Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 09:45:18 +0100 Subject: [PATCH 061/216] Generate event structs --- proc-macro/src/generate_runtime.rs | 106 +++++++++++++++++++++++------ tests/src/frame/balances.rs | 15 ++-- 2 files changed, 91 insertions(+), 30 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index b90322cba6..ec469d6ee6 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -349,7 +349,13 @@ impl RuntimeGenerator { .iter() .map(|struct_def| { let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def - .fields + .named_fields() + .unwrap_or_else(|| { + abort_call_site!( + "Call variant for type {} must have all named fields", + call.ty.id() + ) + }) .iter() .map(|(name, ty)| (quote!( #name: #ty ), name)) .unzip(); @@ -659,7 +665,13 @@ impl RuntimeGenerator { #[derive(Debug)] pub struct StructDef { name: syn::Ident, - fields: Vec<(syn::Ident, TypePath)>, + fields: StructDefFields, +} + +#[derive(Debug)] +pub enum StructDefFields { + Named(Vec<(syn::Ident, TypePath)>), + Unnamed(Vec), } impl StructDef { @@ -667,36 +679,88 @@ impl StructDef { variant: &scale_info::Variant, type_gen: &TypeGenerator, ) -> Self { - let name = format_ident!("{}", variant.name().to_string().to_camel_case()); - let fields = variant + let name = format_ident!("{}", variant.name().to_camel_case()); + let variant_fields = variant .fields() .iter() - .filter_map(|field| { - field.name().map(|name| { - let name = format_ident!("{}", name); - let ty = type_gen.resolve_type_path(field.ty().id(), &[]); - (name, ty) - }) + .map(|field| { + let name = field.name().map(|f| format_ident!("{}", f)); + let ty = type_gen.resolve_type_path(field.ty().id(), &[]); + (name, ty) }) .collect::>(); + + let named = variant_fields.iter().all(|(name, _)| name.is_some()); + let unnamed = variant_fields.iter().all(|(name, _)| name.is_none()); + + let fields = if named { + StructDefFields::Named( + variant_fields + .iter() + .map(|(name, field)| { + let name = name.as_ref().unwrap_or_else(|| { + abort_call_site!("All fields should have a name") + }); + (name.clone(), field.clone()) + }) + .collect(), + ) + } else if unnamed { + StructDefFields::Unnamed( + variant_fields + .iter() + .map(|(_, field)| field.clone()) + .collect(), + ) + } else { + abort_call_site!( + "Variant '{}': Fields should either be all named or all unnamed.", + variant.name() + ) + }; + Self { name, fields } } + + fn named_fields(&self) -> Option<&[(syn::Ident, TypePath)]> { + if let StructDefFields::Named(ref fields) = self.fields { + Some(fields) + } else { + None + } + } } impl quote::ToTokens for StructDef { fn to_tokens(&self, tokens: &mut TokenStream2) { - let fields = self.fields.iter().map(|(name, ty)| { - if ty.is_compact() { - quote! { #[codec(compact)] pub #name: #ty } - } else { - quote! { pub #name: #ty } + tokens.extend(match self.fields { + StructDefFields::Named(ref named_fields) => { + let fields = named_fields.iter().map(|(name, ty)| { + let compact_attr = + ty.is_compact().then(|| quote!( #[codec(compact)] )); + quote! { #compact_attr pub #name: #ty } + }); + let name = &self.name; + quote! { + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + pub struct #name { + #( #fields ),* + } + } } - }); - let name = &self.name; - tokens.extend(quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] - pub struct #name { - #( #fields ),* + StructDefFields::Unnamed(ref unnamed_fields) => { + let fields = unnamed_fields.iter().map(|ty| { + let compact_attr = + ty.is_compact().then(|| quote!( #[codec(compact)] )); + quote! { #compact_attr pub #ty } + }); + let name = &self.name; + quote! { + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + pub struct #name ( + #( #fields ),* + ); + } } }) } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index ea858f2924..9b8fb24f3e 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -75,20 +75,17 @@ async fn test_basic_transfer() { .await .unwrap(); - let extrinsic = api - .tx - .balances - .transfer(bob_address, 10_000); + let extrinsic = api.tx.balances.transfer(bob_address, 10_000); let result = extrinsic.sign_and_submit_then_watch(&alice).await.unwrap(); let event = result .find_event::() .unwrap() .unwrap(); - let expected_event = balances::events::Transfer { - from: alice.account_id().clone(), - to: bob.account_id().clone(), - amount: 10_000, - }; + let expected_event = balances::events::Transfer ( + alice.account_id().clone(), + bob.account_id().clone(), + 10_000, + ); assert_eq!(event, expected_event); let alice_post = api From f8f2da6508a10bea34df801dd778854e31657565 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 10:02:00 +0100 Subject: [PATCH 062/216] Fix call name --- proc-macro/src/generate_runtime.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index ec469d6ee6..9877290e00 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -362,8 +362,8 @@ impl RuntimeGenerator { let pallet_name = &pallet.name; let call_struct_name = &struct_def.name; - let function_name = struct_def.name.to_string(); - let fn_name = format_ident!("{}", function_name.to_snake_case()); + let function_name = struct_def.name.to_string().to_snake_case(); + let fn_name = format_ident!("{}", function_name); let call_struct = quote! { #struct_def From 4d0e392a1ad832e04c7e48d1998ccddf110290cf Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 10:02:16 +0100 Subject: [PATCH 063/216] Fmt --- tests/src/frame/balances.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 9b8fb24f3e..691d0c147c 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -81,7 +81,7 @@ async fn test_basic_transfer() { .find_event::() .unwrap() .unwrap(); - let expected_event = balances::events::Transfer ( + let expected_event = balances::events::Transfer( alice.account_id().clone(), bob.account_id().clone(), 10_000, From a264cf3527db1e2cf48ec682d4515571ee29debf Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 11:09:12 +0100 Subject: [PATCH 064/216] Update node runtime metadata to substrate c000780db --- tests/node_runtime.scale | Bin 297278 -> 299274 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tests/node_runtime.scale b/tests/node_runtime.scale index 36651ca7c312a6532014c35eea1c0e0f761e100b..67f358c9808a623a1bdca77ac65945f05efb07f3 100644 GIT binary patch delta 21759 zcmeHvd3Y4X_Gq1|o=g%Fn2>Ek66inz2_zvKt1Jl+AhIuE4`h<*kbz_-WM+V<7y^PU z#tXJkf`Fi)s32g#1{DRxt0*X_2q-9ULD4G+Dqd00cdC1`fZq3e-}~eJ_2%oDuBtwL zs_InLsk7C*@mR}cPq*B;j6#gMoL-8tkM=q}j&dc}Iona`a+WJjPkx2n=27g#zs|+d z0p_Wjq*$m?-;~Du0V?dA9+DSeE8pPHTB-e;g{I5> zY}4IC9d3_AssQF!*viTj&$J>eoK}XVJ$vTP#t!!K^|=p8tjlk9G6cfZl-M|{JP^T) zY{fGPBk{TAO67FLSzJY=x=FEJLPCQE_^=hb5NWZ;Fy#Y@E#5;6N5~O@;h0R0sbg~D!#{;yian!Cm-HSz zdye!Ll{tzD`BZ%*Ckal~y^=GH;p~aXjR&iGPi~FcW?*Uzq?Pt}IX#uOVvk&EbIV1F z;*=|ua@TCdt}Yq44W~?(L7jqaPP?p>J3JnTbGoe746=p{D0C~fvS}WrvfSasd0nWc z+z&ZT( zupV$(y*=z1xTbCzeiqZ!Bhuk}b=Qbc{C#IcQj2TY)t|}FI1Qjm zIg1qnL9RK@rg^K&Q;I|cwQyuwi(7>FSqT8*Faa^C8%K@{ZURgKRB2Q)1gq(zE(Qf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~sLpezSV( F{{~qSEUN$j From 2eb657a878a452844bdd4b8d758d0cd10bad6edc Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 11:14:03 +0100 Subject: [PATCH 065/216] Download latest substrate release for integration testing --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7b0e555e8e..17258b7094 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,7 +25,7 @@ jobs: - name: download-substrate run: | - curl "https://releases.parity.io/substrate/x86_64-debian:stretch/v3.0.0/substrate/substrate" --output substrate --location + curl "https://releases.parity.io/substrate/x86_64-debian:stretch/latest/substrate/substrate" --output substrate --location chmod +x ./substrate mkdir -p ~/.local/bin mv substrate ~/.local/bin From c89791f62d78a9b646e65f0bc69f19a0bf55fc06 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 12:32:05 +0100 Subject: [PATCH 066/216] Fix event decoding --- src/events.rs | 11 ++++++----- src/rpc.rs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/events.rs b/src/events.rs index 431b25fefc..94217c87c9 100644 --- a/src/events.rs +++ b/src/events.rs @@ -117,6 +117,7 @@ where pub fn decode_events(&self, input: &mut &[u8]) -> Result, Error> { let compact_len = >::decode(input)?; let len = compact_len.0 as usize; + log::debug!("decoding {} events", len); let mut r = Vec::new(); for _ in 0..len { @@ -128,7 +129,7 @@ where let event_metadata = self.metadata.event(pallet_index, event_variant)?; log::debug!( - "received event '{}::{}'", + "decoding event '{}::{}'", event_metadata.pallet(), event_metadata.event(), ); @@ -220,10 +221,10 @@ where } TypeDef::Variant(variant) => { // todo: [AJ] handle if variant is DispatchError? - for v in variant.variants() { - for field in v.fields() { - self.decode_type(field.ty().id(), input, output)?; - } + let variant_index = u8::decode(input)?; + let variant = variant.variants().get(variant_index as usize).unwrap(); // todo: ok_or + for field in variant.fields() { + self.decode_type(field.ty().id(), input, output)?; } Ok(()) } diff --git a/src/rpc.rs b/src/rpc.rs index d1562ab118..ea281c0702 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -175,6 +175,7 @@ impl RpcClient { params: &[JsonValue], ) -> Result { let params = params.into(); + log::debug!("request {}: {:?}", method, params); let data = match self { Self::WebSocket(inner) => { inner.request(method, params).await.map_err(Into::into) @@ -183,7 +184,6 @@ impl RpcClient { #[cfg(feature = "client")] Self::Subxt(inner) => inner.request(method, params).await.map_err(Into::into), }; - log::debug!("{}: {:?}", method, data); data } From 537c6335e258873dad12cf7b920576715c6baa43 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 12:32:22 +0100 Subject: [PATCH 067/216] Remove unused imports --- src/client.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/client.rs b/src/client.rs index bef35619a2..895c1b76dc 100644 --- a/src/client.rs +++ b/src/client.rs @@ -37,7 +37,6 @@ use crate::{ events::EventsDecoder, extrinsic::{ self, - PairSigner, SignedExtra, Signer, UncheckedExtrinsic, @@ -49,11 +48,7 @@ use crate::{ RpcClient, SystemProperties, }, - subscription::{ - EventStorageSubscription, - EventSubscription, - FinalizedEventStorageSubscription, - }, + subscription::EventStorageSubscription, AccountData, BlockNumber, Call, From 73490a398832cde61eb58abce2c9558b1db81a24 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 16:12:18 +0100 Subject: [PATCH 068/216] Fix plain storage access, total_issuance pass --- proc-macro/src/generate_runtime.rs | 6 ++---- tests/src/frame/balances.rs | 24 +++++++++++------------- tests/src/lib.rs | 10 ++++++++++ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 9877290e00..9619e0d815 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -446,13 +446,11 @@ impl RuntimeGenerator { ) -> (TokenStream2, TokenStream2) { let entry_struct_ident = format_ident!("{}", storage_entry.name); let (fields, entry_struct, constructor, key_impl) = match storage_entry.ty { - StorageEntryType::Plain(ty) => { - let ty_path = type_gen.resolve_type_path(ty.id(), &[]); - let fields = vec![(format_ident!("_0"), ty_path)]; + StorageEntryType::Plain(_) => { let entry_struct = quote!( pub struct #entry_struct_ident; ); let constructor = quote!( #entry_struct_ident ); let key_impl = quote!(::subxt::StorageEntryKey::Plain); - (fields, entry_struct, constructor, key_impl) + (vec![], entry_struct, constructor, key_impl) } StorageEntryType::Map { ref key, diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 691d0c147c..bfdb43f478 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -21,8 +21,8 @@ use crate::{ balances, RuntimeApi, }, - test_node_process, TestRuntime, + test_context, }; use codec::{ Decode, @@ -58,9 +58,8 @@ async fn test_basic_transfer() { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let bob_address = bob.account_id().clone().into(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let api = crate::node_runtime::RuntimeApi::::new(client.clone()); + let cxt = test_context().await; + let api = &cxt.api; let alice_pre = api .storage @@ -105,15 +104,14 @@ async fn test_basic_transfer() { assert_eq!(bob_pre.data.free + 10_000, bob_post.data.free); } -// #[async_std::test] -// async fn test_state_total_issuance() { -// env_logger::try_init().ok(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let total_issuance = client.total_issuance(None).await.unwrap(); -// assert_ne!(total_issuance, 0); -// } -// +#[async_std::test] +async fn test_state_total_issuance() { + env_logger::try_init().ok(); + let cxt = test_context().await; + let total_issuance = cxt.api.storage.balances.total_issuance(None).await.unwrap(); + assert_ne!(total_issuance, 0); +} + // #[async_std::test] // async fn test_state_read_free_balance() { // env_logger::try_init().ok(); diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 8a03c75e37..e0f59ce085 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -96,6 +96,16 @@ pub async fn test_node_process() -> TestNodeProcess { test_node_process_with(AccountKeyring::Alice).await } +pub struct TestContext { + node_proc: TestNodeProcess, + api: node_runtime::RuntimeApi, +} + +pub async fn test_context() -> TestContext { + let node_proc = test_node_process_with(AccountKeyring::Alice).await; + let api = node_runtime::RuntimeApi::::new(node_proc.client().clone()); + TestContext { node_proc, api } +} // #[async_std::test] // async fn test_insert_key() { // let test_node_process = test_node_process_with(AccountKeyring::Bob).await; From 4ab94d577ebd1e217fd0749015f678d007dd4b97 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 16:12:57 +0100 Subject: [PATCH 069/216] Fmt --- tests/src/frame/balances.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index bfdb43f478..35a9e7d84d 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -21,8 +21,8 @@ use crate::{ balances, RuntimeApi, }, - TestRuntime, test_context, + TestRuntime, }; use codec::{ Decode, From 9a6c98ce9af7e29dbc97577618c04c13b0fb8e7a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 17:22:36 +0100 Subject: [PATCH 070/216] Restore contracts tests --- tests/src/frame/contracts.rs | 369 ++++++++++++----------------------- tests/src/frame/mod.rs | 1 + tests/src/lib.rs | 2 + 3 files changed, 129 insertions(+), 243 deletions(-) diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index ae7e894262..b8edae39a9 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -16,278 +16,161 @@ //! Implements support for the pallet_contracts module. -use crate::frame::{ - balances::Balances, - system::System, -}; use codec::{ Decode, Encode, }; -/// Gas units are chosen to be represented by u64 so that gas metering -/// instructions can operate on them efficiently. -pub type Gas = u64; - -/// The subset of the `pallet_contracts::Trait` that a client must implement. -#[module] -pub trait Contracts: System + Balances {} - -/// Instantiates a new contract from the supplied `code` optionally transferring -/// some balance. -/// -/// This is the only function that can deploy new code to the chain. -/// -/// Instantiation is executed as follows: -/// -/// - The supplied `code` is instrumented, deployed, and a `code_hash` is created for that code. -/// - If the `code_hash` already exists on the chain the underlying `code` will be shared. -/// - The destination address is computed based on the sender, code_hash and the salt. -/// - The smart-contract account is created at the computed address. -/// - The `endowment` is transferred to the new account. -/// - The `deploy` function is executed in the context of the newly-created account. -#[derive(Clone, Debug, Eq, PartialEq, Call, Encode)] -pub struct InstantiateWithCodeCall<'a, T: Contracts> { - /// The balance to transfer from the `origin` to the newly created contract. - #[codec(compact)] - pub endowment: ::Balance, - /// The gas limit enforced when executing the constructor. - #[codec(compact)] - pub gas_limit: Gas, - /// The contract code to deploy in raw bytes. - pub code: &'a [u8], - /// The input data to pass to the contract constructor. - pub data: &'a [u8], - /// Used for the address derivation. - pub salt: &'a [u8], -} - -/// Instantiates a contract from a previously deployed wasm binary. -/// -/// This function is identical to [`InstantiateWithCodeCall`] but without the -/// code deployment step. Instead, the `code_hash` of an on-chain deployed wasm binary -/// must be supplied. -#[derive(Clone, Debug, Eq, PartialEq, Call, Encode)] -pub struct InstantiateCall<'a, T: Contracts> { - /// The balance to transfer from the `origin` to the newly created contract. - #[codec(compact)] - pub endowment: ::Balance, - /// The gas limit enforced when executing the constructor. - #[codec(compact)] - pub gas_limit: Gas, - /// Code hash of the already deployed on-chain deployed wasm binary. - pub code_hash: &'a ::Hash, - /// Data to initialize the contract with. - pub data: &'a [u8], - /// Used for the address derivation. - pub salt: &'a [u8], -} - -/// Makes a call to an account, optionally transferring some balance. -/// -/// * If the account is a smart-contract account, the associated code will be -/// executed and any value will be transferred. -/// * If the account is a regular account, any value will be transferred. -/// * If no account exists and the call value is not less than `existential_deposit`, -/// a regular account will be created and any value will be transferred. -#[derive(Clone, Debug, PartialEq, Call, Encode)] -pub struct CallCall<'a, T: Contracts> { - /// Address of the contract. - pub dest: &'a ::Address, - /// Value to transfer to the contract. - #[codec(compact)] - pub value: ::Balance, - /// Gas limit. - #[codec(compact)] - pub gas_limit: Gas, - /// Data to send to the contract. - pub data: &'a [u8], -} - -/// Code stored event. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct CodeStoredEvent { - /// Code hash of the contract. - pub code_hash: T::Hash, -} - -/// Instantiated event. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct InstantiatedEvent { - /// Caller that instantiated the contract. - pub caller: ::AccountId, - /// The address of the contract. - pub contract: ::AccountId, -} +use sp_keyring::AccountKeyring; + +use crate::{ + node_runtime::contracts::{ + calls::TransactionApi, + events, + }, + test_context, + Runtime, + TestContext, + TestNodeProcess, + TestRuntime, +}; +use sp_core::sr25519::Pair; +use subxt::{ + Client, + Error, + ExtrinsicSuccess, + PairSigner, +}; -/// Contract execution event. -/// -/// Emitted upon successful execution of a contract, if any contract events were produced. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct ContractExecutionEvent { - /// Caller of the contract. - pub caller: ::AccountId, - /// SCALE encoded contract event data. - pub data: Vec, +struct ContractsTestContext { + cxt: TestContext, + signer: PairSigner, } -#[cfg(test)] -mod tests { - use sp_keyring::AccountKeyring; +impl ContractsTestContext { + async fn init() -> Self { + env_logger::try_init().ok(); - use super::*; - use crate::{ - tests::{ - test_node_process, - TestNodeProcess, - TestRuntime, - }, - Client, - Error, - ExtrinsicSuccess, - PairSigner, - }; - use sp_core::sr25519::Pair; + let cxt = test_context().await; + let signer = PairSigner::new(AccountKeyring::Alice.pair()); - struct TestContext { - node_process: TestNodeProcess, - signer: PairSigner, + Self { cxt, signer } } - impl TestContext { - async fn init() -> Self { - env_logger::try_init().ok(); - - let node_process = test_node_process().await; - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - - TestContext { - node_process, - signer, - } - } + fn contracts_tx(&self) -> &TransactionApi { + &self.cxt.api.tx.contracts + } - async fn instantiate_with_code( - &self, - ) -> Result, Error> { - const CONTRACT: &str = r#" + async fn instantiate_with_code( + &self, + ) -> Result<::Hash, Error> { + const CONTRACT: &str = r#" (module (func (export "call")) (func (export "deploy")) ) "#; - let code = wabt::wat2wasm(CONTRACT).expect("invalid wabt"); - - let result = self - .client() - .instantiate_with_code_and_watch( - &self.signer, - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - &code, - &[], // data - &[], // salt - ) - .await?; - let event = result.code_stored()?.ok_or_else(|| { - Error::Other("Failed to find a CodeStored event".into()) - })?; - log::info!("Code hash: {:?}", event.code_hash); - Ok(event) - } - - async fn instantiate( - &self, - code_hash: &::Hash, - data: &[u8], - salt: &[u8], - ) -> Result, Error> { - // call instantiate extrinsic - let result = self - .client() - .instantiate_and_watch( - &self.signer, - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - code_hash, - data, - salt, - ) - .await?; + let code = wabt::wat2wasm(CONTRACT).expect("invalid wabt"); + + let extrinsic = self.contracts_tx().instantiate_with_code( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + code, + vec![], // data + vec![], // salt + ); + let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; + let event = result + .find_event::()? + .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; - log::info!("Instantiate result: {:?}", result); - let instantiated = result.instantiated()?.ok_or_else(|| { - Error::Other("Failed to find a Instantiated event".into()) - })?; + log::info!("Code hash: {:?}", event.0); + Ok(event.0) + } - Ok(instantiated) - } + async fn instantiate( + &self, + code_hash: ::Hash, + data: Vec, + salt: Vec, + ) -> Result { + // call instantiate extrinsic + let extrinsic = self.contracts_tx().instantiate( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + code_hash, + data, + salt, + ); + let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; - async fn call( - &self, - contract: &::Address, - input_data: &[u8], - ) -> Result, Error> { - let result = self - .client() - .call_and_watch( - &self.signer, - contract, - 0, // value - 500_000_000, // gas_limit - input_data, - ) - .await?; - log::info!("Call result: {:?}", result); - Ok(result) - } + log::info!("Instantiate result: {:?}", result); + let instantiated = result + .find_event::()? + .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - fn client(&self) -> &Client { - self.node_process.client() - } + Ok(instantiated) } - #[async_std::test] - async fn tx_instantiate_with_code() { - let ctx = TestContext::init().await; - let code_stored = ctx.instantiate_with_code().await; - - assert!( - code_stored.is_ok(), - format!( - "Error calling instantiate_with_code and receiving CodeStored Event: {:?}", - code_stored - ) + async fn call( + &self, + contract: ::Address, + input_data: Vec, + ) -> Result, Error> { + let extrinsic = self.contracts_tx().call( + contract, + 0, // value + 500_000_000, // gas_limit + input_data, ); + let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; + log::info!("Call result: {:?}", result); + Ok(result) } +} - #[async_std::test] - async fn tx_instantiate() { - let ctx = TestContext::init().await; - let code_stored = ctx.instantiate_with_code().await.unwrap(); - - let instantiated = ctx.instantiate(&code_stored.code_hash, &[], &[1u8]).await; +#[async_std::test] +async fn tx_instantiate_with_code() { + let ctx = ContractsTestContext::init().await; + let code_stored = ctx.instantiate_with_code().await; + + assert!( + code_stored.is_ok(), + format!( + "Error calling instantiate_with_code and receiving CodeStored Event: {:?}", + code_stored + ) + ); +} - assert!( - instantiated.is_ok(), - format!("Error instantiating contract: {:?}", instantiated) - ); - } +#[async_std::test] +async fn tx_instantiate() { + let ctx = ContractsTestContext::init().await; + let code_stored = ctx.instantiate_with_code().await.unwrap(); + let code_hash = code_stored.0; - #[async_std::test] - async fn tx_call() { - let ctx = TestContext::init().await; - let code_stored = ctx.instantiate_with_code().await.unwrap(); + let instantiated = ctx.instantiate(code_hash.into(), vec![], vec![1u8]).await; - let instantiated = ctx - .instantiate(&code_stored.code_hash.into(), &[], &[1u8]) - .await - .unwrap(); - let executed = ctx.call(&instantiated.contract.into(), &[]).await; + assert!( + instantiated.is_ok(), + format!("Error instantiating contract: {:?}", instantiated) + ); +} - assert!( - executed.is_ok(), - format!("Error calling contract: {:?}", executed) - ); - } +#[async_std::test] +async fn tx_call() { + let ctx = ContractsTestContext::init().await; + let code_hash = ctx.instantiate_with_code().await.unwrap(); + + let instantiated = ctx + .instantiate(code_hash.into(), vec![], vec![1u8]) + .await + .unwrap(); + let contract = instantiated.0; + let executed = ctx.call(contract.into(), vec![]).await; + + assert!( + executed.is_ok(), + format!("Error calling contract: {:?}", executed) + ); } diff --git a/tests/src/frame/mod.rs b/tests/src/frame/mod.rs index b50f09b98b..c987fe5bf4 100644 --- a/tests/src/frame/mod.rs +++ b/tests/src/frame/mod.rs @@ -15,3 +15,4 @@ // along with substrate-subxt. If not, see . mod balances; +mod contracts; diff --git a/tests/src/lib.rs b/tests/src/lib.rs index e0f59ce085..9fb7c3f20c 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -36,6 +36,8 @@ use subxt::{ mod node_runtime { #[subxt(substitute_type = "sp_core::crypto::AccountId32")] use sp_core::crypto::AccountId32; + #[subxt(substitute_type = "primitive_types::H256")] + use sp_core::H256; #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] use sp_runtime::MultiAddress; From 599863e0ace493bd7fb1b5886169585fea98eb1e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 17:33:18 +0100 Subject: [PATCH 071/216] Backoff connecting to substrate node --- tests/src/node_proc.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/src/node_proc.rs b/tests/src/node_proc.rs index 24ef4993a6..7209366ca6 100644 --- a/tests/src/node_proc.rs +++ b/tests/src/node_proc.rs @@ -153,10 +153,11 @@ impl TestNodeProcessBuilder { ) })?; // wait for rpc to be initialized - const MAX_ATTEMPTS: u32 = 10; + const MAX_ATTEMPTS: u32 = 6; let mut attempts = 1; + let mut wait_secs = 1; let client = loop { - thread::sleep(time::Duration::from_secs(1)); + thread::sleep(time::Duration::from_secs(wait_secs)); log::info!( "Connecting to contracts enabled node, attempt {}/{}", attempts, @@ -168,6 +169,7 @@ impl TestNodeProcessBuilder { Err(err) => { if attempts < MAX_ATTEMPTS { attempts += 1; + wait_secs = wait_secs * 2; // backoff continue } break Err(err) From b99685aa3da55eb93185b3e41f156872e1fa6d11 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 17 Sep 2021 17:45:07 +0100 Subject: [PATCH 072/216] Add required TypeInfo impls for local SignedExtension impls --- src/extrinsic/extra.rs | 25 +++++++++++++++++-------- src/lib.rs | 7 ++++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index e386cdf45f..b4281cf388 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -22,6 +22,7 @@ use core::{ fmt::Debug, marker::PhantomData, }; +use scale_info::TypeInfo; use sp_runtime::{ generic::Era, traits::SignedExtension, @@ -44,7 +45,8 @@ pub type Extra = <::Extra as SignedExtra>::Extra; /// returned via `additional_signed()`. /// Ensure the runtime version registered in the transaction is the same as at present. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct CheckSpecVersion( pub PhantomData, /// Local version to be used for `AdditionalSigned` @@ -74,7 +76,8 @@ where /// /// This is modified from the substrate version to allow passing in of the version, which is /// returned via `additional_signed()`. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct CheckTxVersion( pub PhantomData, /// Local version to be used for `AdditionalSigned` @@ -104,7 +107,8 @@ where /// /// This is modified from the substrate version to allow passing in of the genesis hash, which is /// returned via `additional_signed()`. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct CheckGenesis( pub PhantomData, /// Local genesis hash to be used for `AdditionalSigned` @@ -135,7 +139,8 @@ where /// This is modified from the substrate version to allow passing in of the genesis hash, which is /// returned via `additional_signed()`. It assumes therefore `Era::Immortal` (The transaction is /// valid forever) -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct CheckMortality( /// The default structure for the Extra encoding pub (Era, PhantomData), @@ -161,7 +166,8 @@ where } /// Nonce check and increment to give replay protection for transactions. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct CheckNonce(#[codec(compact)] pub T::Index); impl SignedExtension for CheckNonce @@ -181,7 +187,8 @@ where } /// Resource limit check. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct CheckWeight(pub PhantomData); impl SignedExtension for CheckWeight @@ -202,7 +209,8 @@ where /// Require the transactor pay for themselves and maybe include a tip to gain additional priority /// in the queue. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct ChargeTransactionPayment(#[codec(compact)] pub u128); impl SignedExtension for ChargeTransactionPayment { @@ -236,7 +244,8 @@ pub trait SignedExtra: SignedExtension { } /// Default `SignedExtra` for substrate runtimes. -#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug)] +#[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] +#[scale_info(skip_type_params(T))] pub struct DefaultExtra { spec_version: u32, tx_version: u32, diff --git a/src/lib.rs b/src/lib.rs index 51ec4f938a..24cd4f81ce 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -119,9 +119,9 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { type Index: Parameter + Member + Default - // + MaybeDisplay + AtLeast32Bit - + Copy; + + Copy + + scale_info::TypeInfo; /// The block number type used by the runtime. type BlockNumber: Parameter @@ -146,7 +146,8 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { + Copy + std::hash::Hash + AsRef<[u8]> - + AsMut<[u8]>; + + AsMut<[u8]> + + scale_info::TypeInfo; /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). type Hashing: Hash; From f3ae8869f39dbbfa23b77a7db2ee7354d68d0eea Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 20 Sep 2021 10:15:33 +0100 Subject: [PATCH 073/216] Remove unnecessary assert formatting --- tests/src/frame/contracts.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index b8edae39a9..45d5848a19 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -136,10 +136,8 @@ async fn tx_instantiate_with_code() { assert!( code_stored.is_ok(), - format!( - "Error calling instantiate_with_code and receiving CodeStored Event: {:?}", - code_stored - ) + "Error calling instantiate_with_code and receiving CodeStored Event: {:?}", + code_stored ); } @@ -153,7 +151,8 @@ async fn tx_instantiate() { assert!( instantiated.is_ok(), - format!("Error instantiating contract: {:?}", instantiated) + "Error instantiating contract: {:?}", + instantiated ); } @@ -169,8 +168,5 @@ async fn tx_call() { let contract = instantiated.0; let executed = ctx.call(contract.into(), vec![]).await; - assert!( - executed.is_ok(), - format!("Error calling contract: {:?}", executed) - ); + assert!(executed.is_ok(), "Error calling contract: {:?}", executed); } From a5c51afa6cbbb6a4cc0f8ee3e0f77e9962bb4323 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 20 Sep 2021 11:03:29 +0100 Subject: [PATCH 074/216] Fix handling of DispatchError --- src/events.rs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/events.rs b/src/events.rs index 94217c87c9..271c7d7368 100644 --- a/src/events.rs +++ b/src/events.rs @@ -128,12 +128,6 @@ where let event_metadata = self.metadata.event(pallet_index, event_variant)?; - log::debug!( - "decoding event '{}::{}'", - event_metadata.pallet(), - event_metadata.event(), - ); - let mut event_data = Vec::::new(); let mut event_errors = Vec::::new(); let result = self.decode_raw_event( @@ -177,17 +171,28 @@ where output: &mut Vec, errors: &mut Vec, ) -> Result<(), Error> { + log::debug!("Decoding Event '{}::{}'", event_metadata.pallet(), event_metadata.event()); for arg in event_metadata.variant().fields() { + let type_id = arg.ty().id(); if event_metadata.pallet() == "System" && event_metadata.event() == "ExtrinsicFailed" { - let dispatch_error = sp_runtime::DispatchError::decode(input)?; - let runtime_error = - RuntimeError::from_dispatch(&self.metadata, dispatch_error)?; - errors.push(runtime_error) - } else { - self.decode_type(arg.ty().id(), input, output)? + let ty = self + .metadata + .resolve_type(type_id) + .ok_or(MetadataError::TypeNotFound(type_id))?; + + if ty.path().ident() == Some("DispatchError".to_string()) { + let dispatch_error = sp_runtime::DispatchError::decode(input)?; + log::info!("Dispatch Error {:?}", dispatch_error); + dispatch_error.encode_to(output); + let runtime_error = + RuntimeError::from_dispatch(&self.metadata, dispatch_error)?; + errors.push(runtime_error); + continue + } } + self.decode_type(type_id, input, output)? } Ok(()) } From 92f86659f8f1097f8f1942b683949bb2a7f5ba1c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 20 Sep 2021 11:50:36 +0100 Subject: [PATCH 075/216] Refactor contracts tests --- tests/src/frame/contracts.rs | 43 ++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index 45d5848a19..e68eb2bfd1 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -47,6 +47,10 @@ struct ContractsTestContext { signer: PairSigner, } +type Hash = ::Hash; +type Address = ::Address; +type AccountId = ::AccountId; + impl ContractsTestContext { async fn init() -> Self { env_logger::try_init().ok(); @@ -63,7 +67,7 @@ impl ContractsTestContext { async fn instantiate_with_code( &self, - ) -> Result<::Hash, Error> { + ) -> Result<(Hash, AccountId), Error> { const CONTRACT: &str = r#" (module (func (export "call")) @@ -80,20 +84,23 @@ impl ContractsTestContext { vec![], // salt ); let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; - let event = result + let code_stored = result .find_event::()? .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; + let instantiated = result + .find_event::()? + .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - log::info!("Code hash: {:?}", event.0); - Ok(event.0) + log::info!("Code hash: {:?}, Contract address: {:?}", code_stored.0, instantiated.0); + Ok((code_stored.0, instantiated.0)) } async fn instantiate( &self, - code_hash: ::Hash, + code_hash: Hash, data: Vec, salt: Vec, - ) -> Result { + ) -> Result { // call instantiate extrinsic let extrinsic = self.contracts_tx().instantiate( 100_000_000_000_000_000, // endowment @@ -109,16 +116,16 @@ impl ContractsTestContext { .find_event::()? .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - Ok(instantiated) + Ok(instantiated.0) } async fn call( &self, - contract: ::Address, + contract: AccountId, input_data: Vec, ) -> Result, Error> { let extrinsic = self.contracts_tx().call( - contract, + contract.into(), 0, // value 500_000_000, // gas_limit input_data, @@ -132,20 +139,19 @@ impl ContractsTestContext { #[async_std::test] async fn tx_instantiate_with_code() { let ctx = ContractsTestContext::init().await; - let code_stored = ctx.instantiate_with_code().await; + let result = ctx.instantiate_with_code().await; assert!( - code_stored.is_ok(), - "Error calling instantiate_with_code and receiving CodeStored Event: {:?}", - code_stored + result.is_ok(), + "Error calling instantiate_with_code and receiving CodeStored and Instantiated Events: {:?}", + result ); } #[async_std::test] async fn tx_instantiate() { let ctx = ContractsTestContext::init().await; - let code_stored = ctx.instantiate_with_code().await.unwrap(); - let code_hash = code_stored.0; + let (code_hash, _) = ctx.instantiate_with_code().await.unwrap(); let instantiated = ctx.instantiate(code_hash.into(), vec![], vec![1u8]).await; @@ -159,13 +165,8 @@ async fn tx_instantiate() { #[async_std::test] async fn tx_call() { let ctx = ContractsTestContext::init().await; - let code_hash = ctx.instantiate_with_code().await.unwrap(); + let (_, contract) = ctx.instantiate_with_code().await.unwrap(); - let instantiated = ctx - .instantiate(code_hash.into(), vec![], vec![1u8]) - .await - .unwrap(); - let contract = instantiated.0; let executed = ctx.call(contract.into(), vec![]).await; assert!(executed.is_ok(), "Error calling contract: {:?}", executed); From 7da7f56c85868ccb6f138cbaa1f7727dd707ac54 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 20 Sep 2021 12:28:42 +0100 Subject: [PATCH 076/216] Troubleshooting contract not found --- tests/src/frame/contracts.rs | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index e68eb2bfd1..bc26c6ca0f 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -24,9 +24,12 @@ use codec::{ use sp_keyring::AccountKeyring; use crate::{ - node_runtime::contracts::{ - calls::TransactionApi, - events, + node_runtime::{ + contracts::{ + calls::TransactionApi, + events, + }, + RuntimeApi, }, test_context, Runtime, @@ -61,13 +64,16 @@ impl ContractsTestContext { Self { cxt, signer } } + fn api(&self) -> &RuntimeApi { + &self.cxt.api + } + fn contracts_tx(&self) -> &TransactionApi { &self.cxt.api.tx.contracts } - async fn instantiate_with_code( - &self, - ) -> Result<(Hash, AccountId), Error> { + async fn instantiate_with_code(&self) -> Result<(Hash, AccountId), Error> { + log::info!("instantiate_with_code:"); const CONTRACT: &str = r#" (module (func (export "call")) @@ -91,7 +97,9 @@ impl ContractsTestContext { .find_event::()? .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - log::info!("Code hash: {:?}, Contract address: {:?}", code_stored.0, instantiated.0); + log::info!(" Block hash: {:?}", result.block); + log::info!(" Code hash: {:?}", code_stored.0); + log::info!(" Contract address: {:?}", instantiated.0); Ok((code_stored.0, instantiated.0)) } @@ -124,6 +132,7 @@ impl ContractsTestContext { contract: AccountId, input_data: Vec, ) -> Result, Error> { + log::info!("call: {:?}", contract); let extrinsic = self.contracts_tx().call( contract.into(), 0, // value @@ -167,7 +176,15 @@ async fn tx_call() { let ctx = ContractsTestContext::init().await; let (_, contract) = ctx.instantiate_with_code().await.unwrap(); - let executed = ctx.call(contract.into(), vec![]).await; + let contract_info = ctx + .api() + .storage + .contracts + .contract_info_of(contract.clone().into(), None) + .await; + assert!(contract_info.is_ok()); + + let executed = ctx.call(contract, vec![]).await; assert!(executed.is_ok(), "Error calling contract: {:?}", executed); } From 01558f57412bfd9d0da2082441708104d9b13a09 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 22 Sep 2021 11:23:28 +0100 Subject: [PATCH 077/216] Remove more client feature stuff --- src/rpc.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/rpc.rs b/src/rpc.rs index ea281c0702..4c0bc1d1e5 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -150,8 +150,6 @@ pub enum TransactionStatus { Invalid, } -#[cfg(feature = "client")] -use substrate_subxt_client::SubxtClient; /// Rpc client wrapper. /// This is workaround because adding generic types causes the macros to fail. @@ -162,9 +160,6 @@ pub enum RpcClient { /// JSONRPC client HTTP transport. // NOTE: Arc because `HttpClient` is not clone. Http(Arc), - #[cfg(feature = "client")] - /// Embedded substrate node. - Subxt(SubxtClient), } impl RpcClient { @@ -181,8 +176,6 @@ impl RpcClient { inner.request(method, params).await.map_err(Into::into) } Self::Http(inner) => inner.request(method, params).await.map_err(Into::into), - #[cfg(feature = "client")] - Self::Subxt(inner) => inner.request(method, params).await.map_err(Into::into), }; data } @@ -208,13 +201,6 @@ impl RpcClient { ) .into()) } - #[cfg(feature = "client")] - Self::Subxt(inner) => { - inner - .subscribe(subscribe_method, params, unsubscribe_method) - .await - .map_err(Into::into) - } } } } @@ -231,13 +217,6 @@ impl From for RpcClient { } } -#[cfg(feature = "client")] -impl From for RpcClient { - fn from(client: SubxtClient) -> Self { - RpcClient::Subxt(client) - } -} - /// ReadProof struct returned by the RPC /// /// # Note From 020336502652d2dfac6f7c1e2665fa410ad46060 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 22 Sep 2021 13:22:10 +0100 Subject: [PATCH 078/216] Fix dynamic event variant decoding, write consumed index to output --- src/events.rs | 7 ++++++- tests/src/frame/balances.rs | 6 ++++++ tests/src/frame/contracts.rs | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/events.rs b/src/events.rs index 271c7d7368..ec5b9e2e87 100644 --- a/src/events.rs +++ b/src/events.rs @@ -125,6 +125,8 @@ where let phase = Phase::decode(input)?; let pallet_index = input.read_byte()?; let event_variant = input.read_byte()?; + log::debug!("phase {:?}, pallet_index {}, event_variant: {}", phase, pallet_index, event_variant); + log::debug!("remaining input: {}", hex::encode(&input)); let event_metadata = self.metadata.event(pallet_index, event_variant)?; @@ -147,7 +149,9 @@ where }; // topics come after the event data in EventRecord - let _topics = Vec::::decode(input)?; + let topics = Vec::::decode(input)?; + log::debug!("topics: {:?}", topics); + Raw::Event(event) } Err(err) => return Err(err), @@ -227,6 +231,7 @@ where TypeDef::Variant(variant) => { // todo: [AJ] handle if variant is DispatchError? let variant_index = u8::decode(input)?; + variant_index.encode_to(output); let variant = variant.variants().get(variant_index as usize).unwrap(); // todo: ok_or for field in variant.fields() { self.decode_type(field.ty().id(), input, output)?; diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 35a9e7d84d..b4b9b7fb5b 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -19,6 +19,7 @@ use crate::{ node_runtime::{ balances, + system, RuntimeApi, }, test_context, @@ -80,6 +81,11 @@ async fn test_basic_transfer() { .find_event::() .unwrap() .unwrap(); + let _extrinsic_success = result + .find_event::() + .expect("Failed to decode ExtrinisicSuccess".into()) + .expect("Failed to find ExtrinisicSuccess"); + let expected_event = balances::events::Transfer( alice.account_id().clone(), bob.account_id().clone(), diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index bc26c6ca0f..2d94052504 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -29,6 +29,7 @@ use crate::{ calls::TransactionApi, events, }, + system, RuntimeApi, }, test_context, @@ -96,6 +97,9 @@ impl ContractsTestContext { let instantiated = result .find_event::()? .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; + let _extrinsic_success = result + .find_event::()? + .ok_or_else(|| Error::Other("Failed to find a ExtrinsicSuccess event".into()))?; log::info!(" Block hash: {:?}", result.block); log::info!(" Code hash: {:?}", code_stored.0); From 184c0964ca3a68e411eff6400aa7fabce0973963 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 22 Sep 2021 13:22:32 +0100 Subject: [PATCH 079/216] Fmt --- src/events.rs | 13 +++++++++++-- src/lib.rs | 7 +------ src/rpc.rs | 1 - tests/src/frame/contracts.rs | 4 +++- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/events.rs b/src/events.rs index ec5b9e2e87..8a65c3a7b9 100644 --- a/src/events.rs +++ b/src/events.rs @@ -125,7 +125,12 @@ where let phase = Phase::decode(input)?; let pallet_index = input.read_byte()?; let event_variant = input.read_byte()?; - log::debug!("phase {:?}, pallet_index {}, event_variant: {}", phase, pallet_index, event_variant); + log::debug!( + "phase {:?}, pallet_index {}, event_variant: {}", + phase, + pallet_index, + event_variant + ); log::debug!("remaining input: {}", hex::encode(&input)); let event_metadata = self.metadata.event(pallet_index, event_variant)?; @@ -175,7 +180,11 @@ where output: &mut Vec, errors: &mut Vec, ) -> Result<(), Error> { - log::debug!("Decoding Event '{}::{}'", event_metadata.pallet(), event_metadata.event()); + log::debug!( + "Decoding Event '{}::{}'", + event_metadata.pallet(), + event_metadata.event() + ); for arg in event_metadata.variant().fields() { let type_id = arg.ty().id(); if event_metadata.pallet() == "System" diff --git a/src/lib.rs b/src/lib.rs index 24cd4f81ce..0bf71563b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -116,12 +116,7 @@ impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + std::fmt::Deb pub trait Runtime: Clone + Sized + Send + Sync + 'static { /// Account index (aka nonce) type. This stores the number of previous /// transactions associated with a sender account. - type Index: Parameter - + Member - + Default - + AtLeast32Bit - + Copy - + scale_info::TypeInfo; + type Index: Parameter + Member + Default + AtLeast32Bit + Copy + scale_info::TypeInfo; /// The block number type used by the runtime. type BlockNumber: Parameter diff --git a/src/rpc.rs b/src/rpc.rs index 4c0bc1d1e5..30d0f4c115 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -150,7 +150,6 @@ pub enum TransactionStatus { Invalid, } - /// Rpc client wrapper. /// This is workaround because adding generic types causes the macros to fail. #[derive(Clone)] diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index 2d94052504..eb3b7f33a7 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -99,7 +99,9 @@ impl ContractsTestContext { .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; let _extrinsic_success = result .find_event::()? - .ok_or_else(|| Error::Other("Failed to find a ExtrinsicSuccess event".into()))?; + .ok_or_else(|| { + Error::Other("Failed to find a ExtrinsicSuccess event".into()) + })?; log::info!(" Block hash: {:?}", result.block); log::info!(" Code hash: {:?}", code_stored.0); From e7782317819cab680e30d2b3f17e094bcb617d65 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 24 Sep 2021 10:44:17 +0100 Subject: [PATCH 080/216] Use substrate branch with heavy dependency removed --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5fdbd0975b..30a5810cb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,9 +43,9 @@ url = "2.2.1" subxt-proc-macro = { version = "0.1.0", path = "proc-macro" } -sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/" } -sp-rpc = { package = "sp-rpc", git = "https://github.com/paritytech/substrate/" } -sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/" } -sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/" } +sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-rpc = { package = "sp-rpc", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } frame-metadata = "14.0.0" \ No newline at end of file From ba71cc05cdb2a95ba642a53387fa3605466a7525 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 24 Sep 2021 10:51:10 +0100 Subject: [PATCH 081/216] Remove sp-rcp dependency, define types locally --- Cargo.toml | 1 - src/rpc.rs | 32 ++++++++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 30a5810cb7..99a4836e66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,6 @@ url = "2.2.1" subxt-proc-macro = { version = "0.1.0", path = "proc-macro" } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } -sp-rpc = { package = "sp-rpc", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } diff --git a/src/rpc.rs b/src/rpc.rs index 30d0f4c115..596fb0918a 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -55,10 +55,7 @@ use sp_core::{ StorageKey, }, Bytes, -}; -use sp_rpc::{ - list::ListOrValue, - number::NumberOrHex, + U256, }; use sp_runtime::{ generic::{ @@ -86,6 +83,33 @@ use crate::{ Runtime, }; +/// A number type that can be serialized both as a number or a string that encodes a number in a +/// string. +/// +/// We allow two representations of the block number as input. Either we deserialize to the type +/// that is specified in the block type or we attempt to parse given hex value. +/// +/// The primary motivation for having this type is to avoid overflows when using big integers in +/// JavaScript (which we consider as an important RPC API consumer). +#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq)] +#[serde(untagged)] +pub enum NumberOrHex { + /// The number represented directly. + Number(u64), + /// Hex representation of the number. + Hex(U256), +} + +/// RPC list or value wrapper. +#[derive(Serialize, Deserialize, Debug, PartialEq)] +#[serde(untagged)] +pub enum ListOrValue { + /// A list of values of given type. + List(Vec), + /// A single value of given type. + Value(T), +} + pub type ChainBlock = SignedBlock::Header, ::Extrinsic>>; From cadb26f2a2c6e04e41dd0650a563c2a5cd7b3e68 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 24 Sep 2021 15:09:10 +0100 Subject: [PATCH 082/216] Ignore cargo timeing files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 693699042b..001b5bb5c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target **/*.rs.bk Cargo.lock +cargo-timing* From 2766b4024a83fa0e1f3d8b6b8cefaaa0dbaf584b Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 24 Sep 2021 15:09:31 +0100 Subject: [PATCH 083/216] Use my branch for substrate test deps --- tests/Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 90ea2e7190..7df88f6d20 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -8,10 +8,10 @@ subxt = { package = "substrate-subxt", path = ".." } codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } -sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/" } -sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/" } -sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } -sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/" } +sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } assert_matches = "1.5.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } From 1b04411bad74a0dbfe28eb59eee8926e37661835 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 24 Sep 2021 16:00:17 +0100 Subject: [PATCH 084/216] Fix storage key type gen --- proc-macro/src/generate_runtime.rs | 86 +----------------------------- tests/src/frame/contracts.rs | 5 +- tests/src/lib.rs | 2 +- 3 files changed, 5 insertions(+), 88 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 9619e0d815..aafcf9608e 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -512,95 +512,11 @@ impl RuntimeGenerator { }; (fields, entry_struct, constructor, key_impl) } - TypeDef::Composite(composite) => { - // todo: [AJ] extract this pattern also used in ModuleType::composite_fields? - let named = composite.fields().iter().all(|f| f.name().is_some()); - let unnamed = - composite.fields().iter().all(|f| f.name().is_none()); - - if named { - let fields = composite - .fields() - .iter() - .map(|f| { - let field_name = format_ident!( - "{}", - f.name().expect("field is named") - ); - let field_type = - type_gen.resolve_type_path(f.ty().id(), &[]); - (field_name, field_type) - }) - .collect::>(); - let fields_def = - fields.iter().map(|(name, ty)| quote!( pub #name: #ty)); - let entry_struct = quote! { - pub struct #entry_struct_ident { - #( #fields_def, )* - } - }; - let field_names = fields.iter().map(|(name, _)| name); - let constructor = - quote!( #entry_struct_ident { #( #field_names ),* } ); - let keys = fields - .iter() - .zip(hashers) - .map(|((field, _), hasher)| { - quote!( ::subxt::StorageMapKey::new(&self.#field, #hasher) ) - }); - let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ #( #keys ),* ] - ) - }; - (fields, entry_struct, constructor, key_impl) - } else if unnamed { - let fields = composite - .fields() - .iter() - .enumerate() - .map(|(i, f)| { - let field_name = - format_ident!("_{}", syn::Index::from(i)); - let field_type = - type_gen.resolve_type_path(f.ty().id(), &[]); - (field_name, field_type) - }) - .collect::>(); - let fields_def = fields - .iter() - .map(|(_, field_type)| quote!( pub #field_type )); - let entry_struct = quote! { - pub struct #entry_struct_ident( #( #fields_def, )* ); - }; - let field_names = fields.iter().map(|(name, _)| name); - let constructor = - quote!( #entry_struct_ident( #( #field_names ),* ) ); - - let keys = (0..fields.len()) - .into_iter() - .zip(hashers) - .map(|(field, hasher)| { - let index = syn::Index::from(field); - quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) - }); - let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ #( #keys ),* ] - ) - }; - (fields, entry_struct, constructor, key_impl) - } else { - abort_call_site!( - "Fields must be either all named or all unnamed" - ) - } - } _ => { let ty_path = type_gen.resolve_type_path(key.id(), &[]); let fields = vec![(format_ident!("_0"), ty_path.clone())]; let entry_struct = quote! { - pub struct #entry_struct_ident( #ty_path ); + pub struct #entry_struct_ident( pub #ty_path ); }; let constructor = quote!( #entry_struct_ident(_0) ); let hasher = hashers.get(0).unwrap_or_else(|| { diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index eb3b7f33a7..3c4e927563 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -39,6 +39,7 @@ use crate::{ TestRuntime, }; use sp_core::sr25519::Pair; +use sp_runtime::MultiAddress; use subxt::{ Client, Error, @@ -140,7 +141,7 @@ impl ContractsTestContext { ) -> Result, Error> { log::info!("call: {:?}", contract); let extrinsic = self.contracts_tx().call( - contract.into(), + MultiAddress::Id(contract), 0, // value 500_000_000, // gas_limit input_data, @@ -186,7 +187,7 @@ async fn tx_call() { .api() .storage .contracts - .contract_info_of(contract.clone().into(), None) + .contract_info_of(contract.clone(), None) .await; assert!(contract_info.is_ok()); diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 9fb7c3f20c..54bbe1fee9 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -66,7 +66,7 @@ impl Runtime for TestRuntime { impl subxt::AccountData for node_runtime::system::storage::Account { fn new(account_id: ::AccountId) -> Self { - Self(account_id.into()) // todo: [AJ] why is Account.0 a [u8;32] and not AccountId32? + Self(account_id) } fn nonce(result: &::Value) -> ::Index { From af1ec843bd73681129600e5e2875393812849ced Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 27 Sep 2021 09:23:52 +0100 Subject: [PATCH 085/216] Comment out fetching contract info --- tests/src/frame/contracts.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index 3c4e927563..1fbaefb1fc 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -183,13 +183,13 @@ async fn tx_call() { let ctx = ContractsTestContext::init().await; let (_, contract) = ctx.instantiate_with_code().await.unwrap(); - let contract_info = ctx - .api() - .storage - .contracts - .contract_info_of(contract.clone(), None) - .await; - assert!(contract_info.is_ok()); + // let contract_info = ctx + // .api() + // .storage + // .contracts + // .contract_info_of(contract.clone(), None) + // .await; + // assert!(contract_info.is_ok()); let executed = ctx.call(contract, vec![]).await; From c8ebd1cba633927bfa5aa4fac431869c760cdd78 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 27 Sep 2021 13:02:32 +0100 Subject: [PATCH 086/216] Add key iteration, extract storage client from main client --- proc-macro/src/generate_runtime.rs | 2 +- src/client.rs | 79 +------- src/lib.rs | 81 +-------- src/rpc.rs | 4 +- src/storage.rs | 282 +++++++++++++++++++++++++++++ 5 files changed, 298 insertions(+), 150 deletions(-) create mode 100644 src/storage.rs diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index aafcf9608e..bdd1c2556f 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -568,7 +568,7 @@ impl RuntimeGenerator { hash: ::core::option::Option, ) -> ::core::result::Result<#return_ty, ::subxt::Error> { let entry = #constructor; - self.client.fetch_or_default(&entry, hash).await + self.client.storage().fetch_or_default(&entry, hash).await } }; diff --git a/src/client.rs b/src/client.rs index 895c1b76dc..b16427df64 100644 --- a/src/client.rs +++ b/src/client.rs @@ -48,6 +48,7 @@ use crate::{ RpcClient, SystemProperties, }, + storage::{StorageEntry, StorageClient}, subscription::EventStorageSubscription, AccountData, BlockNumber, @@ -57,7 +58,6 @@ use crate::{ Metadata, ReadProof, Runtime, - StorageEntry, }; /// ClientBuilder for constructing a Client. @@ -197,55 +197,6 @@ impl Client { &self.rpc.client } - /// Fetch the value under an unhashed storage key - pub async fn fetch_unhashed( - &self, - key: StorageKey, - hash: Option, - ) -> Result, Error> { - if let Some(data) = self.rpc.storage(&key, hash).await? { - Ok(Some(Decode::decode(&mut &data.0[..])?)) - } else { - Ok(None) - } - } - - /// Fetch a StorageKey with an optional block hash. - pub async fn fetch( - &self, - store: &F, - hash: Option, - ) -> Result, Error> { - let key = store.key().final_key::(); - self.fetch_unhashed::(key, hash).await - } - - /// Fetch a StorageKey that has a default value with an optional block hash. - pub async fn fetch_or_default( - &self, - store: &F, - hash: Option, - ) -> Result { - if let Some(data) = self.fetch(store, hash).await? { - Ok(data) - } else { - let pallet_metadata = self.metadata.pallet(F::PALLET)?; - let storage_metadata = pallet_metadata.storage(F::STORAGE)?; - let default = storage_metadata.default()?; - Ok(default) - } - } - - /// Query historical storage entries - pub async fn query_storage( - &self, - keys: Vec, - from: T::Hash, - to: Option, - ) -> Result>, Error> { - self.rpc.query_storage(keys, from, to).await - } - /// Get a header pub async fn header(&self, hash: Option) -> Result, Error> where @@ -323,14 +274,10 @@ impl Client { Ok(headers) } - /// Creates an unsigned extrinsic. - // pub fn create_unsigned + Send + Sync>( - // &self, - // call: C, - // ) -> Result, Error> { - // let call = self.encode(call)?; - // Ok(extrinsic::create_unsigned::(call)) - // } + /// Create a client for accessing runtime storage + pub fn storage(&self) -> StorageClient { + StorageClient::new(&self.rpc, &self.metadata) + } /// Creates a signed extrinsic. pub async fn create_signed( @@ -348,7 +295,7 @@ impl Client { let account_storage_entry = >::new(signer.account_id().clone()); let account_data = - self.fetch_or_default(&account_storage_entry, None).await?; + self.storage().fetch_or_default(&account_storage_entry, None).await?; >::nonce(&account_data) }; let call = self.encode(call)?; @@ -408,20 +355,6 @@ impl Client { self.submit_extrinsic(extrinsic).await } - /// Submits transaction to the chain and watch for events. - // pub async fn watch + Send + Sync>( - // &self, - // call: C, - // signer: &(dyn Signer + Send + Sync), - // ) -> Result, Error> - // where - // <>::Extra as SignedExtension>::AdditionalSigned: - // Send + Sync, - // { - // let extrinsic = self.create_signed(call, signer).await?; - // self.submit_and_watch_extrinsic(extrinsic).await - // } - /// Insert a key into the keystore. pub async fn insert_key( &self, diff --git a/src/lib.rs b/src/lib.rs index 0bf71563b1..a9eee0c27a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,6 +59,7 @@ mod events; pub mod extrinsic; mod metadata; mod rpc; +pub mod storage; mod subscription; pub use crate::{ @@ -90,6 +91,11 @@ pub use crate::{ RpcClient, SystemProperties, }, + storage::{ + StorageEntry, + StorageEntryKey, + StorageMapKey, + }, subscription::{ EventStorageSubscription, EventSubscription, @@ -198,81 +204,6 @@ pub trait Event: Decode { const EVENT: &'static str; } -/// Storage entry trait. -pub trait StorageEntry { - /// Pallet name. - const PALLET: &'static str; - /// Storage name. - const STORAGE: &'static str; - /// Type of the storage entry value. - type Value: Decode; - /// Get the key data for the storage. - fn key(&self) -> StorageEntryKey; -} - -/// Storage key. -pub enum StorageEntryKey { - /// Plain key. - Plain, - /// Map key(s). - Map(Vec), -} - -impl StorageEntryKey { - /// Construct the final [`sp_core::storage::StorageKey`] for the storage entry. - pub fn final_key(&self) -> sp_core::storage::StorageKey { - let mut bytes = sp_core::twox_128(T::PALLET.as_bytes()).to_vec(); - bytes.extend(&sp_core::twox_128(T::STORAGE.as_bytes())[..]); - if let Self::Map(map_keys) = self { - for map_key in map_keys { - bytes.extend(Self::hash(&map_key.hasher, &map_key.value)) - } - } - sp_core::storage::StorageKey(bytes) - } - - fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { - match hasher { - StorageHasher::Identity => bytes.to_vec(), - StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), - StorageHasher::Blake2_128Concat => { - // copied from substrate Blake2_128Concat::hash since StorageHasher is not public - sp_core::blake2_128(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), - StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), - StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), - StorageHasher::Twox64Concat => { - sp_core::twox_64(bytes) - .iter() - .chain(bytes) - .cloned() - .collect() - } - } - } -} - -/// Storage key for a Map. -pub struct StorageMapKey { - value: Vec, - hasher: StorageHasher, -} - -impl StorageMapKey { - /// Create a new [`StorageMapKey`] with the encoded data and the hasher. - pub fn new(value: &T, hasher: StorageHasher) -> Self { - Self { - value: value.encode(), - hasher, - } - } -} - /// A phase of a block's execution. #[derive(Clone, Debug, Eq, PartialEq, Decode)] pub enum Phase { diff --git a/src/rpc.rs b/src/rpc.rs index 847d35323f..b810a3ebad 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -82,6 +82,7 @@ use crate::{ Metadata, Runtime, }; +use crate::storage::StorageKeyPrefix; /// A number type that can be serialized both as a number or a string that encodes a number in a /// string. @@ -316,11 +317,12 @@ impl Rpc { /// If `start_key` is passed, return next keys in storage in lexicographic order. pub async fn storage_keys_paged( &self, - prefix: Option, + prefix: Option, count: u32, start_key: Option, hash: Option, ) -> Result, Error> { + let prefix = prefix.map(|p| p.to_storage_key()); let params = &[ to_json_value(prefix)?, to_json_value(count)?, diff --git a/src/storage.rs b/src/storage.rs new file mode 100644 index 0000000000..700ed4753a --- /dev/null +++ b/src/storage.rs @@ -0,0 +1,282 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +//! For querying runtime storage. + +use codec::{Encode, Decode}; +use futures::future; +use jsonrpsee_http_client::HttpClientBuilder; +use jsonrpsee_types::Subscription; +use jsonrpsee_ws_client::WsClientBuilder; +use sp_core::{ + storage::{ + StorageChangeSet, + StorageData, + StorageKey, + }, + Bytes, +}; +pub use sp_runtime::traits::SignedExtension; +pub use sp_version::RuntimeVersion; +use std::{ + marker::PhantomData, + sync::Arc, +}; + +use crate::{ + events::EventsDecoder, + extrinsic::{ + self, + SignedExtra, + Signer, + UncheckedExtrinsic, + }, + rpc::{ + ChainBlock, + ExtrinsicSuccess, + Rpc, + RpcClient, + SystemProperties, + }, + subscription::EventStorageSubscription, + AccountData, + BlockNumber, + Call, + Client, + Encoded, + Error, + Metadata, + ReadProof, + Runtime, + StorageHasher, +}; + +/// Storage entry trait. +pub trait StorageEntry { + /// Pallet name. + const PALLET: &'static str; + /// Storage name. + const STORAGE: &'static str; + /// Type of the storage entry value. + type Value: Decode; + /// Get the key data for the storage. + fn key(&self) -> StorageEntryKey; +} + +/// The prefix of the key to a [`StorageEntry`] +pub struct StorageKeyPrefix(Vec); + +impl StorageKeyPrefix { + /// Create the storage key prefix for a [`StorageEntry`] + pub fn new() -> Self { + let mut bytes = sp_core::twox_128(T::PALLET.as_bytes()).to_vec(); + bytes.extend(&sp_core::twox_128(T::STORAGE.as_bytes())[..]); + Self(bytes) + } + + /// Convert the prefix into a [`StorageKey`] + pub fn to_storage_key(self) -> StorageKey { + StorageKey(self.0) + } +} + +/// Storage key. +pub enum StorageEntryKey { + /// Plain key. + Plain, + /// Map key(s). + Map(Vec), +} + +impl StorageEntryKey { + /// Construct the final [`sp_core::storage::StorageKey`] for the storage entry. + pub fn final_key(&self) -> sp_core::storage::StorageKey { + let prefix = StorageKeyPrefix::new::(); + let mut bytes = prefix.0; + if let Self::Map(map_keys) = self { + for map_key in map_keys { + bytes.extend(Self::hash(&map_key.hasher, &map_key.value)) + } + } + sp_core::storage::StorageKey(bytes) + } + + fn hash(hasher: &StorageHasher, bytes: &[u8]) -> Vec { + match hasher { + StorageHasher::Identity => bytes.to_vec(), + StorageHasher::Blake2_128 => sp_core::blake2_128(bytes).to_vec(), + StorageHasher::Blake2_128Concat => { + // copied from substrate Blake2_128Concat::hash since StorageHasher is not public + sp_core::blake2_128(bytes) + .iter() + .chain(bytes) + .cloned() + .collect() + } + StorageHasher::Blake2_256 => sp_core::blake2_256(bytes).to_vec(), + StorageHasher::Twox128 => sp_core::twox_128(bytes).to_vec(), + StorageHasher::Twox256 => sp_core::twox_256(bytes).to_vec(), + StorageHasher::Twox64Concat => { + sp_core::twox_64(bytes) + .iter() + .chain(bytes) + .cloned() + .collect() + } + } + } +} + +/// Storage key for a Map. +pub struct StorageMapKey { + value: Vec, + hasher: StorageHasher, +} + +impl StorageMapKey { + /// Create a new [`StorageMapKey`] with the encoded data and the hasher. + pub fn new(value: &T, hasher: StorageHasher) -> Self { + Self { + value: value.encode(), + hasher, + } + } +} + +/// Client for querying runtime storage. +pub struct StorageClient<'a, T: Runtime> { + rpc: &'a Rpc, + metadata: &'a Metadata, +} + +impl<'a, T: Runtime> StorageClient<'a, T> { + /// Create a new [`StorageClient`] + pub fn new(rpc: &'a Rpc, metadata: &'a Metadata) -> Self { + Self { rpc, metadata } + } + + /// Fetch the value under an unhashed storage key + pub async fn fetch_unhashed( + &self, + key: StorageKey, + hash: Option, + ) -> Result, Error> { + if let Some(data) = self.rpc.storage(&key, hash).await? { + Ok(Some(Decode::decode(&mut &data.0[..])?)) + } else { + Ok(None) + } + } + + /// Fetch a StorageKey with an optional block hash. + pub async fn fetch( + &self, + store: &F, + hash: Option, + ) -> Result, Error> { + let key = store.key().final_key::(); + self.fetch_unhashed::(key, hash).await + } + + /// Fetch a StorageKey that has a default value with an optional block hash. + pub async fn fetch_or_default( + &self, + store: &F, + hash: Option, + ) -> Result { + if let Some(data) = self.fetch(store, hash).await? { + Ok(data) + } else { + let pallet_metadata = self.metadata.pallet(F::PALLET)?; + let storage_metadata = pallet_metadata.storage(F::STORAGE)?; + let default = storage_metadata.default()?; + Ok(default) + } + } + + /// Query historical storage entries + pub async fn query_storage( + &self, + keys: Vec, + from: T::Hash, + to: Option, + ) -> Result>, Error> { + self.rpc.query_storage(keys, from, to).await + } + + /// Fetch up to `count` keys for a storage map in lexicographic order. + /// + /// Supports pagination by passing a value to `start_key`. + pub async fn fetch_keys( + &self, + count: u32, + start_key: Option, + hash: Option, + ) -> Result, Error> { + let prefix = StorageKeyPrefix::new::(); + let keys = self + .rpc + .storage_keys_paged(Some(prefix), count, start_key, hash) + .await?; + Ok(keys) + } +} + +/// Iterates over key value pairs in a map. +pub struct KeyIter<'a, T: Runtime, F: StorageEntry> { + client: StorageClient<'a, T>, + _marker: PhantomData, + count: u32, + hash: T::Hash, + start_key: Option, + buffer: Vec<(StorageKey, StorageData)>, +} + +impl<'a, T: Runtime, F: StorageEntry> KeyIter<'a, T, F> { + /// Returns the next key value pair from a map. + pub async fn next(&mut self) -> Result, Error> { + loop { + if let Some((k, v)) = self.buffer.pop() { + return Ok(Some((k, Decode::decode(&mut &v.0[..])?))) + } else { + let keys = self + .client + .fetch_keys::(self.count, self.start_key.take(), Some(self.hash)) + .await?; + + if keys.is_empty() { + return Ok(None) + } + + self.start_key = keys.last().cloned(); + + let change_sets = self + .client + .rpc + .query_storage_at(&keys, Some(self.hash)) + .await?; + for change_set in change_sets { + for (k, v) in change_set.changes { + if let Some(v) = v { + self.buffer.push((k, v)); + } + } + } + debug_assert_eq!(self.buffer.len(), keys.len()); + } + } + } +} \ No newline at end of file From 0cf8ec7f64c98d34ebf61b395fad217346785429 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 27 Sep 2021 16:54:32 +0100 Subject: [PATCH 087/216] Debugging key generation --- src/storage.rs | 11 ++++++++++- tests/Cargo.toml | 1 + tests/src/frame/contracts.rs | 29 +++++++++++++++++++++++------ tests/src/lib.rs | 7 +++++-- 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/storage.rs b/src/storage.rs index 700ed4753a..7db98204e9 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -181,13 +181,22 @@ impl<'a, T: Runtime> StorageClient<'a, T> { } } + /// Fetch the raw encoded value under the raw storage key. + pub async fn fetch_raw( + &self, + key: StorageKey, + hash: Option, + ) -> Result, Error> { + self.rpc.storage(&key, hash).await + } + /// Fetch a StorageKey with an optional block hash. pub async fn fetch( &self, store: &F, hash: Option, ) -> Result, Error> { - let key = store.key().final_key::(); + let key = store.key().final_key::(); // todo: [AJ] can we factor this type param on final key out self.fetch_unhashed::(key, hash).await } diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 7df88f6d20..d5d967cf4b 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -16,6 +16,7 @@ sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/subs assert_matches = "1.5.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } env_logger = "0.8.3" +hex = "0.4.3" log = "0.4.14" tempdir = "0.3.7" wabt = "0.10.0" diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index 1fbaefb1fc..b72bebd148 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -28,6 +28,7 @@ use crate::{ contracts::{ calls::TransactionApi, events, + storage, }, system, RuntimeApi, @@ -40,12 +41,7 @@ use crate::{ }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; -use subxt::{ - Client, - Error, - ExtrinsicSuccess, - PairSigner, -}; +use subxt::{Client, Error, ExtrinsicSuccess, PairSigner, StorageEntryKey, StorageEntry}; struct ContractsTestContext { cxt: TestContext, @@ -70,6 +66,10 @@ impl ContractsTestContext { &self.cxt.api } + fn client(&self) -> &Client { + &self.cxt.client + } + fn contracts_tx(&self) -> &TransactionApi { &self.cxt.api.tx.contracts } @@ -191,6 +191,23 @@ async fn tx_call() { // .await; // assert!(contract_info.is_ok()); + let contract_info_of = storage::ContractInfoOf(contract.clone()); + let storage_entry_key = ::key(&contract_info_of); + let final_key = storage_entry_key.final_key::(); + println!("contract_info_key key {:?}", hex::encode(&final_key.0)); + + let res = ctx.client().storage().fetch_raw(final_key, None).await.unwrap(); + println!("Result {:?}", res); + + let keys = ctx.client().storage() + .fetch_keys::(5, None, None) + .await + .unwrap() + .iter() + .map(|key| hex::encode(&key.0)) + .collect::>(); + println!("keys post: {:?}", keys); + let executed = ctx.call(contract, vec![]).await; assert!(executed.is_ok(), "Error calling contract: {:?}", executed); diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 54bbe1fee9..e8c63d4538 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -27,6 +27,7 @@ use sp_runtime::{ }; use subxt::{ subxt, + Client, PairSigner, Runtime, StorageEntry, @@ -101,12 +102,14 @@ pub async fn test_node_process() -> TestNodeProcess { pub struct TestContext { node_proc: TestNodeProcess, api: node_runtime::RuntimeApi, + client: Client, } pub async fn test_context() -> TestContext { let node_proc = test_node_process_with(AccountKeyring::Alice).await; - let api = node_runtime::RuntimeApi::::new(node_proc.client().clone()); - TestContext { node_proc, api } + let client = node_proc.client().clone(); + let api = node_runtime::RuntimeApi::::new(client.clone()); + TestContext { node_proc, api, client } } // #[async_std::test] // async fn test_insert_key() { From d68e7dd92ae6c2a20bf11711e980da877fe5bb77 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 27 Sep 2021 17:33:05 +0100 Subject: [PATCH 088/216] Use substrate master branch --- Cargo.toml | 6 +++--- tests/Cargo.toml | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 99a4836e66..72fa4deb3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,8 +43,8 @@ url = "2.2.1" subxt-proc-macro = { version = "0.1.0", path = "proc-macro" } -sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } -sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } -sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "master" } frame-metadata = "14.0.0" \ No newline at end of file diff --git a/tests/Cargo.toml b/tests/Cargo.toml index d5d967cf4b..78b27a6d85 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -8,10 +8,10 @@ subxt = { package = "substrate-subxt", path = ".." } codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } -sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } -sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } -sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } -sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "aj-unused-dependency" } +sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } assert_matches = "1.5.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } From a6f8eb4f66c620e0bfae9d197bbfa3466d64a8d0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 27 Sep 2021 17:43:51 +0100 Subject: [PATCH 089/216] Fix call test --- tests/src/frame/contracts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index b72bebd148..a7ec492adc 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -106,8 +106,8 @@ impl ContractsTestContext { log::info!(" Block hash: {:?}", result.block); log::info!(" Code hash: {:?}", code_stored.0); - log::info!(" Contract address: {:?}", instantiated.0); - Ok((code_stored.0, instantiated.0)) + log::info!(" Contract address: {:?}", instantiated.1); + Ok((code_stored.0, instantiated.1)) } async fn instantiate( From 20aee212c38ced4f98b8151436a34b86f422f787 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 29 Sep 2021 11:58:00 +0100 Subject: [PATCH 090/216] Remove TypeSegmenter and dynclone dependency --- Cargo.toml | 1 - src/events.rs | 37 +------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 72fa4deb3f..6a1853a23b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,6 @@ async-trait = "0.1.49" codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } chameleon = "0.1.0" scale-info = "1.0.0" -dyn-clone = "1.0.3" futures = "0.3.13" hex = "0.4.3" jsonrpsee-proc-macros = "0.3.0" diff --git a/src/events.rs b/src/events.rs index 8a65c3a7b9..51303c55a3 100644 --- a/src/events.rs +++ b/src/events.rs @@ -21,11 +21,7 @@ use codec::{ Encode, Input, }; -use dyn_clone::DynClone; -use std::marker::{ - PhantomData, - Send, -}; +use std::marker::PhantomData; use crate::{ metadata::{ @@ -63,37 +59,6 @@ impl std::fmt::Debug for RawEvent { } } -pub trait TypeSegmenter: DynClone + Send + Sync { - /// Consumes an object from an input stream, and output the serialized bytes. - fn segment(&self, input: &mut &[u8], output: &mut Vec) -> Result<(), Error>; -} - -// derive object safe Clone impl for `Box` -dyn_clone::clone_trait_object!(TypeSegmenter); - -struct TypeMarker(PhantomData); -impl TypeSegmenter for TypeMarker -where - T: Codec + Send + Sync, -{ - fn segment(&self, input: &mut &[u8], output: &mut Vec) -> Result<(), Error> { - T::decode(input).map_err(Error::from)?.encode_to(output); - Ok(()) - } -} - -impl Clone for TypeMarker { - fn clone(&self) -> Self { - Self(Default::default()) - } -} - -impl Default for TypeMarker { - fn default() -> Self { - Self(Default::default()) - } -} - /// Events decoder. #[derive(Debug, Clone)] pub struct EventsDecoder { From 3de28154098d83827066a6afa739215b41284f07 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 29 Sep 2021 12:16:45 +0100 Subject: [PATCH 091/216] Publicly expose Rpc mod --- src/lib.rs | 2 +- src/rpc.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index a9eee0c27a..aef0a9072f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,7 +58,7 @@ mod error; mod events; pub mod extrinsic; mod metadata; -mod rpc; +pub mod rpc; pub mod storage; mod subscription; diff --git a/src/rpc.rs b/src/rpc.rs index b810a3ebad..ccf229776f 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -14,6 +14,8 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . +//! RPC types and client for interacting with a substrate node. + // jsonrpsee subscriptions are interminable. // Allows `while let status = subscription.next().await {}` // Related: https://github.com/paritytech/substrate-subxt/issues/66 @@ -111,6 +113,7 @@ pub enum ListOrValue { Value(T), } +/// Alias for the type of a block returned by `chain_getBlock` pub type ChainBlock = SignedBlock::Header, ::Extrinsic>>; @@ -287,6 +290,7 @@ impl Clone for Rpc { } impl Rpc { + /// Create a new [`Rpc`] for a given runtime. pub fn new(client: RpcClient) -> Self { Self { client, @@ -521,6 +525,7 @@ impl Rpc { Ok(xt_hash) } + /// Create and submit an extrinsic and return a subscription to the events triggered. pub async fn watch_extrinsic( &self, extrinsic: E, From c5ef0faef8b24ed2752378ffb46e64af8627428c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 29 Sep 2021 15:58:38 +0100 Subject: [PATCH 092/216] Unused import warnings --- src/client.rs | 8 ++------ src/storage.rs | 38 +++++--------------------------------- 2 files changed, 7 insertions(+), 39 deletions(-) diff --git a/src/client.rs b/src/client.rs index b16427df64..88c80fe327 100644 --- a/src/client.rs +++ b/src/client.rs @@ -14,16 +14,12 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use codec::Decode; use futures::future; use jsonrpsee_http_client::HttpClientBuilder; use jsonrpsee_types::Subscription; use jsonrpsee_ws_client::WsClientBuilder; use sp_core::{ - storage::{ - StorageChangeSet, - StorageKey, - }, + storage::StorageKey, Bytes, }; pub use sp_runtime::traits::SignedExtension; @@ -48,7 +44,7 @@ use crate::{ RpcClient, SystemProperties, }, - storage::{StorageEntry, StorageClient}, + storage::StorageClient, subscription::EventStorageSubscription, AccountData, BlockNumber, diff --git a/src/storage.rs b/src/storage.rs index 7db98204e9..2e30eabeb7 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -17,49 +17,21 @@ //! For querying runtime storage. use codec::{Encode, Decode}; -use futures::future; -use jsonrpsee_http_client::HttpClientBuilder; -use jsonrpsee_types::Subscription; -use jsonrpsee_ws_client::WsClientBuilder; -use sp_core::{ - storage::{ - StorageChangeSet, - StorageData, - StorageKey, - }, - Bytes, +use sp_core::storage::{ + StorageChangeSet, + StorageData, + StorageKey, }; pub use sp_runtime::traits::SignedExtension; pub use sp_version::RuntimeVersion; use std::{ marker::PhantomData, - sync::Arc, }; use crate::{ - events::EventsDecoder, - extrinsic::{ - self, - SignedExtra, - Signer, - UncheckedExtrinsic, - }, - rpc::{ - ChainBlock, - ExtrinsicSuccess, - Rpc, - RpcClient, - SystemProperties, - }, - subscription::EventStorageSubscription, - AccountData, - BlockNumber, - Call, - Client, - Encoded, + rpc::Rpc, Error, Metadata, - ReadProof, Runtime, StorageHasher, }; From b2f0ddf0fff3c5ddb604fc8cbb244ca17e6b1da4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 29 Sep 2021 17:14:29 +0100 Subject: [PATCH 093/216] Add getter for runtime metadata --- src/metadata.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/metadata.rs b/src/metadata.rs index 1546cc5ef4..765bf8d21c 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -128,6 +128,11 @@ impl Metadata { pub fn resolve_type(&self, id: u32) -> Option<&Type> { self.metadata.types.resolve(id) } + + /// Return the runtime metadata. + pub fn runtime_metadata(&self) -> &RuntimeMetadataLastVersion { + &self.runtime_metadata + } } #[derive(Clone, Debug)] From e8256e029a278e2beb280939cb1cf8b669b77e7f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 29 Sep 2021 17:41:13 +0100 Subject: [PATCH 094/216] Add pallet and event indices for raw events --- src/events.rs | 16 +++++++++++----- src/metadata.rs | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/events.rs b/src/events.rs index 51303c55a3..9df7d53c60 100644 --- a/src/events.rs +++ b/src/events.rs @@ -41,10 +41,14 @@ use scale_info::{ /// Raw bytes for an Event pub struct RawEvent { - /// The name of the pallet from whence the Event originated + /// The name of the pallet from whence the Event originated. pub pallet: String, - /// The name of the Event + /// The index of the pallet from whence the Event originated. + pub pallet_index: u8, + /// The name of the pallet Event variant. pub variant: String, + /// The index of the pallet Event variant. + pub variant_index: u8, /// The raw Event data pub data: Vec, } @@ -89,16 +93,16 @@ where // decode EventRecord let phase = Phase::decode(input)?; let pallet_index = input.read_byte()?; - let event_variant = input.read_byte()?; + let variant_index = input.read_byte()?; log::debug!( "phase {:?}, pallet_index {}, event_variant: {}", phase, pallet_index, - event_variant + variant_index ); log::debug!("remaining input: {}", hex::encode(&input)); - let event_metadata = self.metadata.event(pallet_index, event_variant)?; + let event_metadata = self.metadata.event(pallet_index, variant_index)?; let mut event_data = Vec::::new(); let mut event_errors = Vec::::new(); @@ -114,7 +118,9 @@ where let event = RawEvent { pallet: event_metadata.pallet().to_string(), + pallet_index, variant: event_metadata.event().to_string(), + variant_index, data: event_data, }; diff --git a/src/metadata.rs b/src/metadata.rs index 765bf8d21c..c18346bbda 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -128,10 +128,10 @@ impl Metadata { pub fn resolve_type(&self, id: u32) -> Option<&Type> { self.metadata.types.resolve(id) } - + /// Return the runtime metadata. pub fn runtime_metadata(&self) -> &RuntimeMetadataLastVersion { - &self.runtime_metadata + &self.metadata } } From d0dda2372c9ac4dbcc6d52c744f911432d29e007 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 1 Oct 2021 11:12:27 +0100 Subject: [PATCH 095/216] Add is_call and is_event convenience trait functions --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index aef0a9072f..f88dd07dd4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -194,6 +194,10 @@ pub trait Call: Encode { const PALLET: &'static str; /// Function name. const FUNCTION: &'static str; + + fn is_call(pallet: &str, function: &str) -> bool { + Self::PALLET == pallet && Self::FUNCTION == function + } } /// Event trait. @@ -202,6 +206,10 @@ pub trait Event: Decode { const PALLET: &'static str; /// Event name. const EVENT: &'static str; + + fn is_event(pallet: &str, event: &str) -> bool { + Self::PALLET == pallet && Self::EVENT == event + } } /// A phase of a block's execution. From 6198ac2a61aa642d339e8cf54056afb22e6a3da4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 09:27:46 +0100 Subject: [PATCH 096/216] Add missing docs --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index f88dd07dd4..10066ed054 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -195,6 +195,7 @@ pub trait Call: Encode { /// Function name. const FUNCTION: &'static str; + /// Returns true if the given pallet and function names match this call. fn is_call(pallet: &str, function: &str) -> bool { Self::PALLET == pallet && Self::FUNCTION == function } @@ -207,6 +208,7 @@ pub trait Event: Decode { /// Event name. const EVENT: &'static str; + /// Returns true if the given pallet and event names match this event. fn is_event(pallet: &str, event: &str) -> bool { Self::PALLET == pallet && Self::EVENT == event } From cbbf0e1821efbaf701ad3b38a82da6e1d105e3ce Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 10:12:34 +0100 Subject: [PATCH 097/216] Refactor tests crate --- tests/src/client.rs | 132 ++++++++++++++++++ tests/src/frame/balances.rs | 21 --- tests/src/frame/contracts.rs | 17 +-- tests/src/lib.rs | 210 ++--------------------------- tests/src/runtime.rs | 60 +++++++++ tests/src/utils/context.rs | 59 ++++++++ tests/src/utils/mod.rs | 21 +++ tests/src/{ => utils}/node_proc.rs | 0 8 files changed, 281 insertions(+), 239 deletions(-) create mode 100644 tests/src/client.rs create mode 100644 tests/src/runtime.rs create mode 100644 tests/src/utils/context.rs create mode 100644 tests/src/utils/mod.rs rename tests/src/{ => utils}/node_proc.rs (100%) diff --git a/tests/src/client.rs b/tests/src/client.rs new file mode 100644 index 0000000000..235a7e8e49 --- /dev/null +++ b/tests/src/client.rs @@ -0,0 +1,132 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +pub use crate::{TestRuntime, TestNodeProcess, test_context, test_node_process}; + +use sp_keyring::AccountKeyring; +use sp_runtime::{ + AccountId32, + MultiAddress, +}; +use subxt::PairSigner; + +// #[async_std::test] +// async fn test_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 +// .insert_key( +// "aura".to_string(), +// "//Alice".to_string(), +// public.clone().into(), +// ) +// .await +// .unwrap(); +// assert!(client +// .has_key(public.clone().into(), "aura".to_string()) +// .await +// .unwrap()); +// } + +#[async_std::test] +async fn test_tx_transfer_balance() { + use crate::node_runtime::balances::calls::Transfer; + + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); + + let node_process = test_node_process().await; + let client = node_process.client(); + client + .submit( + Transfer { + dest: dest.clone(), // todo: [AJ] should we make custom types borrowed to avoid clones? + value: 10_000, + }, + &signer, + ) + .await + .unwrap(); +} + +#[async_std::test] +async fn test_getting_hash() { + let node_process = test_node_process().await; + node_process.client().block_hash(None).await.unwrap(); +} + +#[async_std::test] +async fn test_getting_block() { + let node_process = test_node_process().await; + let client = node_process.client(); + let block_hash = client.block_hash(None).await.unwrap(); + client.block(block_hash).await.unwrap(); +} +// #[async_std::test] +// async fn test_getting_read_proof() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let block_hash = client.block_hash(None).await.unwrap(); +// client +// .read_proof( +// vec![ +// StorageKey(well_known_keys::HEAP_PAGES.to_vec()), +// StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), +// ], +// block_hash, +// ) +// .await +// .unwrap(); +// } + +#[async_std::test] +async fn test_chain_subscribe_blocks() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut blocks = client.subscribe_blocks().await.unwrap(); + blocks.next().await.unwrap(); +} + +#[async_std::test] +async fn test_chain_subscribe_finalized_blocks() { + let node_process = test_node_process().await; + let client = node_process.client(); + let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); + blocks.next().await.unwrap(); +} +// #[async_std::test] +// async fn test_fetch_keys() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let keys = client +// .fetch_keys::>(4, None, None) +// .await +// .unwrap(); +// assert_eq!(keys.len(), 4) +// } +// +// #[async_std::test] +// async fn test_iter() { +// let node_process = test_node_process().await; +// let client = node_process.client(); +// let mut iter = client.iter::>(None).await.unwrap(); +// let mut i = 0; +// while let Some(_) = iter.next().await.unwrap() { +// i += 1; +// } +// assert_eq!(i, 13); +// } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index b4b9b7fb5b..5dbe953d23 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -20,37 +20,16 @@ use crate::{ node_runtime::{ balances, system, - RuntimeApi, }, test_context, TestRuntime, }; -use codec::{ - Decode, - Encode, -}; -use core::marker::PhantomData; -use sp_runtime::traits::{ - AtLeast32Bit, - MaybeSerialize, - Member, -}; -use std::fmt::Debug; - -use sp_core::{ - sr25519::Pair, - Pair as _, -}; use sp_keyring::AccountKeyring; use subxt::{ extrinsic::{ PairSigner, Signer, }, - Error, - EventSubscription, - ModuleError, - RuntimeError, }; #[async_std::test] diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index a7ec492adc..e8cb272ec6 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -14,13 +14,6 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -//! Implements support for the pallet_contracts module. - -use codec::{ - Decode, - Encode, -}; - use sp_keyring::AccountKeyring; use crate::{ @@ -31,17 +24,14 @@ use crate::{ storage, }, system, - RuntimeApi, }, test_context, - Runtime, TestContext, - TestNodeProcess, TestRuntime, }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; -use subxt::{Client, Error, ExtrinsicSuccess, PairSigner, StorageEntryKey, StorageEntry}; +use subxt::{Client, Error, ExtrinsicSuccess, PairSigner, Runtime, StorageEntry}; struct ContractsTestContext { cxt: TestContext, @@ -49,7 +39,6 @@ struct ContractsTestContext { } type Hash = ::Hash; -type Address = ::Address; type AccountId = ::AccountId; impl ContractsTestContext { @@ -62,10 +51,6 @@ impl ContractsTestContext { Self { cxt, signer } } - fn api(&self) -> &RuntimeApi { - &self.cxt.api - } - fn client(&self) -> &Client { &self.cxt.client } diff --git a/tests/src/lib.rs b/tests/src/lib.rs index e8c63d4538..750de0dcb4 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -14,207 +14,13 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -mod frame; -mod node_proc; - -pub use node_proc::TestNodeProcess; - -use sp_keyring::AccountKeyring; -use sp_runtime::{ - traits::BlakeTwo256, - AccountId32, - MultiAddress, -}; -use subxt::{ - subxt, - Client, - PairSigner, - Runtime, - StorageEntry, -}; - -#[subxt(runtime_metadata_path = "node_runtime.scale")] -mod node_runtime { - #[subxt(substitute_type = "sp_core::crypto::AccountId32")] - use sp_core::crypto::AccountId32; - #[subxt(substitute_type = "primitive_types::H256")] - use sp_core::H256; - #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] - use sp_runtime::MultiAddress; - - #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] - use sp_arithmetic::per_things::Perbill; - #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] - use sp_arithmetic::per_things::Perquintill; -} - -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct TestRuntime; - -impl Runtime for TestRuntime { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; - type AccountId = sp_runtime::AccountId32; - type Address = sp_runtime::MultiAddress; - type Header = sp_runtime::generic::Header; - type Extra = subxt::extrinsic::DefaultExtra; - type Signature = sp_runtime::MultiSignature; - type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = node_runtime::system::storage::Account; -} - -impl subxt::AccountData for node_runtime::system::storage::Account { - fn new(account_id: ::AccountId) -> Self { - Self(account_id) - } - - fn nonce(result: &::Value) -> ::Index { - result.nonce - } -} - -/// substrate node should be installed on the $PATH -const SUBSTRATE_NODE_PATH: &str = "substrate"; - -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/substrate-subxt/tree/master#integration-testing") - } - SUBSTRATE_NODE_PATH.to_string() - }); +mod runtime; +mod utils; - let proc = TestNodeProcess::::build(path.as_str()) - .with_authority(key) - .scan_for_open_ports() - .spawn::() - .await; - proc.unwrap() -} - -pub async fn test_node_process() -> TestNodeProcess { - test_node_process_with(AccountKeyring::Alice).await -} - -pub struct TestContext { - node_proc: TestNodeProcess, - api: node_runtime::RuntimeApi, - client: Client, -} - -pub async fn test_context() -> TestContext { - let node_proc = test_node_process_with(AccountKeyring::Alice).await; - let client = node_proc.client().clone(); - let api = node_runtime::RuntimeApi::::new(client.clone()); - TestContext { node_proc, api, client } -} -// #[async_std::test] -// async fn test_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 -// .insert_key( -// "aura".to_string(), -// "//Alice".to_string(), -// public.clone().into(), -// ) -// .await -// .unwrap(); -// assert!(client -// .has_key(public.clone().into(), "aura".to_string()) -// .await -// .unwrap()); -// } - -#[async_std::test] -async fn test_tx_transfer_balance() { - use crate::node_runtime::balances::calls::Transfer; - - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); - - let node_process = test_node_process().await; - let client = node_process.client(); - client - .submit( - Transfer { - dest: dest.clone(), // todo: [AJ] should we make custom types borrowed to avoid clones? - value: 10_000, - }, - &signer, - ) - .await - .unwrap(); -} - -#[async_std::test] -async fn test_getting_hash() { - let node_process = test_node_process().await; - node_process.client().block_hash(None).await.unwrap(); -} - -#[async_std::test] -async fn test_getting_block() { - let node_process = test_node_process().await; - let client = node_process.client(); - let block_hash = client.block_hash(None).await.unwrap(); - client.block(block_hash).await.unwrap(); -} -// #[async_std::test] -// async fn test_getting_read_proof() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let block_hash = client.block_hash(None).await.unwrap(); -// client -// .read_proof( -// vec![ -// StorageKey(well_known_keys::HEAP_PAGES.to_vec()), -// StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), -// ], -// block_hash, -// ) -// .await -// .unwrap(); -// } - -#[async_std::test] -async fn test_chain_subscribe_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.subscribe_blocks().await.unwrap(); - blocks.next().await.unwrap(); -} +#[cfg(test)] +mod client; +#[cfg(test)] +mod frame; -#[async_std::test] -async fn test_chain_subscribe_finalized_blocks() { - let node_process = test_node_process().await; - let client = node_process.client(); - let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); - blocks.next().await.unwrap(); -} -// #[async_std::test] -// async fn test_fetch_keys() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let keys = client -// .fetch_keys::>(4, None, None) -// .await -// .unwrap(); -// assert_eq!(keys.len(), 4) -// } -// -// #[async_std::test] -// async fn test_iter() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let mut iter = client.iter::>(None).await.unwrap(); -// let mut i = 0; -// while let Some(_) = iter.next().await.unwrap() { -// i += 1; -// } -// assert_eq!(i, 13); -// } +pub use utils::*; +pub use runtime::{TestRuntime, node_runtime}; diff --git a/tests/src/runtime.rs b/tests/src/runtime.rs new file mode 100644 index 0000000000..7bd00eb637 --- /dev/null +++ b/tests/src/runtime.rs @@ -0,0 +1,60 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use sp_runtime::traits::BlakeTwo256; +use subxt::{Runtime, StorageEntry, subxt}; + +#[subxt(runtime_metadata_path = "node_runtime.scale")] +pub mod node_runtime { + #[subxt(substitute_type = "sp_core::crypto::AccountId32")] + use sp_core::crypto::AccountId32; + #[subxt(substitute_type = "primitive_types::H256")] + use sp_core::H256; + #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] + use sp_runtime::MultiAddress; + + #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] + use sp_arithmetic::per_things::Perbill; + #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] + use sp_arithmetic::per_things::Perquintill; +} + +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct TestRuntime; + +impl Runtime for TestRuntime { + type Index = u32; + type BlockNumber = u32; + type Hash = sp_core::H256; + type Hashing = BlakeTwo256; + type AccountId = sp_runtime::AccountId32; + type Address = sp_runtime::MultiAddress; + type Header = sp_runtime::generic::Header; + type Extra = subxt::extrinsic::DefaultExtra; + type Signature = sp_runtime::MultiSignature; + type Extrinsic = sp_runtime::OpaqueExtrinsic; + type AccountData = node_runtime::system::storage::Account; +} + +impl subxt::AccountData for node_runtime::system::storage::Account { + fn new(account_id: ::AccountId) -> Self { + Self(account_id) + } + + fn nonce(result: &::Value) -> ::Index { + result.nonce + } +} diff --git a/tests/src/utils/context.rs b/tests/src/utils/context.rs new file mode 100644 index 0000000000..11ad398711 --- /dev/null +++ b/tests/src/utils/context.rs @@ -0,0 +1,59 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +pub use crate::{ + TestNodeProcess, TestRuntime, node_runtime, +}; + +use sp_keyring::AccountKeyring; +use subxt::Client; + +/// substrate node should be installed on the $PATH +const SUBSTRATE_NODE_PATH: &str = "substrate"; + +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/substrate-subxt/tree/master#integration-testing") + } + SUBSTRATE_NODE_PATH.to_string() + }); + + let proc = TestNodeProcess::::build(path.as_str()) + .with_authority(key) + .scan_for_open_ports() + .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, + pub client: Client, +} + +pub async fn test_context() -> TestContext { + let node_proc = test_node_process_with(AccountKeyring::Alice).await; + let client = node_proc.client().clone(); + let api = node_runtime::RuntimeApi::::new(client.clone()); + TestContext { node_proc, api, client } +} \ No newline at end of file diff --git a/tests/src/utils/mod.rs b/tests/src/utils/mod.rs new file mode 100644 index 0000000000..21f3083501 --- /dev/null +++ b/tests/src/utils/mod.rs @@ -0,0 +1,21 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +mod node_proc; +mod context; + +pub use node_proc::TestNodeProcess; +pub use context::*; \ No newline at end of file diff --git a/tests/src/node_proc.rs b/tests/src/utils/node_proc.rs similarity index 100% rename from tests/src/node_proc.rs rename to tests/src/utils/node_proc.rs From 76d7b112386d1225126e6e8ad4ed9edceca74edf Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 12:47:24 +0100 Subject: [PATCH 098/216] Restore remaining client tests --- src/client.rs | 8 +-- src/storage.rs | 28 ++++++++- tests/src/client.rs | 143 +++++++++++++++++++------------------------- 3 files changed, 92 insertions(+), 87 deletions(-) diff --git a/src/client.rs b/src/client.rs index 88c80fe327..bed834084f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -140,7 +140,7 @@ impl ClientBuilder { properties: properties.unwrap_or_else(|_| Default::default()), runtime_version: runtime_version?, _marker: PhantomData, - page_size: self.page_size.unwrap_or(10), + iter_page_size: self.page_size.unwrap_or(10), }) } } @@ -154,7 +154,7 @@ pub struct Client { properties: SystemProperties, runtime_version: RuntimeVersion, _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, - page_size: u32, + iter_page_size: u32, } impl Clone for Client { @@ -167,7 +167,7 @@ impl Clone for Client { properties: self.properties.clone(), runtime_version: self.runtime_version.clone(), _marker: PhantomData, - page_size: self.page_size, + iter_page_size: self.iter_page_size, } } } @@ -272,7 +272,7 @@ impl Client { /// Create a client for accessing runtime storage pub fn storage(&self) -> StorageClient { - StorageClient::new(&self.rpc, &self.metadata) + StorageClient::new(&self.rpc, &self.metadata, self.iter_page_size) } /// Creates a signed extrinsic. diff --git a/src/storage.rs b/src/storage.rs index 2e30eabeb7..8f795d84a4 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -129,15 +129,17 @@ impl StorageMapKey { } /// Client for querying runtime storage. +#[derive(Clone)] pub struct StorageClient<'a, T: Runtime> { rpc: &'a Rpc, metadata: &'a Metadata, + iter_page_size: u32, } impl<'a, T: Runtime> StorageClient<'a, T> { /// Create a new [`StorageClient`] - pub fn new(rpc: &'a Rpc, metadata: &'a Metadata) -> Self { - Self { rpc, metadata } + pub fn new(rpc: &'a Rpc, metadata: &'a Metadata, iter_page_size: u32) -> Self { + Self { rpc, metadata, iter_page_size } } /// Fetch the value under an unhashed storage key @@ -214,6 +216,28 @@ impl<'a, T: Runtime> StorageClient<'a, T> { .await?; Ok(keys) } + + /// Returns an iterator of key value pairs. + pub async fn iter( + &self, + hash: Option, + ) -> Result, Error> { + let hash = if let Some(hash) = hash { + hash + } else { + self.rpc.block_hash(None) + .await? + .expect("didn't pass a block number; qed") + }; + Ok(KeyIter { + client: self.clone(), + hash, + count: self.iter_page_size, + start_key: None, + buffer: Default::default(), + _marker: PhantomData, + }) + } } /// Iterates over key value pairs in a map. diff --git a/tests/src/client.rs b/tests/src/client.rs index 235a7e8e49..e0bbf83a33 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -14,87 +14,66 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -pub use crate::{TestRuntime, TestNodeProcess, test_context, test_node_process}; +Respub use crate::{TestRuntime, TestNodeProcess, runtime::node_runtime::system, test_context, test_node_process, test_node_process_with}; -use sp_keyring::AccountKeyring; -use sp_runtime::{ - AccountId32, - MultiAddress, +use sp_core::storage::{ + well_known_keys, + StorageKey, }; -use subxt::PairSigner; - -// #[async_std::test] -// async fn test_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 -// .insert_key( -// "aura".to_string(), -// "//Alice".to_string(), -// public.clone().into(), -// ) -// .await -// .unwrap(); -// assert!(client -// .has_key(public.clone().into(), "aura".to_string()) -// .await -// .unwrap()); -// } +use sp_keyring::AccountKeyring; #[async_std::test] -async fn test_tx_transfer_balance() { - use crate::node_runtime::balances::calls::Transfer; - - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let dest: MultiAddress = AccountKeyring::Bob.to_account_id().into(); - - let node_process = test_node_process().await; - let client = node_process.client(); +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 - .submit( - Transfer { - dest: dest.clone(), // todo: [AJ] should we make custom types borrowed to avoid clones? - value: 10_000, - }, - &signer, + .insert_key( + "aura".to_string(), + "//Alice".to_string(), + public.clone().into(), ) .await .unwrap(); + assert!(client + .has_key(public.clone().into(), "aura".to_string()) + .await + .unwrap()); } #[async_std::test] -async fn test_getting_hash() { +async fn fetch_block_hash() { let node_process = test_node_process().await; node_process.client().block_hash(None).await.unwrap(); } #[async_std::test] -async fn test_getting_block() { +async fn fetch_block() { let node_process = test_node_process().await; let client = node_process.client(); let block_hash = client.block_hash(None).await.unwrap(); client.block(block_hash).await.unwrap(); } -// #[async_std::test] -// async fn test_getting_read_proof() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let block_hash = client.block_hash(None).await.unwrap(); -// client -// .read_proof( -// vec![ -// StorageKey(well_known_keys::HEAP_PAGES.to_vec()), -// StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), -// ], -// block_hash, -// ) -// .await -// .unwrap(); -// } #[async_std::test] -async fn test_chain_subscribe_blocks() { +async fn fetch_read_proof() { + let node_process = test_node_process().await; + let client = node_process.client(); + let block_hash = client.block_hash(None).await.unwrap(); + client + .read_proof( + vec![ + StorageKey(well_known_keys::HEAP_PAGES.to_vec()), + StorageKey(well_known_keys::EXTRINSIC_INDEX.to_vec()), + ], + block_hash, + ) + .await + .unwrap(); +} + +#[async_std::test] +async fn chain_subscribe_blocks() { let node_process = test_node_process().await; let client = node_process.client(); let mut blocks = client.subscribe_blocks().await.unwrap(); @@ -102,31 +81,33 @@ async fn test_chain_subscribe_blocks() { } #[async_std::test] -async fn test_chain_subscribe_finalized_blocks() { +async fn chain_subscribe_finalized_blocks() { let node_process = test_node_process().await; let client = node_process.client(); let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); blocks.next().await.unwrap(); } -// #[async_std::test] -// async fn test_fetch_keys() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let keys = client -// .fetch_keys::>(4, None, None) -// .await -// .unwrap(); -// assert_eq!(keys.len(), 4) -// } -// -// #[async_std::test] -// async fn test_iter() { -// let node_process = test_node_process().await; -// let client = node_process.client(); -// let mut iter = client.iter::>(None).await.unwrap(); -// let mut i = 0; -// while let Some(_) = iter.next().await.unwrap() { -// i += 1; -// } -// assert_eq!(i, 13); -// } + +#[async_std::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) +} + +#[async_std::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 let Some(_) = iter.next().await.unwrap() { + i += 1; + } + assert_eq!(i, 13); +} From c86a9ce261a8f8d45ca65c9762ec66535537742c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 12:48:08 +0100 Subject: [PATCH 099/216] Fmt --- src/client.rs | 6 ++++-- src/rpc.rs | 2 +- src/storage.rs | 20 +++++++++++++------- tests/src/client.rs | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/client.rs b/src/client.rs index bed834084f..24eaef3cb2 100644 --- a/src/client.rs +++ b/src/client.rs @@ -290,8 +290,10 @@ impl Client { } else { let account_storage_entry = >::new(signer.account_id().clone()); - let account_data = - self.storage().fetch_or_default(&account_storage_entry, None).await?; + let account_data = self + .storage() + .fetch_or_default(&account_storage_entry, None) + .await?; >::nonce(&account_data) }; let call = self.encode(call)?; diff --git a/src/rpc.rs b/src/rpc.rs index ccf229776f..64d1c8e89a 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -74,6 +74,7 @@ use crate::{ EventsDecoder, RawEvent, }, + storage::StorageKeyPrefix, subscription::{ EventStorageSubscription, EventSubscription, @@ -84,7 +85,6 @@ use crate::{ Metadata, Runtime, }; -use crate::storage::StorageKeyPrefix; /// A number type that can be serialized both as a number or a string that encodes a number in a /// string. diff --git a/src/storage.rs b/src/storage.rs index 8f795d84a4..146df72ac8 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -16,7 +16,10 @@ //! For querying runtime storage. -use codec::{Encode, Decode}; +use codec::{ + Decode, + Encode, +}; use sp_core::storage::{ StorageChangeSet, StorageData, @@ -24,9 +27,7 @@ use sp_core::storage::{ }; pub use sp_runtime::traits::SignedExtension; pub use sp_version::RuntimeVersion; -use std::{ - marker::PhantomData, -}; +use std::marker::PhantomData; use crate::{ rpc::Rpc, @@ -139,7 +140,11 @@ pub struct StorageClient<'a, T: Runtime> { impl<'a, T: Runtime> StorageClient<'a, T> { /// Create a new [`StorageClient`] pub fn new(rpc: &'a Rpc, metadata: &'a Metadata, iter_page_size: u32) -> Self { - Self { rpc, metadata, iter_page_size } + Self { + rpc, + metadata, + iter_page_size, + } } /// Fetch the value under an unhashed storage key @@ -225,7 +230,8 @@ impl<'a, T: Runtime> StorageClient<'a, T> { let hash = if let Some(hash) = hash { hash } else { - self.rpc.block_hash(None) + self.rpc + .block_hash(None) .await? .expect("didn't pass a block number; qed") }; @@ -284,4 +290,4 @@ impl<'a, T: Runtime, F: StorageEntry> KeyIter<'a, T, F> { } } } -} \ No newline at end of file +} diff --git a/tests/src/client.rs b/tests/src/client.rs index e0bbf83a33..3189e1f91a 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -Respub use crate::{TestRuntime, TestNodeProcess, runtime::node_runtime::system, test_context, test_node_process, test_node_process_with}; +use crate::{TestRuntime, TestNodeProcess, runtime::node_runtime::system, test_context, test_node_process, test_node_process_with}; use sp_core::storage::{ well_known_keys, From d439722d632c23c5eb96b1eee2a4c00ed517bd74 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 12:50:28 +0100 Subject: [PATCH 100/216] Fix warnings --- tests/src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/client.rs b/tests/src/client.rs index 3189e1f91a..bc71adf8c0 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::{TestRuntime, TestNodeProcess, runtime::node_runtime::system, test_context, test_node_process, test_node_process_with}; +use crate::{runtime::node_runtime::system, test_node_process, test_node_process_with}; use sp_core::storage::{ well_known_keys, From 997d6b77d7c9ffa6d20f0cc949132d0d3c17ace2 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 13:03:17 +0100 Subject: [PATCH 101/216] Restore get_mod as test helper and fmt --- proc-macro/src/generate_types.rs | 70 +++++++++++++++++++------------- tests/src/client.rs | 12 +++++- tests/src/frame/balances.rs | 8 ++-- tests/src/frame/contracts.rs | 23 +++++++++-- tests/src/lib.rs | 5 ++- tests/src/runtime.rs | 6 ++- tests/src/utils/context.rs | 12 ++++-- tests/src/utils/mod.rs | 4 +- 8 files changed, 94 insertions(+), 46 deletions(-) diff --git a/proc-macro/src/generate_types.rs b/proc-macro/src/generate_types.rs index da84a913b8..4170ceec4b 100644 --- a/proc-macro/src/generate_types.rs +++ b/proc-macro/src/generate_types.rs @@ -703,6 +703,20 @@ mod tests { const MOD_PATH: &'static [&'static str] = &["chameleon_core", "generate_types", "tests"]; + fn get_mod<'a>( + module: &'a Module, + path_segs: &[&'static str], + ) -> Option<&'a Module<'a>> { + let (mod_name, rest) = path_segs.split_first()?; + let mod_ident = Ident::new(mod_name, Span::call_site()); + let module = module.children.get(&mod_ident)?; + if rest.is_empty() { + Some(module) + } else { + get_mod(module, rest) + } + } + #[test] fn generate_struct_with_primitives() { #[allow(unused)] @@ -717,9 +731,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -758,9 +772,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -798,9 +812,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -833,9 +847,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -866,9 +880,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -898,9 +912,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -935,9 +949,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -970,9 +984,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -1003,9 +1017,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -1042,9 +1056,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -1085,9 +1099,9 @@ mod tests { registry.register_type(&meta_type::>()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -1132,9 +1146,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -1180,9 +1194,9 @@ mod tests { registry.register_type(&meta_type::>()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), @@ -1235,9 +1249,9 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root"); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); let types = type_gen.generate_types_mod(); - let tests_mod = types.get_mod(MOD_PATH).unwrap(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); assert_eq!( tests_mod.into_token_stream().to_string(), diff --git a/tests/src/client.rs b/tests/src/client.rs index bc71adf8c0..8f42bedecf 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -14,7 +14,11 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::{runtime::node_runtime::system, test_node_process, test_node_process_with}; +use crate::{ + runtime::node_runtime::system, + test_node_process, + test_node_process_with, +}; use sp_core::storage::{ well_known_keys, @@ -104,7 +108,11 @@ async fn fetch_keys() { 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 iter = client + .storage() + .iter::(None) + .await + .unwrap(); let mut i = 0; while let Some(_) = iter.next().await.unwrap() { i += 1; diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 5dbe953d23..0244af3fd9 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -25,11 +25,9 @@ use crate::{ TestRuntime, }; use sp_keyring::AccountKeyring; -use subxt::{ - extrinsic::{ - PairSigner, - Signer, - }, +use subxt::extrinsic::{ + PairSigner, + Signer, }; #[async_std::test] diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index e8cb272ec6..d8637302fc 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -31,7 +31,14 @@ use crate::{ }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; -use subxt::{Client, Error, ExtrinsicSuccess, PairSigner, Runtime, StorageEntry}; +use subxt::{ + Client, + Error, + ExtrinsicSuccess, + PairSigner, + Runtime, + StorageEntry, +}; struct ContractsTestContext { cxt: TestContext, @@ -177,14 +184,22 @@ async fn tx_call() { // assert!(contract_info.is_ok()); let contract_info_of = storage::ContractInfoOf(contract.clone()); - let storage_entry_key = ::key(&contract_info_of); + let storage_entry_key = + ::key(&contract_info_of); let final_key = storage_entry_key.final_key::(); println!("contract_info_key key {:?}", hex::encode(&final_key.0)); - let res = ctx.client().storage().fetch_raw(final_key, None).await.unwrap(); + let res = ctx + .client() + .storage() + .fetch_raw(final_key, None) + .await + .unwrap(); println!("Result {:?}", res); - let keys = ctx.client().storage() + let keys = ctx + .client() + .storage() .fetch_keys::(5, None, None) .await .unwrap() diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 750de0dcb4..8a859b315a 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -22,5 +22,8 @@ mod client; #[cfg(test)] mod frame; +pub use runtime::{ + node_runtime, + TestRuntime, +}; pub use utils::*; -pub use runtime::{TestRuntime, node_runtime}; diff --git a/tests/src/runtime.rs b/tests/src/runtime.rs index 7bd00eb637..3b07a131be 100644 --- a/tests/src/runtime.rs +++ b/tests/src/runtime.rs @@ -15,7 +15,11 @@ // along with substrate-subxt. If not, see . use sp_runtime::traits::BlakeTwo256; -use subxt::{Runtime, StorageEntry, subxt}; +use subxt::{ + subxt, + Runtime, + StorageEntry, +}; #[subxt(runtime_metadata_path = "node_runtime.scale")] pub mod node_runtime { diff --git a/tests/src/utils/context.rs b/tests/src/utils/context.rs index 11ad398711..f08bf86b85 100644 --- a/tests/src/utils/context.rs +++ b/tests/src/utils/context.rs @@ -15,7 +15,9 @@ // along with substrate-subxt. If not, see . pub use crate::{ - TestNodeProcess, TestRuntime, node_runtime, + node_runtime, + TestNodeProcess, + TestRuntime, }; use sp_keyring::AccountKeyring; @@ -55,5 +57,9 @@ pub async fn test_context() -> TestContext { let node_proc = test_node_process_with(AccountKeyring::Alice).await; let client = node_proc.client().clone(); let api = node_runtime::RuntimeApi::::new(client.clone()); - TestContext { node_proc, api, client } -} \ No newline at end of file + TestContext { + node_proc, + api, + client, + } +} diff --git a/tests/src/utils/mod.rs b/tests/src/utils/mod.rs index 21f3083501..0f5f98917f 100644 --- a/tests/src/utils/mod.rs +++ b/tests/src/utils/mod.rs @@ -14,8 +14,8 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -mod node_proc; mod context; +mod node_proc; +pub use context::*; pub use node_proc::TestNodeProcess; -pub use context::*; \ No newline at end of file From 44ec197187778a7c07ae9db3a32a1437865cbf11 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 16:30:57 +0100 Subject: [PATCH 102/216] Use client references for api calls --- proc-macro/src/generate_runtime.rs | 97 +++++++++++++++--------------- src/client.rs | 8 +-- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index bdd1c2556f..c17a6899a4 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -128,16 +128,16 @@ impl RuntimeGenerator { use super::#types_mod_ident; #( #call_structs )* - pub struct TransactionApi { - client: ::std::sync::Arc<::subxt::Client>, + pub struct TransactionApi<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, } - impl TransactionApi + impl<'a, T: ::subxt::Runtime> TransactionApi<'a, T> where <>::Extra as ::subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: Send + Sync { - pub fn new(client: ::std::sync::Arc<::subxt::Client>) -> Self { + pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } @@ -182,12 +182,12 @@ impl RuntimeGenerator { use super::#types_mod_ident; #( #storage_structs )* - pub struct StorageApi { - client: ::std::sync::Arc<::subxt::Client>, + pub struct StorageApi<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, } - impl StorageApi { - pub fn new(client: ::std::sync::Arc<::subxt::Client>) -> Self { + impl<'a, T: ::subxt::Runtime> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } @@ -228,27 +228,17 @@ impl RuntimeGenerator { // todo: [AJ] keep all other code items from decorated mod? let mod_ident = item_mod.ident; - let (pallet_storage_cli_fields, pallet_storage_cli_fields_init): (Vec<_>, Vec<_>) = pallets_with_mod_names.iter().filter_map(|(pallet, pallet_mod_name)| { - if pallet.storage.is_some() { - let pallet_storage_cli_field = quote!( pub #pallet_mod_name: #pallet_mod_name::storage::StorageApi ); - let pallet_storage_cli_field_init = quote!( #pallet_mod_name: #pallet_mod_name::storage::StorageApi::new(client.clone()) ); - Some((pallet_storage_cli_field, pallet_storage_cli_field_init)) - } else { - None - } - }).unzip(); - let (pallet_calls_cli_fields, pallet_calls_cli_fields_init): (Vec<_>, Vec<_>) = pallets_with_mod_names + let pallets_with_storage = pallets_with_mod_names .iter() .filter_map(|(pallet, pallet_mod_name)| { - if pallet.calls.is_some() { - let cli_field = quote!( pub #pallet_mod_name: #pallet_mod_name::calls::TransactionApi ); - let cli_field_init = quote!( #pallet_mod_name: #pallet_mod_name::calls::TransactionApi::new(client.clone()) ); - Some((cli_field, cli_field_init)) - } else { - None - } - }) - .unzip(); + pallet.storage.as_ref().map(|_| pallet_mod_name) + }); + let pallets_with_calls = pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + pallet.calls.as_ref().map(|_| pallet_mod_name) + }); + quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod #mod_ident { @@ -257,9 +247,7 @@ impl RuntimeGenerator { #types_mod pub struct RuntimeApi { - pub client: ::std::sync::Arc<::subxt::Client>, - pub storage: StorageApi, - pub tx: TransactionApi, + pub client: ::subxt::Client, } impl RuntimeApi @@ -268,29 +256,40 @@ impl RuntimeGenerator { Send + Sync { pub fn new(client: ::subxt::Client) -> Self { - let client = ::std::sync::Arc::new(client); - Self { - client: client.clone(), - storage: StorageApi { - client: client.clone(), - #( #pallet_storage_cli_fields_init, )* - }, - tx: TransactionApi { - client: client.clone(), - #( #pallet_calls_cli_fields_init, )* - } - } + Self { client } + } + + pub fn storage<'a>(&'a self) -> StorageApi<'a, T> { + StorageApi { client: &self.client } + } + + pub fn tx<'a>(&'a self) -> TransactionApi<'a, T> { + TransactionApi { client: &self.client } } } - pub struct StorageApi { - client: ::std::sync::Arc<::subxt::Client>, - #( #pallet_storage_cli_fields, )* + pub struct StorageApi<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, } - pub struct TransactionApi { - client: ::std::sync::Arc<::subxt::Client>, - #( #pallet_calls_cli_fields, )* + impl<'a, T: ::subxt::Runtime> StorageApi<'a, T> { + #( + pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { + #pallets_with_storage::storage::StorageApi::new(self.client) + } + )* + } + + pub struct TransactionApi<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, + } + + impl<'a, T: ::subxt::Runtime> TransactionApi<'a, T> { + #( + pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T> { + #pallets_with_calls::calls::TransactionApi::new(self.client) + } + )* } } } @@ -379,7 +378,7 @@ impl RuntimeGenerator { #( #call_fn_args, )* ) -> ::subxt::SubmittableExtrinsic { let call = #call_struct_name { #( #call_args, )* }; - ::subxt::SubmittableExtrinsic::new(self.client.clone(), call) + ::subxt::SubmittableExtrinsic::new(self.client, call) } }; (call_struct, client_fn) diff --git a/src/client.rs b/src/client.rs index 24eaef3cb2..788dcbb5ec 100644 --- a/src/client.rs +++ b/src/client.rs @@ -390,12 +390,12 @@ impl Client { } /// A constructed call ready to be signed and submitted. -pub struct SubmittableExtrinsic { - client: Arc>, +pub struct SubmittableExtrinsic<'a, T: Runtime, C: Call> { + client: &'a Client, call: C, } -impl SubmittableExtrinsic +impl<'a, T, C> SubmittableExtrinsic<'a, T, C> where T: Runtime, C: Call + Send + Sync, @@ -403,7 +403,7 @@ where Send + Sync, { /// Create a new [`SubmittableExtrinsic`]. - pub fn new(client: Arc>, call: C) -> Self { + pub fn new(client: &'a Client, call: C) -> Self { Self { client, call } } From 950845fe4298b874239a8ad9cbe628065ec375a4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 17:19:48 +0100 Subject: [PATCH 103/216] Fix api usages with methods --- proc-macro/src/generate_runtime.rs | 69 ++++++++++++++---------------- src/client.rs | 14 ++++-- tests/src/frame/balances.rs | 33 +++++++++----- tests/src/frame/contracts.rs | 64 ++++++++++++++++----------- 4 files changed, 103 insertions(+), 77 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index c17a6899a4..90382893f1 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -122,7 +122,8 @@ impl RuntimeGenerator { .collect::>(); let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { let calls = if let Some(ref calls) = pallet.calls { - let (call_structs, call_fns) = self.generate_calls(&type_gen, pallet, calls); + let (call_structs, call_fns) = + self.generate_calls(&type_gen, pallet, calls); quote! { pub mod calls { use super::#types_mod_ident; @@ -132,11 +133,7 @@ impl RuntimeGenerator { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Runtime> TransactionApi<'a, T> - where - <>::Extra as ::subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: - Send + Sync - { + impl<'a, T: ::subxt::Runtime> TransactionApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } @@ -163,7 +160,8 @@ impl RuntimeGenerator { quote!() }; - let (storage_structs, storage_fns) = if let Some(ref storage) = pallet.storage { + let (storage_structs, storage_fns) = if let Some(ref storage) = pallet.storage + { let (storage_structs, storage_fns) = storage .entries .iter() @@ -176,25 +174,24 @@ impl RuntimeGenerator { (Vec::new(), Vec::new()) }; - let storage_mod = - quote! { - pub mod storage { - use super::#types_mod_ident; - #( #storage_structs )* - - pub struct StorageApi<'a, T: ::subxt::Runtime> { - client: &'a ::subxt::Client, - } + let storage_mod = quote! { + pub mod storage { + use super::#types_mod_ident; + #( #storage_structs )* - impl<'a, T: ::subxt::Runtime> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + pub struct StorageApi<'a, T: ::subxt::Runtime> { + client: &'a ::subxt::Client, + } - #( #storage_fns )* + impl<'a, T: ::subxt::Runtime> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } } + + #( #storage_fns )* } - }; + } + }; quote! { pub mod #mod_name { @@ -228,16 +225,18 @@ impl RuntimeGenerator { // todo: [AJ] keep all other code items from decorated mod? let mod_ident = item_mod.ident; - let pallets_with_storage = pallets_with_mod_names - .iter() - .filter_map(|(pallet, pallet_mod_name)| { - pallet.storage.as_ref().map(|_| pallet_mod_name) - }); - let pallets_with_calls = pallets_with_mod_names - .iter() - .filter_map(|(pallet, pallet_mod_name)| { - pallet.calls.as_ref().map(|_| pallet_mod_name) - }); + let pallets_with_storage = + pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + pallet.storage.as_ref().map(|_| pallet_mod_name) + }); + let pallets_with_calls = + pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + pallet.calls.as_ref().map(|_| pallet_mod_name) + }); quote! { #[allow(dead_code, unused_imports, non_camel_case_types)] @@ -250,11 +249,7 @@ impl RuntimeGenerator { pub client: ::subxt::Client, } - impl RuntimeApi - where - <>::Extra as ::subxt::sp_runtime::traits::SignedExtension>::AdditionalSigned: - Send + Sync - { + impl RuntimeApi { pub fn new(client: ::subxt::Client) -> Self { Self { client } } diff --git a/src/client.rs b/src/client.rs index 788dcbb5ec..ab28572237 100644 --- a/src/client.rs +++ b/src/client.rs @@ -399,8 +399,6 @@ impl<'a, T, C> SubmittableExtrinsic<'a, T, C> where T: Runtime, C: Call + Send + Sync, - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, { /// Create a new [`SubmittableExtrinsic`]. pub fn new(client: &'a Client, call: C) -> Self { @@ -412,7 +410,11 @@ where pub async fn sign_and_submit_then_watch( self, signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> { + ) -> Result, Error> + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { let extrinsic = self.client.create_signed(self.call, signer).await?; self.client.submit_and_watch_extrinsic(extrinsic).await } @@ -421,7 +423,11 @@ where pub async fn sign_and_submit( self, signer: &(dyn Signer + Send + Sync), - ) -> Result { + ) -> Result + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { let extrinsic = self.client.create_signed(self.call, signer).await?; self.client.submit_extrinsic(extrinsic).await } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 0244af3fd9..98aec2c4b0 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -40,20 +40,25 @@ async fn test_basic_transfer() { let api = &cxt.api; let alice_pre = api - .storage - .system + .storage() + .system() .account(alice.account_id().clone().into(), None) .await .unwrap(); let bob_pre = api - .storage - .system + .storage() + .system() .account(bob.account_id().clone().into(), None) .await .unwrap(); - let extrinsic = api.tx.balances.transfer(bob_address, 10_000); - let result = extrinsic.sign_and_submit_then_watch(&alice).await.unwrap(); + let result = api + .tx() + .balances() + .transfer(bob_address, 10_000) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); let event = result .find_event::() .unwrap() @@ -71,14 +76,14 @@ async fn test_basic_transfer() { assert_eq!(event, expected_event); let alice_post = api - .storage - .system + .storage() + .system() .account(alice.account_id().clone().into(), None) .await .unwrap(); let bob_post = api - .storage - .system + .storage() + .system() .account(bob.account_id().clone().into(), None) .await .unwrap(); @@ -91,7 +96,13 @@ async fn test_basic_transfer() { async fn test_state_total_issuance() { env_logger::try_init().ok(); let cxt = test_context().await; - let total_issuance = cxt.api.storage.balances.total_issuance(None).await.unwrap(); + let total_issuance = cxt + .api + .storage() + .balances() + .total_issuance(None) + .await + .unwrap(); assert_ne!(total_issuance, 0); } diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index d8637302fc..911d8119da 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -62,8 +62,8 @@ impl ContractsTestContext { &self.cxt.client } - fn contracts_tx(&self) -> &TransactionApi { - &self.cxt.api.tx.contracts + fn contracts_tx(&self) -> TransactionApi { + self.cxt.api.tx().contracts() } async fn instantiate_with_code(&self) -> Result<(Hash, AccountId), Error> { @@ -76,14 +76,21 @@ impl ContractsTestContext { "#; let code = wabt::wat2wasm(CONTRACT).expect("invalid wabt"); - let extrinsic = self.contracts_tx().instantiate_with_code( - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - code, - vec![], // data - vec![], // salt - ); - let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; + let result = self + .cxt + .api + .tx() + .contracts() + .instantiate_with_code( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + code, + vec![], // data + vec![], // salt + ) + .sign_and_submit_then_watch(&self.signer) + .await?; + let code_stored = result .find_event::()? .ok_or_else(|| Error::Other("Failed to find a CodeStored event".into()))?; @@ -109,14 +116,17 @@ impl ContractsTestContext { salt: Vec, ) -> Result { // call instantiate extrinsic - let extrinsic = self.contracts_tx().instantiate( - 100_000_000_000_000_000, // endowment - 500_000_000_000, // gas_limit - code_hash, - data, - salt, - ); - let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; + let result = self + .contracts_tx() + .instantiate( + 100_000_000_000_000_000, // endowment + 500_000_000_000, // gas_limit + code_hash, + data, + salt, + ) + .sign_and_submit_then_watch(&self.signer) + .await?; log::info!("Instantiate result: {:?}", result); let instantiated = result @@ -132,13 +142,17 @@ impl ContractsTestContext { input_data: Vec, ) -> Result, Error> { log::info!("call: {:?}", contract); - let extrinsic = self.contracts_tx().call( - MultiAddress::Id(contract), - 0, // value - 500_000_000, // gas_limit - input_data, - ); - let result = extrinsic.sign_and_submit_then_watch(&self.signer).await?; + let result = self + .contracts_tx() + .call( + MultiAddress::Id(contract), + 0, // value + 500_000_000, // gas_limit + input_data, + ) + .sign_and_submit_then_watch(&self.signer) + .await?; + log::info!("Call result: {:?}", result); Ok(result) } From 3cb400008f8cc7e6ed0cb2f335ab2683c8af1e93 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 4 Oct 2021 17:28:15 +0100 Subject: [PATCH 104/216] Use Bytes for RawEvent debug --- src/events.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/events.rs b/src/events.rs index 9df7d53c60..ebea83709c 100644 --- a/src/events.rs +++ b/src/events.rs @@ -38,8 +38,10 @@ use scale_info::{ TypeDef, TypeDefPrimitive, }; +use sp_core::Bytes; /// Raw bytes for an Event +#[derive(Debug)] pub struct RawEvent { /// The name of the pallet from whence the Event originated. pub pallet: String, @@ -50,17 +52,7 @@ pub struct RawEvent { /// The index of the pallet Event variant. pub variant_index: u8, /// The raw Event data - pub data: Vec, -} - -impl std::fmt::Debug for RawEvent { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - f.debug_struct("RawEvent") - .field("module", &self.pallet) - .field("variant", &self.variant) - .field("data", &hex::encode(&self.data)) - .finish() - } + pub data: Bytes, } /// Events decoder. @@ -121,7 +113,7 @@ where pallet_index, variant: event_metadata.event().to_string(), variant_index, - data: event_data, + data: event_data.into(), }; // topics come after the event data in EventRecord From 602f62baed6473dc3e2a3345428a52d8514db3d4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 11:06:58 +0100 Subject: [PATCH 105/216] Update metadata --- tests/node_runtime.scale | Bin 299274 -> 301517 bytes tests/src/frame/contracts.rs | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/node_runtime.scale b/tests/node_runtime.scale index 67f358c9808a623a1bdca77ac65945f05efb07f3..80692153a8cb67479eeb2a05a7e42334dc3bea02 100644 GIT binary patch delta 15771 zcmch8e_T~nw)k0l@B4#aa#4`qcu-JKP*G7-Q1MqXiHd+qMR0)w+ypM(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qBbVlqy}2U>MG9Ff@pl#v(Ip7o*4V_mR6o3V1FaX449|hb=d*(vBAJe*y-a zUYfwa!`JRY zFI4dJiOQs(RB@5zZT=``WejYNY>$@zQqe}Fd z$s-0mY@6gYXYjgOU6liUV~P#WTl+%AhI*ULB`;JBMbWrmCLe^}pND4h+i-}dw2L#j z8Tcan$V~fX7C!~}<%-#l@IZLX!NaugXY(^sR=z)%$I-J!@#9>6D@6@ems{24e2QF9 zWXW=VH!7@R)NOnK?KFycxA7|EwIjFjnaIY`6?~GsvYw#TRUqrfhM1y*^{;2Z`!YvK z2xo;~KS*!UEA#lPSo;Ax&zG0m)3oDu{xnCvbIs=oEYE~j;^y?KAv-3LU|fE{Fbk%g}M&SeHnx=P}~`JNU1D*+z>EH56Ve)-B{E;`4=k zqS#r(Z-!FwZ4I|VnP#fxC~;dj3g1n2_{|*duy>vOh1haaoK+7exxx3g1nV$fN1ztF z_;fpM79Eu^Jo13(smdNh_*ND1C6bOg42OD{;6wJ@v$!}-tO%F@y5-&2AVM`mt zl4ZEI+d0nS&1HOm5%B2)PK;R1t>z@y zfeXX$66;p;P*J;@hqHFm9*NMO@8Ni=>{`vy*xxU{xDPkuLCtnQ?}cAzh#^htd<Oshr{csPDYVGE&c*zSNgKJ$@ aw^F%c+Lo+C-h&s!juswiFqpUbng1VG4%LYO diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index 911d8119da..f8e9ca7888 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -104,9 +104,9 @@ impl ContractsTestContext { })?; log::info!(" Block hash: {:?}", result.block); - log::info!(" Code hash: {:?}", code_stored.0); - log::info!(" Contract address: {:?}", instantiated.1); - Ok((code_stored.0, instantiated.1)) + log::info!(" Code hash: {:?}", code_stored.code_hash); + log::info!(" Contract address: {:?}", instantiated.contract); + Ok((code_stored.code_hash, instantiated.contract)) } async fn instantiate( @@ -133,7 +133,7 @@ impl ContractsTestContext { .find_event::()? .ok_or_else(|| Error::Other("Failed to find a Instantiated event".into()))?; - Ok(instantiated.0) + Ok(instantiated.contract) } async fn call( From 4d1de1bd18e08820168e9e1f6cff98c937aff367 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 11:13:08 +0100 Subject: [PATCH 106/216] Restoring some Balances tests --- tests/src/frame/balances.rs | 31 ++++++++++++++++--------------- tests/src/utils/context.rs | 1 + 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 98aec2c4b0..6d3ab2ddfd 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -31,8 +31,7 @@ use subxt::extrinsic::{ }; #[async_std::test] -async fn test_basic_transfer() { - env_logger::try_init().ok(); +async fn tx_basic_transfer() { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let bob_address = bob.account_id().clone().into(); @@ -93,8 +92,7 @@ async fn test_basic_transfer() { } #[async_std::test] -async fn test_state_total_issuance() { - env_logger::try_init().ok(); +async fn storage_total_issuance() { let cxt = test_context().await; let total_issuance = cxt .api @@ -106,18 +104,21 @@ async fn test_state_total_issuance() { assert_ne!(total_issuance, 0); } +#[async_std::test] +async fn storage_read_free_balance() { + let cxt = test_context().await; + let account = AccountKeyring::Alice.to_account_id(); + let info = cxt + .api + .storage() + .balances() + .account(account, None) + .await + .unwrap(); + assert_ne!(info.free, 0); +} // #[async_std::test] -// async fn test_state_read_free_balance() { -// env_logger::try_init().ok(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let account = AccountKeyring::Alice.to_account_id(); -// let info = client.account(&account, None).await.unwrap(); -// assert_ne!(info.data.free, 0); -// } -// -// #[async_std::test] -// async fn test_state_balance_lock() -> Result<(), crate::Error> { +// async fn storage_balance_lock() -> Result<(), crate::Error> { // // env_logger::try_init().ok(); // let bob = PairSigner::::new(AccountKeyring::Bob.pair()); diff --git a/tests/src/utils/context.rs b/tests/src/utils/context.rs index f08bf86b85..bfde0ff6a2 100644 --- a/tests/src/utils/context.rs +++ b/tests/src/utils/context.rs @@ -54,6 +54,7 @@ pub struct TestContext { } pub async fn test_context() -> TestContext { + env_logger::try_init().ok(); let node_proc = test_node_process_with(AccountKeyring::Alice).await; let client = node_proc.client().clone(); let api = node_runtime::RuntimeApi::::new(client.clone()); From 384f88edd6ace89f6535820a3cd27c9b2243641d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 11:34:34 +0100 Subject: [PATCH 107/216] Populate runtime storage metadata --- src/metadata.rs | 33 +++++++++++---------------------- src/storage.rs | 4 ++-- 2 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/metadata.rs b/src/metadata.rs index c18346bbda..6ff9379852 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -20,7 +20,6 @@ use std::{ }; use codec::{ - Decode, Error as CodecError, }; @@ -29,8 +28,7 @@ use frame_metadata::{ RuntimeMetadata, RuntimeMetadataLastVersion, RuntimeMetadataPrefixed, - StorageEntryModifier, - StorageEntryType, + StorageEntryMetadata, META_RESERVED, }; @@ -140,7 +138,7 @@ pub struct PalletMetadata { index: u8, name: String, calls: HashMap, - storage: HashMap, + storage: HashMap>, constants: HashMap>, } @@ -158,7 +156,7 @@ impl PalletMetadata { Ok(Encoded(bytes)) } - pub fn storage(&self, key: &'static str) -> Result<&StorageMetadata, MetadataError> { + pub fn storage(&self, key: &'static str) -> Result<&StorageEntryMetadata, MetadataError> { self.storage .get(key) .ok_or(MetadataError::StorageNotFound(key)) @@ -223,21 +221,6 @@ impl ErrorMetadata { } } -#[derive(Clone, Debug)] -pub struct StorageMetadata { - module_prefix: String, - storage_prefix: String, - modifier: StorageEntryModifier, - ty: StorageEntryType, - default: Vec, -} - -impl StorageMetadata { - pub fn default(&self) -> Result { - Decode::decode(&mut &self.default[..]).map_err(MetadataError::DefaultError) - } -} - #[derive(Debug, thiserror::Error)] pub enum InvalidMetadataError { #[error("Invalid prefix")] @@ -287,12 +270,18 @@ impl TryFrom for Metadata { Ok(calls) })?; + let storage = pallet.storage.as_ref().map_or(HashMap::new(), |storage| { + storage.entries.iter().map(|entry| { + (entry.name.clone(), entry.clone()) + }).collect() + }); + let pallet_metadata = PalletMetadata { index: pallet.index, name: pallet.name.to_string(), calls, - storage: Default::default(), - constants: Default::default(), + storage, + constants: Default::default(), // todo: [AJ] constants }; Ok((pallet.name.to_string(), pallet_metadata)) diff --git a/src/storage.rs b/src/storage.rs index 146df72ac8..6f742b939c 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -32,7 +32,7 @@ use std::marker::PhantomData; use crate::{ rpc::Rpc, Error, - Metadata, + metadata::{Metadata, MetadataError}, Runtime, StorageHasher, }; @@ -190,7 +190,7 @@ impl<'a, T: Runtime> StorageClient<'a, T> { } else { let pallet_metadata = self.metadata.pallet(F::PALLET)?; let storage_metadata = pallet_metadata.storage(F::STORAGE)?; - let default = storage_metadata.default()?; + let default = Decode::decode(&mut &storage_metadata.default[..]).map_err(MetadataError::DefaultError)?; Ok(default) } } From b340bc22276f3f4bd86431291e8a8836771b5ec7 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 15:00:11 +0100 Subject: [PATCH 108/216] Restore balances lock test --- proc-macro/src/generate_runtime.rs | 2 +- tests/src/frame/balances.rs | 71 ++++++++++++------------------ tests/src/frame/contracts.rs | 2 - 3 files changed, 30 insertions(+), 45 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 90382893f1..0ee908c226 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -106,7 +106,7 @@ impl RuntimeGenerator { pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { let type_substitutes = Self::parse_type_substitutes(&item_mod); let type_gen = - TypeGenerator::new(&self.metadata.types, "__types", type_substitutes); + TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); let pallets_with_mod_names = self diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 6d3ab2ddfd..08aed67204 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -19,6 +19,7 @@ use crate::{ node_runtime::{ balances, + runtime_types, system, }, test_context, @@ -105,50 +106,36 @@ async fn storage_total_issuance() { } #[async_std::test] -async fn storage_read_free_balance() { +async fn storage_balance_lock() -> Result<(), subxt::Error> { + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let charlie = AccountKeyring::Charlie.to_account_id(); let cxt = test_context().await; - let account = AccountKeyring::Alice.to_account_id(); - let info = cxt - .api - .storage() - .balances() - .account(account, None) - .await - .unwrap(); - assert_ne!(info.free, 0); + + let result = + cxt.api.tx().staking() + .bond(charlie.into(), 100_000_000_000_000, runtime_types::pallet_staking::RewardDestination::Stash) + .sign_and_submit_then_watch(&bob) + .await?; + + let success = result.find_event::()?; + assert!(success.is_some(), "No ExtrinsicSuccess Event found"); + + let locks = cxt.api.storage().balances() + .locks(AccountKeyring::Bob.to_account_id(), 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(()) } -// #[async_std::test] -// async fn storage_balance_lock() -> Result<(), crate::Error> { -// -// env_logger::try_init().ok(); -// let bob = PairSigner::::new(AccountKeyring::Bob.pair()); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// -// client -// .bond_and_watch( -// &bob, -// &AccountKeyring::Charlie.to_account_id().clone().into(), -// 100_000_000_000_000, -// RewardDestination::Stash, -// ) -// .await?; -// -// let locks = client -// .locks(&AccountKeyring::Bob.to_account_id(), None) -// .await?; -// -// assert_eq!( -// locks, -// vec![BalanceLock { -// id: *b"staking ", -// amount: 100_000_000_000_000, -// reasons: Reasons::All, -// }] -// ); -// -// Ok(()) -// } + // // #[async_std::test] // async fn test_transfer_error() { diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index f8e9ca7888..cada2ff579 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -50,8 +50,6 @@ type AccountId = ::AccountId; impl ContractsTestContext { async fn init() -> Self { - env_logger::try_init().ok(); - let cxt = test_context().await; let signer = PairSigner::new(AccountKeyring::Alice.pair()); From f1b7b8559877d44d8137be4595544572c7b73323 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 15:21:59 +0100 Subject: [PATCH 109/216] Restore Balances error test --- src/error.rs | 6 +-- src/lib.rs | 2 +- tests/src/frame/balances.rs | 75 ++++++++++++++++++++++--------------- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/error.rs b/src/error.rs index 1db70ef019..c8bf22ff65 100644 --- a/src/error.rs +++ b/src/error.rs @@ -93,7 +93,7 @@ impl From for Error { pub enum RuntimeError { /// Module error. #[error("Runtime module error: {0}")] - Module(ModuleError), + Module(PalletError), /// At least one consumer is remaining so the account cannot be destroyed. #[error("At least one consumer is remaining so the account cannot be destroyed.")] ConsumerRemaining, @@ -124,7 +124,7 @@ impl RuntimeError { message: _, } => { let error = metadata.error(index, error)?; - Ok(Self::Module(ModuleError { + Ok(Self::Module(PalletError { pallet: error.pallet().to_string(), error: error.error().to_string(), description: error.description().to_vec(), @@ -146,7 +146,7 @@ impl RuntimeError { /// Module error. #[derive(Clone, Debug, Eq, Error, PartialEq)] #[error("{error} from {pallet}")] -pub struct ModuleError { +pub struct PalletError { /// The module where the error originated. pub pallet: String, /// The actual error code. diff --git a/src/lib.rs b/src/lib.rs index 10066ed054..6553fa4222 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,7 @@ pub use crate::{ }, error::{ Error, - ModuleError, + PalletError, RuntimeError, }, events::{ diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 08aed67204..1cc7ff44f6 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -25,10 +25,19 @@ use crate::{ test_context, TestRuntime, }; +use sp_core::{ + sr25519::Pair, + Pair as _, +}; use sp_keyring::AccountKeyring; -use subxt::extrinsic::{ - PairSigner, - Signer, +use subxt::{ + extrinsic::{ + PairSigner, + Signer, + }, + Error, + RuntimeError, + PalletError, }; #[async_std::test] @@ -136,34 +145,38 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { Ok(()) } -// -// #[async_std::test] -// async fn test_transfer_error() { -// env_logger::try_init().ok(); -// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); -// let alice_addr = alice.account_id().clone().into(); -// let hans = PairSigner::::new(Pair::generate().0); -// let hans_address = hans.account_id().clone().into(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// client -// .transfer_and_watch(&alice, &hans_address, 100_000_000_000_000_000) -// .await -// .unwrap(); -// let res = client -// .transfer_and_watch(&hans, &alice_addr, 100_000_000_000_000_000) -// .await; -// -// if let Err(Error::Runtime(RuntimeError::Module(error))) = res { -// let error2 = ModuleError { -// module: "Balances".into(), -// error: "InsufficientBalance".into(), -// }; -// assert_eq!(error, error2); -// } else { -// panic!("expected an error"); -// } -// } +#[async_std::test] +async fn test_transfer_error() { + env_logger::try_init().ok(); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice_addr = alice.account_id().clone().into(); + let hans = PairSigner::::new(Pair::generate().0); + let hans_address = hans.account_id().clone().into(); + let cxt = test_context().await; + + cxt.api.tx().balances() + .transfer(hans_address, 100_000_000_000_000_000) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); + + let res = cxt.api.tx().balances() + .transfer(alice_addr, 100_000_000_000_000_000) + .sign_and_submit_then_watch(&hans) + .await; + + if let Err(Error::Runtime(RuntimeError::Module(error))) = res { + let error2 = PalletError { + pallet: "Balances".into(), + error: "InsufficientBalance".into(), + description: vec!["Balance too low to send value".to_string()], + }; + assert_eq!(error, error2); + } else { + panic!("expected an error"); + } +} + // // #[async_std::test] // async fn test_transfer_subscription() { From ec90ecc1f0a72fc484f77c7a631591628717affc Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 15:22:13 +0100 Subject: [PATCH 110/216] Fmt --- src/metadata.rs | 17 ++++++++++------- src/storage.rs | 8 ++++++-- tests/src/frame/balances.rs | 33 +++++++++++++++++++++++---------- 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/metadata.rs b/src/metadata.rs index 6ff9379852..0ab94e8476 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -19,9 +19,7 @@ use std::{ convert::TryFrom, }; -use codec::{ - Error as CodecError, -}; +use codec::Error as CodecError; use frame_metadata::{ PalletConstantMetadata, @@ -156,7 +154,10 @@ impl PalletMetadata { Ok(Encoded(bytes)) } - pub fn storage(&self, key: &'static str) -> Result<&StorageEntryMetadata, MetadataError> { + pub fn storage( + &self, + key: &'static str, + ) -> Result<&StorageEntryMetadata, MetadataError> { self.storage .get(key) .ok_or(MetadataError::StorageNotFound(key)) @@ -271,9 +272,11 @@ impl TryFrom for Metadata { })?; let storage = pallet.storage.as_ref().map_or(HashMap::new(), |storage| { - storage.entries.iter().map(|entry| { - (entry.name.clone(), entry.clone()) - }).collect() + storage + .entries + .iter() + .map(|entry| (entry.name.clone(), entry.clone())) + .collect() }); let pallet_metadata = PalletMetadata { diff --git a/src/storage.rs b/src/storage.rs index 6f742b939c..2007d037bd 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -30,9 +30,12 @@ pub use sp_version::RuntimeVersion; use std::marker::PhantomData; use crate::{ + metadata::{ + Metadata, + MetadataError, + }, rpc::Rpc, Error, - metadata::{Metadata, MetadataError}, Runtime, StorageHasher, }; @@ -190,7 +193,8 @@ impl<'a, T: Runtime> StorageClient<'a, T> { } else { let pallet_metadata = self.metadata.pallet(F::PALLET)?; let storage_metadata = pallet_metadata.storage(F::STORAGE)?; - let default = Decode::decode(&mut &storage_metadata.default[..]).map_err(MetadataError::DefaultError)?; + let default = Decode::decode(&mut &storage_metadata.default[..]) + .map_err(MetadataError::DefaultError)?; Ok(default) } } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 1cc7ff44f6..3613a5d603 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -36,8 +36,8 @@ use subxt::{ Signer, }, Error, - RuntimeError, PalletError, + RuntimeError, }; #[async_std::test] @@ -120,16 +120,25 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { let charlie = AccountKeyring::Charlie.to_account_id(); let cxt = test_context().await; - let result = - cxt.api.tx().staking() - .bond(charlie.into(), 100_000_000_000_000, runtime_types::pallet_staking::RewardDestination::Stash) - .sign_and_submit_then_watch(&bob) - .await?; + let result = cxt + .api + .tx() + .staking() + .bond( + charlie.into(), + 100_000_000_000_000, + runtime_types::pallet_staking::RewardDestination::Stash, + ) + .sign_and_submit_then_watch(&bob) + .await?; let success = result.find_event::()?; assert!(success.is_some(), "No ExtrinsicSuccess Event found"); - let locks = cxt.api.storage().balances() + let locks = cxt + .api + .storage() + .balances() .locks(AccountKeyring::Bob.to_account_id(), None) .await?; @@ -154,13 +163,18 @@ async fn test_transfer_error() { let hans_address = hans.account_id().clone().into(); let cxt = test_context().await; - cxt.api.tx().balances() + cxt.api + .tx() + .balances() .transfer(hans_address, 100_000_000_000_000_000) .sign_and_submit_then_watch(&alice) .await .unwrap(); - let res = cxt.api.tx().balances() + let res = cxt + .api + .tx() + .balances() .transfer(alice_addr, 100_000_000_000_000_000) .sign_and_submit_then_watch(&hans) .await; @@ -177,7 +191,6 @@ async fn test_transfer_error() { } } -// // #[async_std::test] // async fn test_transfer_subscription() { // env_logger::try_init().ok(); From e4907d45ad9784b77976f302ace661165c8b0ae7 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 15:32:47 +0100 Subject: [PATCH 111/216] Restore transfer subscription API --- tests/src/frame/balances.rs | 55 ++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 3613a5d603..3be970dc55 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -25,6 +25,7 @@ use crate::{ test_context, TestRuntime, }; +use codec::Decode; use sp_core::{ sr25519::Pair, Pair as _, @@ -36,6 +37,7 @@ use subxt::{ Signer, }, Error, + EventSubscription, PalletError, RuntimeError, }; @@ -155,7 +157,7 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { } #[async_std::test] -async fn test_transfer_error() { +async fn transfer_error() { env_logger::try_init().ok(); let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let alice_addr = alice.account_id().clone().into(); @@ -191,27 +193,30 @@ async fn test_transfer_error() { } } -// #[async_std::test] -// async fn test_transfer_subscription() { -// env_logger::try_init().ok(); -// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); -// let bob = AccountKeyring::Bob.to_account_id(); -// let bob_addr = bob.clone().into(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let sub = client.subscribe_events().await.unwrap(); -// let decoder = client.events_decoder(); -// let mut sub = EventSubscription::::new(sub, &decoder); -// sub.filter_event::>(); -// client.transfer(&alice, &bob_addr, 10_000).await.unwrap(); -// let raw = sub.next().await.unwrap().unwrap(); -// let event = TransferEvent::::decode(&mut &raw.data[..]).unwrap(); -// assert_eq!( -// event, -// TransferEvent { -// from: alice.account_id().clone(), -// to: bob.clone(), -// amount: 10_000, -// } -// ); -// } +#[async_std::test] +async fn transfer_subscription() { + env_logger::try_init().ok(); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id(); + let bob_addr = bob.clone().into(); + let cxt = test_context().await; + let sub = cxt.client.subscribe_events().await.unwrap(); + let decoder = cxt.client.events_decoder(); + let mut sub = EventSubscription::::new(sub, &decoder); + sub.filter_event::(); + + cxt.api + .tx() + .balances() + .transfer(bob_addr, 10_000) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); + + let raw = sub.next().await.unwrap().unwrap(); + let event = balances::events::Transfer::decode(&mut &raw.data[..]).unwrap(); + assert_eq!( + event, + balances::events::Transfer(alice.account_id().clone(), bob.clone(), 10_000,) + ); +} From bab2aef21225405320d915c19305ab3f3ceeb707 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 16:32:06 +0100 Subject: [PATCH 112/216] Staking test --- tests/src/frame/mod.rs | 1 + tests/src/frame/session.rs | 100 ------ tests/src/frame/staking.rs | 628 +++++++++++++------------------------ 3 files changed, 225 insertions(+), 504 deletions(-) delete mode 100644 tests/src/frame/session.rs diff --git a/tests/src/frame/mod.rs b/tests/src/frame/mod.rs index c987fe5bf4..373c4e766f 100644 --- a/tests/src/frame/mod.rs +++ b/tests/src/frame/mod.rs @@ -16,3 +16,4 @@ mod balances; mod contracts; +mod staking; diff --git a/tests/src/frame/session.rs b/tests/src/frame/session.rs deleted file mode 100644 index 2faa6ae979..0000000000 --- a/tests/src/frame/session.rs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-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 substrate-subxt. If not, see . - -//! Session support -use crate::frame::{ - balances::Balances, - system::System, -}; -use codec::Encode; -use frame_support::Parameter; -use sp_runtime::traits::{ - Member, - OpaqueKeys, -}; -use std::{ - fmt::Debug, - marker::PhantomData, -}; -use substrate_subxt_proc_macro::Store; - -/// Impls `Default::default` for some types that have a `_runtime` field of type -/// `PhantomData` as their only field. -macro_rules! default_impl { - ($name:ident) => { - impl Default for $name { - fn default() -> Self { - Self { - _runtime: PhantomData, - } - } - } - }; -} - -type IdentificationTuple = ( - ::ValidatorId, - pallet_staking::Exposure<::AccountId, ::Balance>, -); - -/// The trait needed for this module. -#[module] -pub trait Session: System + Balances { - #![event_alias(IdentificationTuple = IdentificationTuple)] - #![event_alias(OpaqueTimeSlot = Vec)] - #![event_alias(SessionIndex = u32)] - - /// The validator account identifier type for the runtime. - type ValidatorId: Parameter + Debug + Ord + Default + Send + Sync + 'static; - - /// The keys. - type Keys: OpaqueKeys + Member + Parameter + Default; -} - -/// The current set of validators. -#[derive(Encode, Store, Debug)] -pub struct ValidatorsStore { - #[store(returns = Vec<::ValidatorId>)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// The queued keys for the next session. -#[derive(Encode, Store, Debug)] -pub struct QueuedKeysStore { - #[store(returns = Vec<(::ValidatorId, T::Keys)>)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// The next session keys for a validator. -#[derive(Encode, Store, Debug)] -pub struct NextKeysStore<'a, T: Session> { - #[store(returns = Option<::Keys>)] - /// The validator account. - pub validator_id: &'a ::ValidatorId, -} - -default_impl!(ValidatorsStore); - -/// Set the session keys for a validator. -#[derive(Encode, Call, Debug)] -pub struct SetKeysCall { - /// The keys - pub keys: T::Keys, - /// The proof. This is not currently used and can be set to an empty vector. - pub proof: Vec, -} diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index 37cedffbce..4550b55af5 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -16,420 +16,240 @@ //! Implements support for the pallet_staking module. -use super::balances::Balances; use codec::{ Decode, Encode, }; +use assert_matches::assert_matches; +use crate::{ + test_context, + TestRuntime, + node_runtime::runtime_types::pallet_staking::{ + ActiveEraInfo, + Exposure, + Nominations, + RewardDestination, + StakingLedger, + ValidatorPrefs, + } +}; +use sp_core::{ + sr25519, + Pair, +}; +use sp_keyring::AccountKeyring; + use std::{ collections::BTreeMap, fmt::Debug, marker::PhantomData, }; -pub use pallet_staking::{ - ActiveEraInfo, - EraIndex, - Exposure, - Nominations, - RewardDestination, - RewardPoint, - StakingLedger, - ValidatorPrefs, +use subxt::{ + RuntimeError, + extrinsic::{ + PairSigner, + Signer, + }, + Error, + ExtrinsicSuccess, }; -/// Rewards for the last `HISTORY_DEPTH` eras. -/// If reward hasn't been set or has been removed then 0 reward is returned. -#[derive(Clone, Encode, Decode, Debug, Store)] -pub struct ErasRewardPointsStore { - #[store(returns = EraRewardPoints)] - /// Era index - pub index: EraIndex, - /// Marker for the runtime - pub _phantom: PhantomData, -} - -/// Preference of what happens regarding validation. -#[derive(Clone, Encode, Decode, Debug, Call)] -pub struct SetPayeeCall { - /// The payee - pub payee: RewardDestination, - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// The subset of the `frame::Trait` that a client must implement. -#[module] -#[rustfmt::skip] -pub trait Staking: Balances { - #![event_alias(ElectionCompute = u8)] - #![event_type(EraIndex)] -} - -/// Number of eras to keep in history. -/// -/// Information is kept for eras in `[current_era - history_depth; current_era]`. -/// -/// Must be more than the number of eras delayed by session otherwise. -/// I.e. active era must always be in history. -/// I.e. `active_era > current_era - history_depth` must be guaranteed. -#[derive(Encode, Decode, Copy, Clone, Debug, Default, Store)] -pub struct HistoryDepthStore { - #[store(returns = u32)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// Map from all locked "stash" accounts to the controller account. -#[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] -pub struct BondedStore { - #[store(returns = Option)] - /// Tٗhe stash account - pub stash: T::AccountId, -} - -/// Map from all (unlocked) "controller" accounts to the info regarding the staking. -#[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] -pub struct LedgerStore { - #[store(returns = Option>)] - /// The controller account - pub controller: T::AccountId, -} - -/// Where the reward payment should be made. Keyed by stash. -#[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] -pub struct PayeeStore { - #[store(returns = RewardDestination)] - /// Tٗhe stash account - pub stash: T::AccountId, -} - -/// The map from (wannabe) validator stash key to the preferences of that validator. -#[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, Ord, PartialOrd, Store)] -pub struct ValidatorsStore { - #[store(returns = ValidatorPrefs)] - /// Tٗhe stash account - pub stash: T::AccountId, -} - -/// The map from nominator stash key to the set of stash keys of all validators to nominate. -#[derive(Encode, Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Store)] -pub struct NominatorsStore { - #[store(returns = Option>)] - /// Tٗhe stash account - pub stash: T::AccountId, -} - -/// The current era index. -/// -/// This is the latest planned era, depending on how the Session pallet queues the validator -/// set, it might be active or not. -#[derive(Encode, Copy, Clone, Debug, Store)] -pub struct CurrentEraStore { - #[store(returns = Option)] - /// Marker for the runtime - pub _runtime: PhantomData, -} - -/// Reward points of an era. Used to split era total payout between validators. -/// -/// This points will be used to reward validators and their respective nominators. -#[derive(PartialEq, Encode, Decode, Default, Debug)] -pub struct EraRewardPoints { - /// Total number of points. Equals the sum of reward points for each validator. - pub total: RewardPoint, - /// The reward points earned by a given validator. - pub individual: BTreeMap, -} - -/// Declare no desire to either validate or nominate. -/// -/// Effective at the beginning of the next era. -/// -/// The dispatch origin for this call must be _Signed_ by the controller, not the stash. -/// Can only be called when [`EraElectionStatus`] is `Closed`. -#[derive(Debug, Call, Encode)] -pub struct ChillCall { - /// Runtime marker - pub _runtime: PhantomData, -} - -impl Default for ChillCall { - fn default() -> Self { - Self { - _runtime: PhantomData, - } - } -} -impl Clone for ChillCall { - fn clone(&self) -> Self { - Self { - _runtime: self._runtime, - } - } -} -impl Copy for ChillCall {} - -/// Declare the desire to validate for the origin controller. -/// -/// Effective at the beginning of the next era. -/// -/// The dispatch origin for this call must be _Signed_ by the controller, not the stash. -/// Can only be called when [`EraElectionStatus`] is `Closed`. -#[derive(Clone, Debug, PartialEq, Call, Encode)] -pub struct ValidateCall { - /// Runtime marker - pub _runtime: PhantomData, - /// Validation preferences - pub prefs: ValidatorPrefs, -} - -/// Declare the desire to nominate `targets` for the origin controller. -/// -/// Effective at the beginning of the next era. -/// -/// The dispatch origin for this call must be _Signed_ by the controller, not the stash. -/// Can only be called when [`EraElectionStatus`] is `Closed`. -#[derive(Call, Encode, Debug)] -pub struct NominateCall { - /// The targets that are being nominated - pub targets: Vec, -} - -/// Take the origin account as a stash and lock up `value` of its balance. -/// `controller` will be the account that controls it. -#[derive(Call, Encode, Debug)] -pub struct BondCall<'a, T: Staking> { - /// Tٗhe controller account - pub controller: &'a T::Address, - /// Lock up `value` of its balance. - #[codec(compact)] - pub value: T::Balance, - /// Destination of Staking reward. - pub payee: RewardDestination, -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::{ - error::RuntimeError, - extrinsic::{ - PairSigner, - Signer, - }, - frame::balances::*, - tests::{ - test_node_process, - TestRuntime, - }, - Error, - ExtrinsicSuccess, - }; - use assert_matches::assert_matches; - use sp_core::{ - sr25519, - Pair, - }; - use sp_keyring::AccountKeyring; - - /// 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") - } - - #[async_std::test] - async fn test_validate_with_controller_account() -> Result<(), Error> { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let announce_validator = client - .validate_and_watch(&alice, ValidatorPrefs::default()) - .await; - assert_matches!(announce_validator, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { - // TOOD: this is unsatisfying – can we do better? - assert_eq!(events.len(), 2); - }); - - Ok(()) - } - - #[async_std::test] - async fn test_validate_not_possible_for_stash_account() -> Result<(), Error> { - env_logger::try_init().ok(); - let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let announce_validator = client - .validate_and_watch(&alice_stash, ValidatorPrefs::default()) - .await; - assert_matches!(announce_validator, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.module, "Staking"); - assert_eq!(module_err.error, "NotController"); - }); - Ok(()) - } - - #[async_std::test] - async fn test_nominate_with_controller_account() -> Result<(), Error> { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - - let nomination = client - .nominate_and_watch(&alice, vec![bob.account_id().clone().into()]) - .await; - assert_matches!(nomination, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { - // TOOD: this is unsatisfying – can we do better? - assert_eq!(events.len(), 2); - }); - Ok(()) - } - - #[async_std::test] - async fn test_nominate_not_possible_for_stash_account() -> Result<(), Error> { - env_logger::try_init().ok(); - let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - - let nomination = client - .nominate_and_watch(&alice_stash, vec![bob.account_id().clone().into()]) - .await; - assert_matches!(nomination, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.module, "Staking"); - assert_eq!(module_err.error, "NotController"); - }); - Ok(()) - } - - #[async_std::test] - async fn test_chill_works_for_controller_only() -> Result<(), Error> { - env_logger::try_init().ok(); - let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); - let bob_stash = - PairSigner::::new(get_from_seed("Bob//stash")); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - - // this will fail the second time, which is why this is one test, not two - client - .nominate_and_watch(&alice, vec![bob_stash.account_id().clone().into()]) - .await?; - let store = LedgerStore { - controller: alice.account_id().clone(), - }; - let StakingLedger { stash, .. } = client.fetch(&store, None).await?.unwrap(); - assert_eq!(alice_stash.account_id(), &stash); - let chill = client.chill_and_watch(&alice_stash).await; - - assert_matches!(chill, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.module, "Staking"); - assert_eq!(module_err.error, "NotController"); - }); - - let chill = client.chill_and_watch(&alice).await; - assert_matches!(chill, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { - // TOOD: this is unsatisfying – can we do better? - assert_eq!(events.len(), 2); - }); - Ok(()) - } - - #[async_std::test] - async fn test_bond() -> Result<(), Error> { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - - let bond = client - .bond_and_watch( - &alice, - &AccountKeyring::Bob.to_account_id().into(), - 100_000_000_000_000, - RewardDestination::Stash, - ) - .await; - - assert_matches!(bond, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { - // TOOD: this is unsatisfying – can we do better? - assert_eq!(events.len(), 3); - }); - - let bond_again = client - .bond_and_watch( - &alice, - &AccountKeyring::Bob.to_account_id().into(), - 100_000_000_000, - RewardDestination::Stash, - ) - .await; - - assert_matches!(bond_again, Err(Error::Runtime(RuntimeError::Module(module_err))) => { - assert_eq!(module_err.module, "Staking"); - assert_eq!(module_err.error, "AlreadyBonded"); - }); - - Ok(()) - } - - #[async_std::test] - async fn test_total_issuance_is_okay() -> Result<(), Error> { - env_logger::try_init().ok(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let total_issuance = client.total_issuance(None).await?; - assert!(total_issuance > 1u128 << 32); - Ok(()) - } - - #[async_std::test] - async fn test_history_depth_is_okay() -> Result<(), Error> { - env_logger::try_init().ok(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let history_depth = client.history_depth(None).await?; - assert_eq!(history_depth, 84); - Ok(()) - } - - #[async_std::test] - async fn test_current_era_is_okay() -> Result<(), Error> { - env_logger::try_init().ok(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let _current_era = client - .current_era(None) - .await? - .expect("current era always exists"); - Ok(()) - } - - #[async_std::test] - async fn test_era_reward_points_is_okay() -> Result<(), Error> { - env_logger::try_init().ok(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); - let store = ErasRewardPointsStore { - _phantom: PhantomData, - index: 0, - }; - - let current_era_result = client.fetch(&store, None).await?; - - assert_matches!(current_era_result, Some(_)); - - Ok(()) - } -} +/// 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") +} + +#[async_std::test] +async fn validate_with_controller_account() -> Result<(), Error> { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let cxt = test_context().await; + let announce_validator = cxt.api.tx().staking() + .validate(ValidatorPrefs { commission: sp_runtime::Perbill::default(), blocked: false }) + + .sign_and_submit_then_watch(&alice) + .await; + assert_matches!(announce_validator, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { + // TOOD: this is unsatisfying – can we do better? + assert_eq!(events.len(), 2); + }); + + Ok(()) +} + +// #[async_std::test] +// async fn test_validate_not_possible_for_stash_account() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let announce_validator = client +// .validate_and_watch(&alice_stash, ValidatorPrefs::default()) +// .await; +// assert_matches!(announce_validator, Err(Error::Runtime(RuntimeError::Module(module_err))) => { +// assert_eq!(module_err.module, "Staking"); +// assert_eq!(module_err.error, "NotController"); +// }); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_nominate_with_controller_account() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +// let bob = PairSigner::::new(AccountKeyring::Bob.pair()); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// +// let nomination = client +// .nominate_and_watch(&alice, vec![bob.account_id().clone().into()]) +// .await; +// assert_matches!(nomination, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { +// // TOOD: this is unsatisfying – can we do better? +// assert_eq!(events.len(), 2); +// }); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_nominate_not_possible_for_stash_account() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let alice_stash = +// PairSigner::::new(get_from_seed("Alice//stash")); +// let bob = PairSigner::::new(AccountKeyring::Bob.pair()); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// +// let nomination = client +// .nominate_and_watch(&alice_stash, vec![bob.account_id().clone().into()]) +// .await; +// assert_matches!(nomination, Err(Error::Runtime(RuntimeError::Module(module_err))) => { +// assert_eq!(module_err.module, "Staking"); +// assert_eq!(module_err.error, "NotController"); +// }); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_chill_works_for_controller_only() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let alice_stash = +// PairSigner::::new(get_from_seed("Alice//stash")); +// let bob_stash = +// PairSigner::::new(get_from_seed("Bob//stash")); +// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// +// // this will fail the second time, which is why this is one test, not two +// client +// .nominate_and_watch(&alice, vec![bob_stash.account_id().clone().into()]) +// .await?; +// let store = LedgerStore { +// controller: alice.account_id().clone(), +// }; +// let StakingLedger { stash, .. } = client.fetch(&store, None).await?.unwrap(); +// assert_eq!(alice_stash.account_id(), &stash); +// let chill = client.chill_and_watch(&alice_stash).await; +// +// assert_matches!(chill, Err(Error::Runtime(RuntimeError::Module(module_err))) => { +// assert_eq!(module_err.module, "Staking"); +// assert_eq!(module_err.error, "NotController"); +// }); +// +// let chill = client.chill_and_watch(&alice).await; +// assert_matches!(chill, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { +// // TOOD: this is unsatisfying – can we do better? +// assert_eq!(events.len(), 2); +// }); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_bond() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// +// let bond = client +// .bond_and_watch( +// &alice, +// &AccountKeyring::Bob.to_account_id().into(), +// 100_000_000_000_000, +// RewardDestination::Stash, +// ) +// .await; +// +// assert_matches!(bond, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { +// // TOOD: this is unsatisfying – can we do better? +// assert_eq!(events.len(), 3); +// }); +// +// let bond_again = client +// .bond_and_watch( +// &alice, +// &AccountKeyring::Bob.to_account_id().into(), +// 100_000_000_000, +// RewardDestination::Stash, +// ) +// .await; +// +// assert_matches!(bond_again, Err(Error::Runtime(RuntimeError::Module(module_err))) => { +// assert_eq!(module_err.module, "Staking"); +// assert_eq!(module_err.error, "AlreadyBonded"); +// }); +// +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_total_issuance_is_okay() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let total_issuance = client.total_issuance(None).await?; +// assert!(total_issuance > 1u128 << 32); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_history_depth_is_okay() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let history_depth = client.history_depth(None).await?; +// assert_eq!(history_depth, 84); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_current_era_is_okay() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let _current_era = client +// .current_era(None) +// .await? +// .expect("current era always exists"); +// Ok(()) +// } +// +// #[async_std::test] +// async fn test_era_reward_points_is_okay() -> Result<(), Error> { +// env_logger::try_init().ok(); +// let test_node_proc = test_node_process().await; +// let client = test_node_proc.client(); +// let store = ErasRewardPointsStore { +// _phantom: PhantomData, +// index: 0, +// }; +// +// let current_era_result = client.fetch(&store, None).await?; +// +// assert_matches!(current_era_result, Some(_)); +// +// Ok(()) +// } From 696ee635c8e7186924d1f6c92a729b26bfe8fa72 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 16:37:13 +0100 Subject: [PATCH 113/216] Restore another staking test --- tests/src/frame/staking.rs | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index 4550b55af5..942a3b3ae4 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -62,13 +62,16 @@ fn get_from_seed(seed: &str) -> sr25519::Pair { .expect("static values are valid; qed") } +fn default_validator_prefs() -> ValidatorPrefs { + ValidatorPrefs { commission: sp_runtime::Perbill::default(), blocked: false } +} + #[async_std::test] async fn validate_with_controller_account() -> Result<(), Error> { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; let announce_validator = cxt.api.tx().staking() - .validate(ValidatorPrefs { commission: sp_runtime::Perbill::default(), blocked: false }) - + .validate(default_validator_prefs()) .sign_and_submit_then_watch(&alice) .await; assert_matches!(announce_validator, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { @@ -79,21 +82,20 @@ async fn validate_with_controller_account() -> Result<(), Error> { Ok(()) } -// #[async_std::test] -// async fn test_validate_not_possible_for_stash_account() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let announce_validator = client -// .validate_and_watch(&alice_stash, ValidatorPrefs::default()) -// .await; -// assert_matches!(announce_validator, Err(Error::Runtime(RuntimeError::Module(module_err))) => { -// assert_eq!(module_err.module, "Staking"); -// assert_eq!(module_err.error, "NotController"); -// }); -// Ok(()) -// } +#[async_std::test] +async fn validate_not_possible_for_stash_account() -> Result<(), Error> { + let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); + let cxt = test_context().await; + let announce_validator = cxt.api.tx().staking() + .validate(default_validator_prefs()) + .sign_and_submit_then_watch(&alice_stash) + .await; + assert_matches!(announce_validator, Err(Error::Runtime(RuntimeError::Module(module_err))) => { + assert_eq!(module_err.pallet, "Staking"); + assert_eq!(module_err.error, "NotController"); + }); + Ok(()) +} // // #[async_std::test] // async fn test_nominate_with_controller_account() -> Result<(), Error> { From 560ceb5fddae97dd621b4bc1ccbe581e9bed6535 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 16:46:18 +0100 Subject: [PATCH 114/216] Restore another staking test --- tests/src/frame/staking.rs | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index 942a3b3ae4..a19b2b1361 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -96,25 +96,24 @@ async fn validate_not_possible_for_stash_account() -> Result<(), Error> { }); Ok(()) } -// -// #[async_std::test] -// async fn test_nominate_with_controller_account() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); -// let bob = PairSigner::::new(AccountKeyring::Bob.pair()); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// -// let nomination = client -// .nominate_and_watch(&alice, vec![bob.account_id().clone().into()]) -// .await; -// assert_matches!(nomination, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { -// // TOOD: this is unsatisfying – can we do better? -// assert_eq!(events.len(), 2); -// }); -// Ok(()) -// } -// + +#[async_std::test] +async fn nominate_with_controller_account() -> Result<(), Error> { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let cxt = test_context().await; + + let nomination = cxt.api.tx().staking() + .nominate(vec![bob.account_id().clone().into()]) + .sign_and_submit_then_watch(&alice) + .await; + assert_matches!(nomination, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { + // TOOD: this is unsatisfying – can we do better? + assert_eq!(events.len(), 2); + }); + Ok(()) +} + // #[async_std::test] // async fn test_nominate_not_possible_for_stash_account() -> Result<(), Error> { // env_logger::try_init().ok(); From c5915b9c68ac9e761228a05b8edbb193ad2db37d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 16:48:16 +0100 Subject: [PATCH 115/216] Restore another staking test --- tests/src/frame/staking.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index a19b2b1361..bfaec3d488 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -114,24 +114,24 @@ async fn nominate_with_controller_account() -> Result<(), Error> { Ok(()) } -// #[async_std::test] -// async fn test_nominate_not_possible_for_stash_account() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let alice_stash = -// PairSigner::::new(get_from_seed("Alice//stash")); -// let bob = PairSigner::::new(AccountKeyring::Bob.pair()); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// -// let nomination = client -// .nominate_and_watch(&alice_stash, vec![bob.account_id().clone().into()]) -// .await; -// assert_matches!(nomination, Err(Error::Runtime(RuntimeError::Module(module_err))) => { -// assert_eq!(module_err.module, "Staking"); -// assert_eq!(module_err.error, "NotController"); -// }); -// Ok(()) -// } +#[async_std::test] +async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { + let alice_stash = + PairSigner::::new(get_from_seed("Alice//stash")); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let cxt = test_context().await; + + let nomination = cxt.api.tx().staking() + .nominate(vec![bob.account_id().clone().into()]) + .sign_and_submit_then_watch(&alice_stash) + .await; + + assert_matches!(nomination, Err(Error::Runtime(RuntimeError::Module(module_err))) => { + assert_eq!(module_err.pallet, "Staking"); + assert_eq!(module_err.error, "NotController"); + }); + Ok(()) +} // // #[async_std::test] // async fn test_chill_works_for_controller_only() -> Result<(), Error> { From 5e9b7d2fd341e0ea966118d74a99ed2f2869aa8e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 5 Oct 2021 17:09:56 +0100 Subject: [PATCH 116/216] Partially restore chill_works_for_controller_only staking test --- tests/src/frame/staking.rs | 83 ++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 44 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index bfaec3d488..1a1ae040e7 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -//! Implements support for the pallet_staking module. - use codec::{ Decode, Encode, @@ -25,13 +23,16 @@ use assert_matches::assert_matches; use crate::{ test_context, TestRuntime, - node_runtime::runtime_types::pallet_staking::{ - ActiveEraInfo, - Exposure, - Nominations, - RewardDestination, - StakingLedger, - ValidatorPrefs, + node_runtime::{ + runtime_types::pallet_staking::{ + ActiveEraInfo, + Exposure, + Nominations, + RewardDestination, + StakingLedger, + ValidatorPrefs, + }, + staking, } }; use sp_core::{ @@ -132,41 +133,35 @@ async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { }); Ok(()) } -// -// #[async_std::test] -// async fn test_chill_works_for_controller_only() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let alice_stash = -// PairSigner::::new(get_from_seed("Alice//stash")); -// let bob_stash = -// PairSigner::::new(get_from_seed("Bob//stash")); -// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// -// // this will fail the second time, which is why this is one test, not two -// client -// .nominate_and_watch(&alice, vec![bob_stash.account_id().clone().into()]) -// .await?; -// let store = LedgerStore { -// controller: alice.account_id().clone(), -// }; -// let StakingLedger { stash, .. } = client.fetch(&store, None).await?.unwrap(); -// assert_eq!(alice_stash.account_id(), &stash); -// let chill = client.chill_and_watch(&alice_stash).await; -// -// assert_matches!(chill, Err(Error::Runtime(RuntimeError::Module(module_err))) => { -// assert_eq!(module_err.module, "Staking"); -// assert_eq!(module_err.error, "NotController"); -// }); -// -// let chill = client.chill_and_watch(&alice).await; -// assert_matches!(chill, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { -// // TOOD: this is unsatisfying – can we do better? -// assert_eq!(events.len(), 2); -// }); -// Ok(()) -// } + +#[async_std::test] +async fn chill_works_for_controller_only() -> Result<(), Error> { + let alice_stash = + PairSigner::::new(get_from_seed("Alice//stash")); + let bob_stash = + PairSigner::::new(get_from_seed("Bob//stash")); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let cxt = test_context().await; + + // this will fail the second time, which is why this is one test, not two + cxt.api.tx().staking() + .nominate(vec![bob_stash.account_id().clone().into()]) + .sign_and_submit_then_watch(&alice) + .await; + // let ledger = cxt.api.storage().staking().ledger(alice.account_id().clone(), None).await?.unwrap(); + // assert_eq!(alice_stash.account_id(), &ledger.stash); + let chill = cxt.api.tx().staking().chill().sign_and_submit_then_watch(&alice_stash).await; + + assert_matches!(chill, Err(Error::Runtime(RuntimeError::Module(module_err))) => { + assert_eq!(module_err.pallet, "Staking"); + assert_eq!(module_err.error, "NotController"); + }); + + let result = cxt.api.tx().staking().chill().sign_and_submit_then_watch(&alice).await?; + let chill = result.find_event::()?; + assert!(chill.is_some()); + Ok(()) +} // // #[async_std::test] // async fn test_bond() -> Result<(), Error> { From 34e1da542a326334aa5cdb9fbea93f6cb612bb2d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 09:46:53 +0100 Subject: [PATCH 117/216] Fix fetching Optional storage entries --- proc-macro/src/generate_runtime.rs | 22 +++++++--- src/storage.rs | 1 + tests/src/frame/staking.rs | 68 +++++++++++++++++++++++------- 3 files changed, 68 insertions(+), 23 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 0ee908c226..944ab94568 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -529,14 +529,22 @@ impl RuntimeGenerator { let pallet_name = &pallet.name; let storage_name = &storage_entry.name; let fn_name = format_ident!("{}", storage_entry.name.to_snake_case()); - let return_ty = match storage_entry.ty { + let storage_entry_ty = match storage_entry.ty { StorageEntryType::Plain(ref ty) => ty, StorageEntryType::Map { ref value, .. } => value, }; - let return_ty_path = type_gen.resolve_type_path(return_ty.id(), &[]); - let return_ty = match storage_entry.modifier { - StorageEntryModifier::Default => quote!( #return_ty_path ), - StorageEntryModifier::Optional => quote!( Option<#return_ty_path> ), + let storage_entry_value_ty = + type_gen.resolve_type_path(storage_entry_ty.id(), &[]); + let (return_ty, fetch) = match storage_entry.modifier { + StorageEntryModifier::Default => { + (quote!( #storage_entry_value_ty ), quote!(fetch_or_default)) + } + StorageEntryModifier::Optional => { + ( + quote!( ::core::option::Option<#storage_entry_value_ty> ), + quote!(fetch), + ) + } }; let storage_entry_type = quote! { @@ -545,7 +553,7 @@ impl RuntimeGenerator { impl ::subxt::StorageEntry for #entry_struct_ident { const PALLET: &'static str = #pallet_name; const STORAGE: &'static str = #storage_name; - type Value = #return_ty; + type Value = #storage_entry_value_ty; fn key(&self) -> ::subxt::StorageEntryKey { #key_impl } @@ -562,7 +570,7 @@ impl RuntimeGenerator { hash: ::core::option::Option, ) -> ::core::result::Result<#return_ty, ::subxt::Error> { let entry = #constructor; - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().#fetch(&entry, hash).await } }; diff --git a/src/storage.rs b/src/storage.rs index 2007d037bd..444649cb89 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -156,6 +156,7 @@ impl<'a, T: Runtime> StorageClient<'a, T> { key: StorageKey, hash: Option, ) -> Result, Error> { + // todo: handle Optional? if let Some(data) = self.rpc.storage(&key, hash).await? { Ok(Some(Decode::decode(&mut &data.0[..])?)) } else { diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index 1a1ae040e7..8a43c148cc 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -19,10 +19,7 @@ use codec::{ Encode, }; -use assert_matches::assert_matches; use crate::{ - test_context, - TestRuntime, node_runtime::{ runtime_types::pallet_staking::{ ActiveEraInfo, @@ -33,8 +30,11 @@ use crate::{ ValidatorPrefs, }, staking, - } + }, + test_context, + TestRuntime, }; +use assert_matches::assert_matches; use sp_core::{ sr25519, Pair, @@ -48,13 +48,13 @@ use std::{ }; use subxt::{ - RuntimeError, extrinsic::{ PairSigner, Signer, }, Error, ExtrinsicSuccess, + RuntimeError, }; /// Helper function to generate a crypto pair from seed @@ -64,14 +64,20 @@ fn get_from_seed(seed: &str) -> sr25519::Pair { } fn default_validator_prefs() -> ValidatorPrefs { - ValidatorPrefs { commission: sp_runtime::Perbill::default(), blocked: false } + ValidatorPrefs { + commission: sp_runtime::Perbill::default(), + blocked: false, + } } #[async_std::test] async fn validate_with_controller_account() -> Result<(), Error> { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; - let announce_validator = cxt.api.tx().staking() + let announce_validator = cxt + .api + .tx() + .staking() .validate(default_validator_prefs()) .sign_and_submit_then_watch(&alice) .await; @@ -87,7 +93,10 @@ async fn validate_with_controller_account() -> Result<(), Error> { async fn validate_not_possible_for_stash_account() -> Result<(), Error> { let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); let cxt = test_context().await; - let announce_validator = cxt.api.tx().staking() + let announce_validator = cxt + .api + .tx() + .staking() .validate(default_validator_prefs()) .sign_and_submit_then_watch(&alice_stash) .await; @@ -104,7 +113,10 @@ async fn nominate_with_controller_account() -> Result<(), Error> { let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let cxt = test_context().await; - let nomination = cxt.api.tx().staking() + let nomination = cxt + .api + .tx() + .staking() .nominate(vec![bob.account_id().clone().into()]) .sign_and_submit_then_watch(&alice) .await; @@ -122,7 +134,10 @@ async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let cxt = test_context().await; - let nomination = cxt.api.tx().staking() + let nomination = cxt + .api + .tx() + .staking() .nominate(vec![bob.account_id().clone().into()]) .sign_and_submit_then_watch(&alice_stash) .await; @@ -144,25 +159,46 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { let cxt = test_context().await; // this will fail the second time, which is why this is one test, not two - cxt.api.tx().staking() + cxt.api + .tx() + .staking() .nominate(vec![bob_stash.account_id().clone().into()]) .sign_and_submit_then_watch(&alice) .await; - // let ledger = cxt.api.storage().staking().ledger(alice.account_id().clone(), None).await?.unwrap(); - // assert_eq!(alice_stash.account_id(), &ledger.stash); - let chill = cxt.api.tx().staking().chill().sign_and_submit_then_watch(&alice_stash).await; + + let ledger = cxt + .api + .storage() + .staking() + .ledger(alice.account_id().clone(), None) + .await? + .unwrap(); + assert_eq!(alice_stash.account_id(), &ledger.stash); + + let chill = cxt + .api + .tx() + .staking() + .chill() + .sign_and_submit_then_watch(&alice_stash) + .await; assert_matches!(chill, Err(Error::Runtime(RuntimeError::Module(module_err))) => { assert_eq!(module_err.pallet, "Staking"); assert_eq!(module_err.error, "NotController"); }); - let result = cxt.api.tx().staking().chill().sign_and_submit_then_watch(&alice).await?; + let result = cxt + .api + .tx() + .staking() + .chill() + .sign_and_submit_then_watch(&alice) + .await?; let chill = result.find_event::()?; assert!(chill.is_some()); Ok(()) } -// // #[async_std::test] // async fn test_bond() -> Result<(), Error> { // env_logger::try_init().ok(); From 442fe24c4ba57817b2ae867e037839d450685cba Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 09:51:11 +0100 Subject: [PATCH 118/216] Restore staking bond test --- tests/src/frame/staking.rs | 78 +++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index 8a43c148cc..acc5f8ffa9 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -164,7 +164,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { .staking() .nominate(vec![bob_stash.account_id().clone().into()]) .sign_and_submit_then_watch(&alice) - .await; + .await?; let ledger = cxt .api @@ -199,43 +199,45 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { assert!(chill.is_some()); Ok(()) } -// #[async_std::test] -// async fn test_bond() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let alice = PairSigner::::new(AccountKeyring::Alice.pair()); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// -// let bond = client -// .bond_and_watch( -// &alice, -// &AccountKeyring::Bob.to_account_id().into(), -// 100_000_000_000_000, -// RewardDestination::Stash, -// ) -// .await; -// -// assert_matches!(bond, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { -// // TOOD: this is unsatisfying – can we do better? -// assert_eq!(events.len(), 3); -// }); -// -// let bond_again = client -// .bond_and_watch( -// &alice, -// &AccountKeyring::Bob.to_account_id().into(), -// 100_000_000_000, -// RewardDestination::Stash, -// ) -// .await; -// -// assert_matches!(bond_again, Err(Error::Runtime(RuntimeError::Module(module_err))) => { -// assert_eq!(module_err.module, "Staking"); -// assert_eq!(module_err.error, "AlreadyBonded"); -// }); -// -// Ok(()) -// } + +#[async_std::test] +async fn bond() -> Result<(), Error> { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let cxt = test_context().await; + + let bond = cxt + .api + .tx() + .staking() + .bond( + AccountKeyring::Bob.to_account_id().into(), + 100_000_000_000_000, + RewardDestination::Stash, + ) + .sign_and_submit_then_watch(&alice) + .await; + + assert!(bond.is_ok()); + + let bond_again = cxt + .api + .tx() + .staking() + .bond( + AccountKeyring::Bob.to_account_id().into(), + 100_000_000_000_000, + RewardDestination::Stash, + ) + .sign_and_submit_then_watch(&alice) + .await; + + assert_matches!(bond_again, Err(Error::Runtime(RuntimeError::Module(module_err))) => { + assert_eq!(module_err.pallet, "Staking"); + assert_eq!(module_err.error, "AlreadyBonded"); + }); + + Ok(()) +} // // #[async_std::test] // async fn test_total_issuance_is_okay() -> Result<(), Error> { From 35a3141ee1de693d2889a94fad80482be9ec637e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 10:05:46 +0100 Subject: [PATCH 119/216] Restore remaining staking tests --- tests/src/frame/staking.rs | 94 ++++++++++++-------------------------- 1 file changed, 28 insertions(+), 66 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index acc5f8ffa9..38614fff3c 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -14,19 +14,10 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use codec::{ - Decode, - Encode, -}; - use crate::{ node_runtime::{ runtime_types::pallet_staking::{ - ActiveEraInfo, - Exposure, - Nominations, RewardDestination, - StakingLedger, ValidatorPrefs, }, staking, @@ -40,13 +31,6 @@ use sp_core::{ Pair, }; use sp_keyring::AccountKeyring; - -use std::{ - collections::BTreeMap, - fmt::Debug, - marker::PhantomData, -}; - use subxt::{ extrinsic::{ PairSigner, @@ -201,7 +185,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { } #[async_std::test] -async fn bond() -> Result<(), Error> { +async fn tx_bond() -> Result<(), Error> { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; @@ -238,52 +222,30 @@ async fn bond() -> Result<(), Error> { Ok(()) } -// -// #[async_std::test] -// async fn test_total_issuance_is_okay() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let total_issuance = client.total_issuance(None).await?; -// assert!(total_issuance > 1u128 << 32); -// Ok(()) -// } -// -// #[async_std::test] -// async fn test_history_depth_is_okay() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let history_depth = client.history_depth(None).await?; -// assert_eq!(history_depth, 84); -// Ok(()) -// } -// -// #[async_std::test] -// async fn test_current_era_is_okay() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let _current_era = client -// .current_era(None) -// .await? -// .expect("current era always exists"); -// Ok(()) -// } -// -// #[async_std::test] -// async fn test_era_reward_points_is_okay() -> Result<(), Error> { -// env_logger::try_init().ok(); -// let test_node_proc = test_node_process().await; -// let client = test_node_proc.client(); -// let store = ErasRewardPointsStore { -// _phantom: PhantomData, -// index: 0, -// }; -// -// let current_era_result = client.fetch(&store, None).await?; -// -// assert_matches!(current_era_result, Some(_)); -// -// Ok(()) -// } + +#[async_std::test] +async fn storage_history_depth() -> Result<(), Error> { + let cxt = test_context().await; + let history_depth = cxt.api.storage().staking().history_depth(None).await?; + assert_eq!(history_depth, 84); + Ok(()) +} + +#[async_std::test] +async fn storage_current_era() -> Result<(), Error> { + let cxt = test_context().await; + let _current_era = cxt.api.storage().staking() + .current_era(None) + .await? + .expect("current era always exists"); + Ok(()) +} + +#[async_std::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(()) +} From 83af04ee259e118634849b6732b6de7ad617fb73 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 10:06:07 +0100 Subject: [PATCH 120/216] Fmt --- tests/src/frame/staking.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/src/frame/staking.rs b/tests/src/frame/staking.rs index 38614fff3c..fc1f9e0794 100644 --- a/tests/src/frame/staking.rs +++ b/tests/src/frame/staking.rs @@ -234,7 +234,10 @@ async fn storage_history_depth() -> Result<(), Error> { #[async_std::test] async fn storage_current_era() -> Result<(), Error> { let cxt = test_context().await; - let _current_era = cxt.api.storage().staking() + let _current_era = cxt + .api + .storage() + .staking() .current_era(None) .await? .expect("current era always exists"); @@ -244,7 +247,12 @@ async fn storage_current_era() -> Result<(), Error> { #[async_std::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; + let current_era_result = cxt + .api + .storage() + .staking() + .eras_reward_points(0, None) + .await; assert!(current_era_result.is_ok()); Ok(()) From b95ce3d4859782c5b82648f3f56df7022e1c146f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 12:27:59 +0100 Subject: [PATCH 121/216] Restore sudo tests --- tests/src/frame/mod.rs | 3 + tests/src/frame/sudo.rs | 134 ++++++++++++---------------------------- 2 files changed, 42 insertions(+), 95 deletions(-) diff --git a/tests/src/frame/mod.rs b/tests/src/frame/mod.rs index 373c4e766f..4b8b497999 100644 --- a/tests/src/frame/mod.rs +++ b/tests/src/frame/mod.rs @@ -14,6 +14,9 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . +//! Test interactions with some built-in FRAME pallets. + mod balances; mod contracts; mod staking; +mod sudo; diff --git a/tests/src/frame/sudo.rs b/tests/src/frame/sudo.rs index 31fe409919..89d7ef7e47 100644 --- a/tests/src/frame/sudo.rs +++ b/tests/src/frame/sudo.rs @@ -14,109 +14,53 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -//! Implements support for the frame_sudo module. - +use assert_matches::assert_matches; use crate::{ - frame::system::System, - Encoded, + TestRuntime, + test_context, + node_runtime::{ + runtime_types, + sudo, + }, }; -use codec::Encode; -use core::marker::PhantomData; -use frame_support::weights::Weight; - -/// The subset of the `frame_sudo::Trait` that a client must implement. -#[module] -pub trait Sudo: System {} - -/// Execute a transaction with sudo permissions. -#[derive(Clone, Debug, Eq, PartialEq, Call, Encode)] -pub struct SudoCall<'a, T: Sudo> { - /// Runtime marker. - pub _runtime: PhantomData, - /// Encoded transaction. - pub call: &'a Encoded, -} +use subxt::extrinsic::PairSigner; +use sp_keyring::AccountKeyring; -/// Execute a transaction with sudo permissions without checking the call weight. -#[derive(Clone, Debug, Eq, PartialEq, Call, Encode)] -pub struct SudoUncheckedWeightCall<'a, T: Sudo> { - /// Runtime marker. - pub _runtime: PhantomData, - /// Encoded transaction. - pub call: &'a Encoded, - /// Call weight. - /// - /// This argument is actually unused in runtime, you can pass any value of - /// `Weight` type when using this call. - pub weight: Weight, -} +// todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call +type Call = runtime_types::node_runtime::Call; +type BalancesCall = runtime_types::pallet_balances::pallet::Call; -#[cfg(test)] -mod tests { - use super::*; - use crate::{ - error::{ - Error, - RuntimeError, - }, - extrinsic::PairSigner, - frame::balances::TransferCall, - tests::{ - test_node_process, - TestRuntime, - }, - }; - use sp_keyring::AccountKeyring; +#[async_std::test] +async fn test_sudo() { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id().clone().into(); + let cxt = test_context().await; - #[async_std::test] - async fn test_sudo() { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id().clone().into(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); + // todo: [AJ] allow encoded call to be constructed dynamically + let call = Call::Balances(BalancesCall::transfer { + dest: bob, + value: 10_000, + }); - let call = client - .encode(TransferCall { - to: &bob, - amount: 10_000, - }) - .unwrap(); + let res = cxt.api.tx().sudo().sudo(call).sign_and_submit_then_watch(&alice).await.unwrap(); + let sudid = res.find_event::(); + assert_matches!(sudid, Ok(Some(_))) +} - let res = client.sudo_and_watch(&alice, &call).await; - assert!( - if let Err(Error::Runtime(RuntimeError::BadOrigin)) = res { - true - } else { - false - } - ); - } +#[async_std::test] +async fn test_sudo_unchecked_weight() { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = AccountKeyring::Bob.to_account_id().into(); + let cxt = test_context().await; - #[async_std::test] - async fn test_sudo_unchecked_weight() { - env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id().into(); - let test_node_proc = test_node_process().await; - let client = test_node_proc.client(); + let call = Call::Balances(BalancesCall::transfer { + dest: bob, + value: 10_000, + }); - let call = client - .encode(TransferCall { - to: &bob, - amount: 10_000, - }) - .unwrap(); + let res = cxt.api.tx().sudo().sudo_unchecked_weight(call, 0) + .sign_and_submit_then_watch(&alice).await.unwrap(); - let res = client - .sudo_unchecked_weight_and_watch(&alice, &call, 0u64) - .await; - assert!( - if let Err(Error::Runtime(RuntimeError::BadOrigin)) = res { - true - } else { - false - } - ); - } + let sudid = res.find_event::(); + assert_matches!(sudid, Ok(Some(_))) } From 79355d365608ba29a30066ea8c5ce33526d044ed Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 13:15:10 +0100 Subject: [PATCH 122/216] Add some system tests --- tests/src/frame/balances.rs | 2 - tests/src/frame/mod.rs | 1 + tests/src/frame/system.rs | 218 +++++------------------------------- 3 files changed, 30 insertions(+), 191 deletions(-) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index 3be970dc55..f05296ffdc 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -//! Implements support for the pallet_balances module. - use crate::{ node_runtime::{ balances, diff --git a/tests/src/frame/mod.rs b/tests/src/frame/mod.rs index 4b8b497999..5a092cf474 100644 --- a/tests/src/frame/mod.rs +++ b/tests/src/frame/mod.rs @@ -20,3 +20,4 @@ mod balances; mod contracts; mod staking; mod sudo; +mod system; diff --git a/tests/src/frame/system.rs b/tests/src/frame/system.rs index a94904cdf3..35b92d8d0c 100644 --- a/tests/src/frame/system.rs +++ b/tests/src/frame/system.rs @@ -14,202 +14,42 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -//! Implements support for the frame_system module. - -use codec::{ - Codec, - Decode, - Encode, -}; -use core::marker::PhantomData; -use frame_support::{ - weights::DispatchInfo, - Parameter, +use assert_matches::assert_matches; +use crate::{ + node_runtime::system, + test_context, + TestRuntime, }; -use serde::de::DeserializeOwned; -use sp_runtime::{ - traits::{ - AtLeast32Bit, - AtLeast32BitUnsigned, - Bounded, - CheckEqual, - Extrinsic, - Hash, - Header, - MaybeDisplay, - MaybeMallocSizeOf, - MaybeSerialize, - MaybeSerializeDeserialize, - Member, - SimpleBitOps, +use sp_keyring::AccountKeyring; +use subxt::{ + extrinsic::{ + PairSigner, + Signer, }, - DispatchError, }; -use std::fmt::Debug; - -/// The subset of the `frame::Trait` that a client must implement. -#[module] -pub trait System { - /// Account index (aka nonce) type. This stores the number of previous - /// transactions associated with a sender account. - type Index: Parameter - + Member - + MaybeSerialize - + Debug - + Default - + MaybeDisplay - + AtLeast32Bit - + Copy; - - /// The block number type used by the runtime. - type BlockNumber: Parameter - + Member - + MaybeMallocSizeOf - + MaybeSerializeDeserialize - + Debug - + MaybeDisplay - + AtLeast32BitUnsigned - + Default - + Bounded - + Copy - + std::hash::Hash - + std::str::FromStr; - - /// The output of the `Hashing` function. - type Hash: Parameter - + Member - + MaybeMallocSizeOf - + MaybeSerializeDeserialize - + Debug - + MaybeDisplay - + Ord - + SimpleBitOps - + Default - + Copy - + CheckEqual - + std::hash::Hash - + AsRef<[u8]> - + AsMut<[u8]>; - - /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). - #[module(ignore)] - type Hashing: Hash; - - /// The user account identifier type for the runtime. - type AccountId: Parameter + Member + MaybeSerialize + MaybeDisplay + Ord + Default; - - /// The address type. This instead of `::Source`. - #[module(ignore)] - type Address: Codec + Clone + PartialEq + Debug + Send + Sync; - - /// The block header. - #[module(ignore)] - type Header: Parameter - + Header - + DeserializeOwned; - - /// Extrinsic type within blocks. - #[module(ignore)] - type Extrinsic: Parameter + Member + Extrinsic + Debug + MaybeSerializeDeserialize; - - /// Data to be associated with an account (other than nonce/transaction counter, which this - /// module does regardless). - type AccountData: Member + Codec + Clone + Default; -} - -/// Type used to encode the number of references an account has. -pub type RefCount = u32; -/// Information of an account. -#[derive(Clone, Debug, Eq, PartialEq, Default, Decode, Encode)] -pub struct AccountInfo { - /// The number of transactions this account has sent. - pub nonce: T::Index, - /// The number of other modules that currently depend on this account's existence. The account - /// cannot be reaped until this is zero. - pub consumers: RefCount, - /// The number of other modules that allow this account to exist. The account may not be reaped - /// until this is zero. - pub providers: RefCount, - /// The additional data that belongs to this account. Used to store the balance(s) in a lot of - /// chains. - pub data: T::AccountData, -} - -/// Account field of the `System` module. -#[derive(Clone, Debug, Eq, PartialEq, Store, Encode)] -pub struct AccountStore<'a, T: System> { - #[store(returns = AccountInfo)] - /// Account to retrieve the `AccountInfo` for. - pub account_id: &'a T::AccountId, -} +#[async_std::test] +async fn storage_account() { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); -/// Arguments for updating the runtime code -#[derive(Clone, Debug, Eq, PartialEq, Call, Encode)] -pub struct SetCodeCall<'a, T: System> { - /// Runtime marker. - pub _runtime: PhantomData, - /// Runtime wasm blob. - pub code: &'a [u8], + let cxt = test_context().await; + let account_info = cxt.api + .storage() + .system() + .account(alice.account_id().clone().into(), None) + .await; + assert_matches!(account_info, Ok(_)) } -/// Arguments for updating the runtime code without checks -#[derive(Clone, Debug, Eq, PartialEq, Call, Encode)] -pub struct SetCodeWithoutChecksCall<'a, T: System> { - /// Runtime marker. - pub _runtime: PhantomData, - /// Runtime wasm blob. - pub code: &'a [u8], -} +#[async_std::test] +async fn tx_remark_with_event() { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let cxt = test_context().await; -/// A phase of a block's execution. -#[derive(Clone, Debug, Eq, PartialEq, Decode)] -pub enum Phase { - /// Applying an extrinsic. - ApplyExtrinsic(u32), - /// Finalizing the block. - Finalization, - /// Initializing the block. - Initialization, -} - -/// An extrinsic completed successfully. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct ExtrinsicSuccessEvent { - /// Runtime marker. - pub _runtime: PhantomData, - /// The dispatch info. - pub info: DispatchInfo, -} - -/// An extrinsic failed. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct ExtrinsicFailedEvent { - /// Runtime marker. - pub _runtime: PhantomData, - /// The dispatch error. - pub error: DispatchError, - /// The dispatch info. - pub info: DispatchInfo, -} - -/// `:code` was updated. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct CodeUpdatedEvent { - /// Runtime marker. - pub _runtime: PhantomData, -} - -/// A new account was created. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct NewAccountEvent { - /// Created account id. - pub account: T::AccountId, -} + let result = cxt.api.tx().system().remark_with_event(b"remarkable".to_vec()).sign_and_submit_then_watch(&alice) + .await + .unwrap(); -/// An account was reaped. -#[derive(Clone, Debug, Eq, PartialEq, Event, Decode)] -pub struct KilledAccountEvent { - /// Killed account id. - pub account: T::AccountId, + let remarked = result.find_event::(); + assert_matches!(remarked, Ok(Some(_))); } From 5e7b7e7a61563a95608a05789741a6baec0b5f66 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 13:15:30 +0100 Subject: [PATCH 123/216] Fmt --- tests/src/frame/sudo.rs | 27 ++++++++++++++++++++------- tests/src/frame/system.rs | 20 ++++++++++++-------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/tests/src/frame/sudo.rs b/tests/src/frame/sudo.rs index 89d7ef7e47..8833204b08 100644 --- a/tests/src/frame/sudo.rs +++ b/tests/src/frame/sudo.rs @@ -14,17 +14,17 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use assert_matches::assert_matches; use crate::{ - TestRuntime, - test_context, node_runtime::{ runtime_types, sudo, }, + test_context, + TestRuntime, }; -use subxt::extrinsic::PairSigner; +use assert_matches::assert_matches; use sp_keyring::AccountKeyring; +use subxt::extrinsic::PairSigner; // todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call type Call = runtime_types::node_runtime::Call; @@ -42,7 +42,14 @@ async fn test_sudo() { value: 10_000, }); - let res = cxt.api.tx().sudo().sudo(call).sign_and_submit_then_watch(&alice).await.unwrap(); + let res = cxt + .api + .tx() + .sudo() + .sudo(call) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); let sudid = res.find_event::(); assert_matches!(sudid, Ok(Some(_))) } @@ -58,8 +65,14 @@ async fn test_sudo_unchecked_weight() { value: 10_000, }); - let res = cxt.api.tx().sudo().sudo_unchecked_weight(call, 0) - .sign_and_submit_then_watch(&alice).await.unwrap(); + let res = cxt + .api + .tx() + .sudo() + .sudo_unchecked_weight(call, 0) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); let sudid = res.find_event::(); assert_matches!(sudid, Ok(Some(_))) diff --git a/tests/src/frame/system.rs b/tests/src/frame/system.rs index 35b92d8d0c..71196c6d9f 100644 --- a/tests/src/frame/system.rs +++ b/tests/src/frame/system.rs @@ -14,18 +14,16 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use assert_matches::assert_matches; use crate::{ node_runtime::system, test_context, TestRuntime, }; +use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::{ - extrinsic::{ - PairSigner, - Signer, - }, +use subxt::extrinsic::{ + PairSigner, + Signer, }; #[async_std::test] @@ -33,7 +31,8 @@ async fn storage_account() { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; - let account_info = cxt.api + let account_info = cxt + .api .storage() .system() .account(alice.account_id().clone().into(), None) @@ -46,7 +45,12 @@ async fn tx_remark_with_event() { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; - let result = cxt.api.tx().system().remark_with_event(b"remarkable".to_vec()).sign_and_submit_then_watch(&alice) + let result = cxt + .api + .tx() + .system() + .remark_with_event(b"remarkable".to_vec()) + .sign_and_submit_then_watch(&alice) .await .unwrap(); From 368ec3b04d811c98f0f3cd9ec3a8fe3fa1f15299 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 15:41:26 +0100 Subject: [PATCH 124/216] Resolve some todos --- proc-macro/src/generate_runtime.rs | 10 ++++++++-- src/storage.rs | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 944ab94568..9c31040a19 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -304,8 +304,14 @@ impl RuntimeGenerator { let meta = attr.parse_meta().unwrap_or_else(|e| { abort!(attr.span(), "Error parsing attribute: {}", e) }); - let substitute_type_args = - Subxt::from_meta(&meta).unwrap(); // todo + let substitute_type_args = Subxt::from_meta(&meta) + .unwrap_or_else(|e| { + abort!( + attr.span(), + "Error parsing attribute meta: {}", + e + ) + }); substitute_type_args }) .collect::>(); diff --git a/src/storage.rs b/src/storage.rs index 444649cb89..2007d037bd 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -156,7 +156,6 @@ impl<'a, T: Runtime> StorageClient<'a, T> { key: StorageKey, hash: Option, ) -> Result, Error> { - // todo: handle Optional? if let Some(data) = self.rpc.storage(&key, hash).await? { Ok(Some(Decode::decode(&mut &data.0[..])?)) } else { From f819cb6d8aa129d33d3fa6371fc972b73f3e9eaa Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 16:35:34 +0100 Subject: [PATCH 125/216] Remove pass through rpc methods on Client, expose via rpc() getter --- src/client.rs | 87 +------------------------------------ tests/src/client.rs | 13 +++--- tests/src/frame/balances.rs | 2 +- 3 files changed, 10 insertions(+), 92 deletions(-) diff --git a/src/client.rs b/src/client.rs index ab28572237..bd51a8c926 100644 --- a/src/client.rs +++ b/src/client.rs @@ -16,10 +16,8 @@ use futures::future; use jsonrpsee_http_client::HttpClientBuilder; -use jsonrpsee_types::Subscription; use jsonrpsee_ws_client::WsClientBuilder; use sp_core::{ - storage::StorageKey, Bytes, }; pub use sp_runtime::traits::SignedExtension; @@ -38,21 +36,17 @@ use crate::{ UncheckedExtrinsic, }, rpc::{ - ChainBlock, ExtrinsicSuccess, Rpc, RpcClient, SystemProperties, }, storage::StorageClient, - subscription::EventStorageSubscription, AccountData, - BlockNumber, Call, Encoded, Error, Metadata, - ReadProof, Runtime, }; @@ -189,85 +183,8 @@ impl Client { } /// Returns the rpc client. - pub fn rpc_client(&self) -> &RpcClient { - &self.rpc.client - } - - /// Get a header - pub async fn header(&self, hash: Option) -> Result, Error> - where - H: Into + 'static, - { - let header = self.rpc.header(hash.map(|h| h.into())).await?; - Ok(header) - } - - /// Get a block hash. By default returns the latest block hash - pub async fn block_hash( - &self, - block_number: Option, - ) -> Result, Error> { - let hash = self.rpc.block_hash(block_number).await?; - Ok(hash) - } - - /// Get a block hash of the latest finalized block - pub async fn finalized_head(&self) -> Result { - let head = self.rpc.finalized_head().await?; - Ok(head) - } - - /// Get a block - pub async fn block(&self, hash: Option) -> Result>, Error> - where - H: Into + 'static, - { - let block = self.rpc.block(hash.map(|h| h.into())).await?; - Ok(block) - } - - /// Get proof of storage entries at a specific block's state. - pub async fn read_proof( - &self, - keys: Vec, - hash: Option, - ) -> Result, Error> - where - H: Into + 'static, - { - let proof = self.rpc.read_proof(keys, hash.map(|h| h.into())).await?; - Ok(proof) - } - - /// Subscribe to events. - /// - /// *WARNING* these may not be included in the finalized chain, use - /// `subscribe_finalized_events` to ensure events are finalized. - pub async fn subscribe_events(&self) -> Result, Error> { - let events = self.rpc.subscribe_events().await?; - Ok(events) - } - - /// Subscribe to finalized events. - pub async fn subscribe_finalized_events( - &self, - ) -> Result, Error> { - let events = self.rpc.subscribe_finalized_events().await?; - Ok(events) - } - - /// Subscribe to new blocks. - pub async fn subscribe_blocks(&self) -> Result, Error> { - let headers = self.rpc.subscribe_blocks().await?; - Ok(headers) - } - - /// Subscribe to finalized blocks. - pub async fn subscribe_finalized_blocks( - &self, - ) -> Result, Error> { - let headers = self.rpc.subscribe_finalized_blocks().await?; - Ok(headers) + pub fn rpc(&self) -> &Rpc { + &self.rpc } /// Create a client for accessing runtime storage diff --git a/tests/src/client.rs b/tests/src/client.rs index 8f42bedecf..b6b383dfd7 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -48,23 +48,24 @@ async fn insert_key() { #[async_std::test] async fn fetch_block_hash() { let node_process = test_node_process().await; - node_process.client().block_hash(None).await.unwrap(); + node_process.client().rpc().block_hash(None).await.unwrap(); } #[async_std::test] async fn fetch_block() { let node_process = test_node_process().await; let client = node_process.client(); - let block_hash = client.block_hash(None).await.unwrap(); - client.block(block_hash).await.unwrap(); + let block_hash = client.rpc().block_hash(None).await.unwrap(); + client.rpc().block(block_hash).await.unwrap(); } #[async_std::test] async fn fetch_read_proof() { let node_process = test_node_process().await; let client = node_process.client(); - let block_hash = client.block_hash(None).await.unwrap(); + let block_hash = client.rpc().block_hash(None).await.unwrap(); client + .rpc() .read_proof( vec![ StorageKey(well_known_keys::HEAP_PAGES.to_vec()), @@ -80,7 +81,7 @@ async fn fetch_read_proof() { async fn chain_subscribe_blocks() { let node_process = test_node_process().await; let client = node_process.client(); - let mut blocks = client.subscribe_blocks().await.unwrap(); + let mut blocks = client.rpc().subscribe_blocks().await.unwrap(); blocks.next().await.unwrap(); } @@ -88,7 +89,7 @@ async fn chain_subscribe_blocks() { async fn chain_subscribe_finalized_blocks() { let node_process = test_node_process().await; let client = node_process.client(); - let mut blocks = client.subscribe_finalized_blocks().await.unwrap(); + let mut blocks = client.rpc().subscribe_finalized_blocks().await.unwrap(); blocks.next().await.unwrap(); } diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index f05296ffdc..d41ab7025b 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -198,7 +198,7 @@ async fn transfer_subscription() { let bob = AccountKeyring::Bob.to_account_id(); let bob_addr = bob.clone().into(); let cxt = test_context().await; - let sub = cxt.client.subscribe_events().await.unwrap(); + let sub = cxt.client.rpc().subscribe_events().await.unwrap(); let decoder = cxt.client.events_decoder(); let mut sub = EventSubscription::::new(sub, &decoder); sub.filter_event::(); From 903b1532cb629b1971f3829623fe9675f00b7bfd Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 16:44:34 +0100 Subject: [PATCH 126/216] Remove more rpc pass through methods --- src/client.rs | 38 -------------------------------------- tests/src/client.rs | 2 ++ 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/client.rs b/src/client.rs index bd51a8c926..95644068a7 100644 --- a/src/client.rs +++ b/src/client.rs @@ -17,9 +17,6 @@ use futures::future; use jsonrpsee_http_client::HttpClientBuilder; use jsonrpsee_ws_client::WsClientBuilder; -use sp_core::{ - Bytes, -}; pub use sp_runtime::traits::SignedExtension; pub use sp_version::RuntimeVersion; use std::{ @@ -269,41 +266,6 @@ impl Client { let extrinsic = self.create_signed(call, signer).await?; self.submit_extrinsic(extrinsic).await } - - /// Insert a key into the keystore. - pub async fn insert_key( - &self, - key_type: String, - suri: String, - public: Bytes, - ) -> Result<(), Error> { - self.rpc.insert_key(key_type, suri, public).await - } - - /// Generate new session keys and returns the corresponding public keys. - pub async fn rotate_keys(&self) -> Result { - self.rpc.rotate_keys().await - } - - /// Checks if the keystore has private keys for the given session public keys. - /// - /// `session_keys` is the SCALE encoded session keys object from the runtime. - /// - /// Returns `true` iff all private keys could be found. - pub async fn has_session_keys(&self, session_keys: Bytes) -> Result { - self.rpc.has_session_keys(session_keys).await - } - - /// Checks if the keystore has private keys for the given public key and key type. - /// - /// Returns `true` if a private key could be found. - pub async fn has_key( - &self, - public_key: Bytes, - key_type: String, - ) -> Result { - self.rpc.has_key(public_key, key_type).await - } } /// A constructed call ready to be signed and submitted. diff --git a/tests/src/client.rs b/tests/src/client.rs index b6b383dfd7..a3b8a33656 100644 --- a/tests/src/client.rs +++ b/tests/src/client.rs @@ -32,6 +32,7 @@ async fn insert_key() { 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(), @@ -40,6 +41,7 @@ async fn insert_key() { .await .unwrap(); assert!(client + .rpc() .has_key(public.clone().into(), "aura".to_string()) .await .unwrap()); From d984dd5fbda517160a661350cbeea530703a6e8d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 6 Oct 2021 16:58:37 +0100 Subject: [PATCH 127/216] Remove submit tx pass through rpc methods --- src/client.rs | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/client.rs b/src/client.rs index 95644068a7..fb773afc30 100644 --- a/src/client.rs +++ b/src/client.rs @@ -235,24 +235,6 @@ impl Client { &self.events_decoder } - /// Create and submit an extrinsic and return corresponding Hash if successful - pub async fn submit_extrinsic( - &self, - extrinsic: UncheckedExtrinsic, - ) -> Result { - self.rpc.submit_extrinsic(extrinsic).await - } - - /// Create and submit an extrinsic and return corresponding Event if successful - pub async fn submit_and_watch_extrinsic( - &self, - extrinsic: UncheckedExtrinsic, - ) -> Result, Error> { - self.rpc - .submit_and_watch_extrinsic(extrinsic, &self.events_decoder) - .await - } - /// Submits a transaction to the chain. pub async fn submit( &self, @@ -264,7 +246,7 @@ impl Client { Send + Sync, { let extrinsic = self.create_signed(call, signer).await?; - self.submit_extrinsic(extrinsic).await + self.rpc().submit_extrinsic(extrinsic).await } } @@ -295,7 +277,7 @@ where Send + Sync, { let extrinsic = self.client.create_signed(self.call, signer).await?; - self.client.submit_and_watch_extrinsic(extrinsic).await + self.client.rpc().submit_and_watch_extrinsic(extrinsic, self.client.events_decoder()).await } /// Submits a transaction to the chain. @@ -308,6 +290,6 @@ where Send + Sync, { let extrinsic = self.client.create_signed(self.call, signer).await?; - self.client.submit_extrinsic(extrinsic).await + self.client.rpc().submit_extrinsic(extrinsic).await } } From a9d1e8ffd84028bf06625c0c05d306f3f3f7c4b5 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 7 Oct 2021 11:13:24 +0100 Subject: [PATCH 128/216] Add some comments to SubmittableExtrinsic methods --- src/client.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/client.rs b/src/client.rs index fb773afc30..7539719e89 100644 --- a/src/client.rs +++ b/src/client.rs @@ -266,8 +266,10 @@ where Self { client, call } } - /// Create and submit an extrinsic and return corresponding Event if successful - /// todo: [AJ] could do a type builder interface like `xt.sign(&signer).watch_events().submit()` + /// Creates and signs an extrinsic and submits to the chain. + /// + /// Returns when the extrinsic has successfully been included in the block, together with any + /// events which were triggered by the extrinsic. pub async fn sign_and_submit_then_watch( self, signer: &(dyn Signer + Send + Sync), @@ -280,7 +282,14 @@ where self.client.rpc().submit_and_watch_extrinsic(extrinsic, self.client.events_decoder()).await } - /// Submits a transaction to the chain. + /// Creates and signs an extrinsic and submits to the chain for block inclusion. + /// + /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. + /// + /// # Note + /// + /// Success does not mean the extrinsic has been included in the block, just that it is valid + /// and has been included in the transaction pool. pub async fn sign_and_submit( self, signer: &(dyn Signer + Send + Sync), From ccb1491792e4f563e48352a86d775ed29f89771b Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 7 Oct 2021 12:27:05 +0100 Subject: [PATCH 129/216] Construct the runtime api from the client --- proc-macro/src/generate_runtime.rs | 10 ++++++---- src/client.rs | 8 ++++++++ tests/src/frame/balances.rs | 4 ++-- tests/src/frame/contracts.rs | 2 +- tests/src/utils/context.rs | 11 +++++++---- 5 files changed, 24 insertions(+), 11 deletions(-) diff --git a/proc-macro/src/generate_runtime.rs b/proc-macro/src/generate_runtime.rs index 9c31040a19..a7b70ae561 100644 --- a/proc-macro/src/generate_runtime.rs +++ b/proc-macro/src/generate_runtime.rs @@ -249,16 +249,18 @@ impl RuntimeGenerator { pub client: ::subxt::Client, } - impl RuntimeApi { - pub fn new(client: ::subxt::Client) -> Self { + impl ::core::convert::From<::subxt::Client> for RuntimeApi { + fn from(client: ::subxt::Client) -> Self { Self { client } } + } - pub fn storage<'a>(&'a self) -> StorageApi<'a, T> { + impl<'a, T: ::subxt::Runtime> RuntimeApi { + pub fn storage(&'a self) -> StorageApi<'a, T> { StorageApi { client: &self.client } } - pub fn tx<'a>(&'a self) -> TransactionApi<'a, T> { + pub fn tx(&'a self) -> TransactionApi<'a, T> { TransactionApi { client: &self.client } } } diff --git a/src/client.rs b/src/client.rs index 7539719e89..75874e2f2c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -189,6 +189,14 @@ impl Client { StorageClient::new(&self.rpc, &self.metadata, self.iter_page_size) } + /// Convert the client to a runtime api wrapper for custom runtime access. + /// + /// The `subxt` proc macro will provide methods to submit extrinsics and read storage specific + /// to the target runtime. + pub fn to_runtime_api>(self) -> R { + self.into() + } + /// Creates a signed extrinsic. pub async fn create_signed( &self, diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index d41ab7025b..a14a12e1df 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -198,8 +198,8 @@ async fn transfer_subscription() { let bob = AccountKeyring::Bob.to_account_id(); let bob_addr = bob.clone().into(); let cxt = test_context().await; - let sub = cxt.client.rpc().subscribe_events().await.unwrap(); - let decoder = cxt.client.events_decoder(); + let sub = cxt.client().rpc().subscribe_events().await.unwrap(); + let decoder = cxt.client().events_decoder(); let mut sub = EventSubscription::::new(sub, &decoder); sub.filter_event::(); diff --git a/tests/src/frame/contracts.rs b/tests/src/frame/contracts.rs index cada2ff579..10a9186209 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/src/frame/contracts.rs @@ -57,7 +57,7 @@ impl ContractsTestContext { } fn client(&self) -> &Client { - &self.cxt.client + &self.cxt.client() } fn contracts_tx(&self) -> TransactionApi { diff --git a/tests/src/utils/context.rs b/tests/src/utils/context.rs index bfde0ff6a2..6e413baddf 100644 --- a/tests/src/utils/context.rs +++ b/tests/src/utils/context.rs @@ -50,17 +50,20 @@ pub async fn test_node_process() -> TestNodeProcess { pub struct TestContext { pub node_proc: TestNodeProcess, pub api: node_runtime::RuntimeApi, - pub client: Client, +} + +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 client = node_proc.client().clone(); - let api = node_runtime::RuntimeApi::::new(client.clone()); + let api = node_proc.client().clone().to_runtime_api(); TestContext { node_proc, api, - client, } } From ffc1a3c79006004d599313b427300665e07e4c30 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 7 Oct 2021 12:27:38 +0100 Subject: [PATCH 130/216] Fmt --- src/client.rs | 5 ++++- tests/src/utils/context.rs | 5 +---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client.rs b/src/client.rs index 75874e2f2c..1a5efec656 100644 --- a/src/client.rs +++ b/src/client.rs @@ -287,7 +287,10 @@ where Send + Sync, { let extrinsic = self.client.create_signed(self.call, signer).await?; - self.client.rpc().submit_and_watch_extrinsic(extrinsic, self.client.events_decoder()).await + self.client + .rpc() + .submit_and_watch_extrinsic(extrinsic, self.client.events_decoder()) + .await } /// Creates and signs an extrinsic and submits to the chain for block inclusion. diff --git a/tests/src/utils/context.rs b/tests/src/utils/context.rs index 6e413baddf..bba2225f87 100644 --- a/tests/src/utils/context.rs +++ b/tests/src/utils/context.rs @@ -62,8 +62,5 @@ 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, - } + TestContext { node_proc, api } } From f46c94438800f7719e8f7a06d8f4ec776df898c9 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 8 Oct 2021 10:04:24 +0100 Subject: [PATCH 131/216] Use From trait instead of new for AccountData query --- src/client.rs | 2 +- src/lib.rs | 5 +---- tests/src/runtime.rs | 8 +++++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/client.rs b/src/client.rs index 1a5efec656..e0d692d086 100644 --- a/src/client.rs +++ b/src/client.rs @@ -211,7 +211,7 @@ impl Client { nonce } else { let account_storage_entry = - >::new(signer.account_id().clone()); + >::from(signer.account_id().clone()); let account_data = self .storage() .fetch_or_default(&account_storage_entry, None) diff --git a/src/lib.rs b/src/lib.rs index 6553fa4222..00b9e4a80a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -180,10 +180,7 @@ pub trait Runtime: Clone + Sized + Send + Sync + 'static { } /// Trait to fetch data about an account. -pub trait AccountData: StorageEntry { - /// Construct a storage entry type with the account id for the key. - fn new(account_id: T::AccountId) -> Self; - +pub trait AccountData: StorageEntry + From { /// Get the nonce from the storage entry value. fn nonce(result: &::Value) -> T::Index; } diff --git a/tests/src/runtime.rs b/tests/src/runtime.rs index 3b07a131be..4459caac23 100644 --- a/tests/src/runtime.rs +++ b/tests/src/runtime.rs @@ -53,11 +53,13 @@ impl Runtime for TestRuntime { type AccountData = node_runtime::system::storage::Account; } -impl subxt::AccountData for node_runtime::system::storage::Account { - fn new(account_id: ::AccountId) -> Self { - Self(account_id) +impl From for node_runtime::system::storage::Account { + fn from(account: node_runtime::system::storage::Account) -> Self { + Self(account) } +} +impl subxt::AccountData for node_runtime::system::storage::Account { fn nonce(result: &::Value) -> ::Index { result.nonce } From f83403535ed0fc8860c66af9573ef62cd2911285 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 11:04:32 +0100 Subject: [PATCH 132/216] Rename subxt_proc_macro crate to subxt_macro --- Cargo.toml | 4 ++-- {proc-macro => macro}/Cargo.toml | 2 +- {proc-macro => macro}/src/generate_runtime.rs | 0 {proc-macro => macro}/src/generate_types.rs | 0 {proc-macro => macro}/src/lib.rs | 0 src/lib.rs | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) rename {proc-macro => macro}/Cargo.toml (97%) rename {proc-macro => macro}/src/generate_runtime.rs (100%) rename {proc-macro => macro}/src/generate_types.rs (100%) rename {proc-macro => macro}/src/lib.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 6a1853a23b..a619ba49c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "proc-macro", "tests"] +members = [".", "macro", "tests"] [package] name = "substrate-subxt" @@ -40,7 +40,7 @@ serde_json = "1.0.64" thiserror = "1.0.24" url = "2.2.1" -subxt-proc-macro = { version = "0.1.0", path = "proc-macro" } +subxt-macro = { version = "0.1.0", path = "macro" } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } diff --git a/proc-macro/Cargo.toml b/macro/Cargo.toml similarity index 97% rename from proc-macro/Cargo.toml rename to macro/Cargo.toml index f146b3f098..3d7a1befa3 100644 --- a/proc-macro/Cargo.toml +++ b/macro/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "subxt-proc-macro" +name = "subxt-macro" version = "0.1.0" authors = ["Parity Technologies "] edition = "2018" diff --git a/proc-macro/src/generate_runtime.rs b/macro/src/generate_runtime.rs similarity index 100% rename from proc-macro/src/generate_runtime.rs rename to macro/src/generate_runtime.rs diff --git a/proc-macro/src/generate_types.rs b/macro/src/generate_types.rs similarity index 100% rename from proc-macro/src/generate_types.rs rename to macro/src/generate_types.rs diff --git a/proc-macro/src/lib.rs b/macro/src/lib.rs similarity index 100% rename from proc-macro/src/lib.rs rename to macro/src/lib.rs diff --git a/src/lib.rs b/src/lib.rs index 00b9e4a80a..fd3ff825f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,7 @@ pub use sp_core; pub use sp_runtime; -pub use subxt_proc_macro::subxt; +pub use subxt_macro::subxt; use codec::{ Codec, From fc80bb0cc30604dd375230aef21bc7165baa3318 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 11:10:54 +0100 Subject: [PATCH 133/216] Fix AccountData From impl --- src/client.rs | 2 +- tests/src/runtime.rs | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/client.rs b/src/client.rs index e0d692d086..88c4259fbc 100644 --- a/src/client.rs +++ b/src/client.rs @@ -211,7 +211,7 @@ impl Client { nonce } else { let account_storage_entry = - >::from(signer.account_id().clone()); + >::from(signer.account_id().clone()); let account_data = self .storage() .fetch_or_default(&account_storage_entry, None) diff --git a/tests/src/runtime.rs b/tests/src/runtime.rs index 4459caac23..899c43c1c6 100644 --- a/tests/src/runtime.rs +++ b/tests/src/runtime.rs @@ -53,9 +53,11 @@ impl Runtime for TestRuntime { type AccountData = node_runtime::system::storage::Account; } -impl From for node_runtime::system::storage::Account { - fn from(account: node_runtime::system::storage::Account) -> Self { - Self(account) +impl From<::AccountId> + for node_runtime::system::storage::Account +{ + fn from(account_id: ::AccountId) -> Self { + Self(account_id) } } From 72dc1f9d9e097947bf1b5c9db64c2d2800ea872b Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 12:46:42 +0100 Subject: [PATCH 134/216] Extract codegen crate from macro crate --- Cargo.toml | 2 +- codegen/Cargo.toml | 21 ++++++++++++++++++ .../generate_runtime.rs => codegen/src/api.rs | 4 ++-- codegen/src/lib.rs | 22 +++++++++++++++++++ .../generate_types.rs => codegen/src/types.rs | 0 macro/Cargo.toml | 3 ++- macro/src/lib.rs | 10 +-------- 7 files changed, 49 insertions(+), 13 deletions(-) create mode 100644 codegen/Cargo.toml rename macro/src/generate_runtime.rs => codegen/src/api.rs (99%) create mode 100644 codegen/src/lib.rs rename macro/src/generate_types.rs => codegen/src/types.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index a619ba49c7..1c0d059880 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "macro", "tests"] +members = [".", "codegen", "macro", "tests"] [package] name = "substrate-subxt" diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml new file mode 100644 index 0000000000..0e216f5eb7 --- /dev/null +++ b/codegen/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "subxt-codegen" +version = "0.1.0" +edition = "2018" + +[dependencies] +async-trait = "0.1.49" +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +darling = "0.13.0" +frame-metadata = "14.0" +heck = "0.3.2" +proc-macro2 = "1.0.24" +proc-macro-crate = "0.1.5" +proc-macro-error = "1.0.4" +quote = "1.0.8" +syn = "1.0.58" +scale-info = "1.0.0" + +[dev-dependencies] +codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } +pretty_assertions = "0.6.1" diff --git a/macro/src/generate_runtime.rs b/codegen/src/api.rs similarity index 99% rename from macro/src/generate_runtime.rs rename to codegen/src/api.rs index a7b70ae561..94640d8698 100644 --- a/macro/src/generate_runtime.rs +++ b/codegen/src/api.rs @@ -14,8 +14,7 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::{ - TokenStream2, +use crate::types::{ TypeGenerator, TypePath, }; @@ -41,6 +40,7 @@ use proc_macro_error::{ abort, abort_call_site, }; +use proc_macro2::TokenStream as TokenStream2; use quote::{ format_ident, quote, diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs new file mode 100644 index 0000000000..a0f47cc481 --- /dev/null +++ b/codegen/src/lib.rs @@ -0,0 +1,22 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +//! Library to generate an API for a Substrate runtime from its metadata. + +mod api; +mod types; + +pub use self::api::generate_runtime_types; \ No newline at end of file diff --git a/macro/src/generate_types.rs b/codegen/src/types.rs similarity index 100% rename from macro/src/generate_types.rs rename to codegen/src/types.rs diff --git a/macro/Cargo.toml b/macro/Cargo.toml index 3d7a1befa3..87b1522226 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -27,8 +27,9 @@ quote = "1.0.8" syn = "1.0.58" scale-info = "1.0.0" +subxt-codegen = { version = "0.1.0", path = "../codegen" } + [dev-dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } pretty_assertions = "0.6.1" substrate-subxt = { path = ".." } trybuild = "1.0.38" diff --git a/macro/src/lib.rs b/macro/src/lib.rs index d25da219ec..69fb742573 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -16,16 +16,8 @@ extern crate proc_macro; -mod generate_runtime; -mod generate_types; - use darling::FromMeta; -use generate_types::{ - TypeGenerator, - TypePath, -}; use proc_macro::TokenStream; -use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::proc_macro_error; use syn::parse_macro_input; @@ -49,5 +41,5 @@ pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { let root_path = std::path::Path::new(&root); let path = root_path.join(args.runtime_metadata_path); - generate_runtime::generate_runtime_types(item_mod, &path).into() + subxt_codegen::generate_runtime_types(item_mod, &path).into() } From 65639142c524df1784e4ad76b63a1f8e0dd741eb Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 12:51:02 +0100 Subject: [PATCH 135/216] Fmt --- codegen/src/api.rs | 2 +- codegen/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 94640d8698..831c34214c 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -36,11 +36,11 @@ use heck::{ CamelCase as _, SnakeCase as _, }; +use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::{ abort, abort_call_site, }; -use proc_macro2::TokenStream as TokenStream2; use quote::{ format_ident, quote, diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index a0f47cc481..d8a704b5b7 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -19,4 +19,4 @@ mod api; mod types; -pub use self::api::generate_runtime_types; \ No newline at end of file +pub use self::api::generate_runtime_types; From c66ac9f56a489bd3896bea64c3b4f51195b91b74 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 12:58:42 +0100 Subject: [PATCH 136/216] Replace chameleon hidden field name --- codegen/src/types.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 4170ceec4b..4f10dffd0d 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -407,7 +407,7 @@ impl<'a> ModuleType<'a> { if is_struct && !unused_params.is_empty() { let phantom = Self::phantom_data(&unused_params); fields_tokens.push(quote! { - pub __chameleon_unused_type_params: #phantom + pub __subxt_unused_type_params: #phantom }) } @@ -1206,7 +1206,7 @@ mod tests { #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct NamedFields<_0> { pub b: u32, - pub __chameleon_unused_type_params: ::core::marker::PhantomData<_0>, + pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, } #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct UnnamedFields<_0, _1> ( From 7594bc5fc0987ce380ea5aa1507fb36387e7a1c0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 13:10:35 +0100 Subject: [PATCH 137/216] Extract StructDef for generating structs --- codegen/src/api.rs | 113 ++------------------------------ codegen/src/lib.rs | 1 + codegen/src/struct_def.rs | 131 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 109 deletions(-) create mode 100644 codegen/src/struct_def.rs diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 831c34214c..74258a2949 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -14,9 +14,9 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::types::{ - TypeGenerator, - TypePath, +use crate::{ + struct_def::StructDef, + types::TypeGenerator, }; use codec::Decode; use darling::FromMeta; @@ -32,10 +32,7 @@ use frame_metadata::{ StorageEntryType, StorageHasher, }; -use heck::{ - CamelCase as _, - SnakeCase as _, -}; +use heck::SnakeCase as _; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::{ abort, @@ -586,106 +583,4 @@ impl RuntimeGenerator { } } -#[derive(Debug)] -pub struct StructDef { - name: syn::Ident, - fields: StructDefFields, -} - -#[derive(Debug)] -pub enum StructDefFields { - Named(Vec<(syn::Ident, TypePath)>), - Unnamed(Vec), -} - -impl StructDef { - pub fn from_variant( - variant: &scale_info::Variant, - type_gen: &TypeGenerator, - ) -> Self { - let name = format_ident!("{}", variant.name().to_camel_case()); - let variant_fields = variant - .fields() - .iter() - .map(|field| { - let name = field.name().map(|f| format_ident!("{}", f)); - let ty = type_gen.resolve_type_path(field.ty().id(), &[]); - (name, ty) - }) - .collect::>(); - - let named = variant_fields.iter().all(|(name, _)| name.is_some()); - let unnamed = variant_fields.iter().all(|(name, _)| name.is_none()); - let fields = if named { - StructDefFields::Named( - variant_fields - .iter() - .map(|(name, field)| { - let name = name.as_ref().unwrap_or_else(|| { - abort_call_site!("All fields should have a name") - }); - (name.clone(), field.clone()) - }) - .collect(), - ) - } else if unnamed { - StructDefFields::Unnamed( - variant_fields - .iter() - .map(|(_, field)| field.clone()) - .collect(), - ) - } else { - abort_call_site!( - "Variant '{}': Fields should either be all named or all unnamed.", - variant.name() - ) - }; - - Self { name, fields } - } - - fn named_fields(&self) -> Option<&[(syn::Ident, TypePath)]> { - if let StructDefFields::Named(ref fields) = self.fields { - Some(fields) - } else { - None - } - } -} - -impl quote::ToTokens for StructDef { - fn to_tokens(&self, tokens: &mut TokenStream2) { - tokens.extend(match self.fields { - StructDefFields::Named(ref named_fields) => { - let fields = named_fields.iter().map(|(name, ty)| { - let compact_attr = - ty.is_compact().then(|| quote!( #[codec(compact)] )); - quote! { #compact_attr pub #name: #ty } - }); - let name = &self.name; - quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] - pub struct #name { - #( #fields ),* - } - } - } - StructDefFields::Unnamed(ref unnamed_fields) => { - let fields = unnamed_fields.iter().map(|ty| { - let compact_attr = - ty.is_compact().then(|| quote!( #[codec(compact)] )); - quote! { #compact_attr pub #ty } - }); - let name = &self.name; - quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] - pub struct #name ( - #( #fields ),* - ); - } - } - }) - } -} diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index d8a704b5b7..32fec308c2 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -17,6 +17,7 @@ //! Library to generate an API for a Substrate runtime from its metadata. mod api; +mod struct_def; mod types; pub use self::api::generate_runtime_types; diff --git a/codegen/src/struct_def.rs b/codegen/src/struct_def.rs new file mode 100644 index 0000000000..6b2176de57 --- /dev/null +++ b/codegen/src/struct_def.rs @@ -0,0 +1,131 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use crate::{ + types::{TypePath, TypeGenerator}, +}; +use heck::CamelCase as _; +use proc_macro2::TokenStream as TokenStream2; +use proc_macro_error::abort_call_site; +use quote::{ + format_ident, + quote, +}; +use scale_info::form::PortableForm; + +#[derive(Debug)] +pub struct StructDef { + pub name: syn::Ident, + pub fields: StructDefFields, +} + +#[derive(Debug)] +pub enum StructDefFields { + Named(Vec<(syn::Ident, TypePath)>), + Unnamed(Vec), +} + +impl StructDef { + pub fn from_variant( + variant: &scale_info::Variant, + type_gen: &TypeGenerator, + ) -> Self { + let name = format_ident!("{}", variant.name().to_camel_case()); + let variant_fields = variant + .fields() + .iter() + .map(|field| { + let name = field.name().map(|f| format_ident!("{}", f)); + let ty = type_gen.resolve_type_path(field.ty().id(), &[]); + (name, ty) + }) + .collect::>(); + + let named = variant_fields.iter().all(|(name, _)| name.is_some()); + let unnamed = variant_fields.iter().all(|(name, _)| name.is_none()); + + let fields = if named { + StructDefFields::Named( + variant_fields + .iter() + .map(|(name, field)| { + let name = name.as_ref().unwrap_or_else(|| { + abort_call_site!("All fields should have a name") + }); + (name.clone(), field.clone()) + }) + .collect(), + ) + } else if unnamed { + StructDefFields::Unnamed( + variant_fields + .iter() + .map(|(_, field)| field.clone()) + .collect(), + ) + } else { + abort_call_site!( + "Variant '{}': Fields should either be all named or all unnamed.", + variant.name() + ) + }; + + Self { name, fields } + } + + pub fn named_fields(&self) -> Option<&[(syn::Ident, TypePath)]> { + if let StructDefFields::Named(ref fields) = self.fields { + Some(fields) + } else { + None + } + } +} + +impl quote::ToTokens for StructDef { + fn to_tokens(&self, tokens: &mut TokenStream2) { + tokens.extend(match self.fields { + StructDefFields::Named(ref named_fields) => { + let fields = named_fields.iter().map(|(name, ty)| { + let compact_attr = + ty.is_compact().then(|| quote!( #[codec(compact)] )); + quote! { #compact_attr pub #name: #ty } + }); + let name = &self.name; + quote! { + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + pub struct #name { + #( #fields ),* + } + } + } + StructDefFields::Unnamed(ref unnamed_fields) => { + let fields = unnamed_fields.iter().map(|ty| { + let compact_attr = + ty.is_compact().then(|| quote!( #[codec(compact)] )); + quote! { #compact_attr pub #ty } + }); + let name = &self.name; + quote! { + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + pub struct #name ( + #( #fields ),* + ); + } + } + }) + } +} \ No newline at end of file From d0b0bb19e265fd94367d324f52c39015a519e172 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 13:34:40 +0100 Subject: [PATCH 138/216] More refactoring of StructDef, moving towards sharing with typegen --- codegen/src/api.rs | 11 +++++++--- codegen/src/struct_def.rs | 45 ++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 74258a2949..3e66ea282d 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -427,7 +427,14 @@ impl RuntimeGenerator { variant .variants() .iter() - .map(|var| StructDef::from_variant(var, type_gen)) + .map(|var| { + StructDef::new( + var.name(), + var.fields(), + Some(syn::parse_quote!(pub)), + type_gen, + ) + }) .collect() } else { abort_call_site!( @@ -582,5 +589,3 @@ impl RuntimeGenerator { (storage_entry_type, client_fn) } } - - diff --git a/codegen/src/struct_def.rs b/codegen/src/struct_def.rs index 6b2176de57..5e90cc7c46 100644 --- a/codegen/src/struct_def.rs +++ b/codegen/src/struct_def.rs @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with substrate-subxt. If not, see . -use crate::{ - types::{TypePath, TypeGenerator}, +use crate::types::{ + TypeGenerator, + TypePath, }; use heck::CamelCase as _; use proc_macro2::TokenStream as TokenStream2; @@ -30,6 +31,7 @@ use scale_info::form::PortableForm; pub struct StructDef { pub name: syn::Ident, pub fields: StructDefFields, + pub field_visibility: Option, } #[derive(Debug)] @@ -39,13 +41,14 @@ pub enum StructDefFields { } impl StructDef { - pub fn from_variant( - variant: &scale_info::Variant, + pub fn new( + ident: &str, + fields: &[scale_info::Field], + field_visibility: Option, type_gen: &TypeGenerator, ) -> Self { - let name = format_ident!("{}", variant.name().to_camel_case()); - let variant_fields = variant - .fields() + let name = format_ident!("{}", ident.to_camel_case()); + let fields = fields .iter() .map(|field| { let name = field.name().map(|f| format_ident!("{}", f)); @@ -54,12 +57,12 @@ impl StructDef { }) .collect::>(); - let named = variant_fields.iter().all(|(name, _)| name.is_some()); - let unnamed = variant_fields.iter().all(|(name, _)| name.is_none()); + let named = fields.iter().all(|(name, _)| name.is_some()); + let unnamed = fields.iter().all(|(name, _)| name.is_none()); let fields = if named { StructDefFields::Named( - variant_fields + fields .iter() .map(|(name, field)| { let name = name.as_ref().unwrap_or_else(|| { @@ -71,19 +74,20 @@ impl StructDef { ) } else if unnamed { StructDefFields::Unnamed( - variant_fields - .iter() - .map(|(_, field)| field.clone()) - .collect(), + fields.iter().map(|(_, field)| field.clone()).collect(), ) } else { abort_call_site!( - "Variant '{}': Fields should either be all named or all unnamed.", - variant.name() + "Struct '{}': Fields should either be all named or all unnamed.", + name, ) }; - Self { name, fields } + Self { + name, + fields, + field_visibility, + } } pub fn named_fields(&self) -> Option<&[(syn::Ident, TypePath)]> { @@ -97,12 +101,13 @@ impl StructDef { impl quote::ToTokens for StructDef { fn to_tokens(&self, tokens: &mut TokenStream2) { + let visibility = &self.field_visibility; tokens.extend(match self.fields { StructDefFields::Named(ref named_fields) => { let fields = named_fields.iter().map(|(name, ty)| { let compact_attr = ty.is_compact().then(|| quote!( #[codec(compact)] )); - quote! { #compact_attr pub #name: #ty } + quote! { #compact_attr #visibility #name: #ty } }); let name = &self.name; quote! { @@ -116,7 +121,7 @@ impl quote::ToTokens for StructDef { let fields = unnamed_fields.iter().map(|ty| { let compact_attr = ty.is_compact().then(|| quote!( #[codec(compact)] )); - quote! { #compact_attr pub #ty } + quote! { #compact_attr #visibility #ty } }); let name = &self.name; quote! { @@ -128,4 +133,4 @@ impl quote::ToTokens for StructDef { } }) } -} \ No newline at end of file +} From 2c2dd9f44544a0883c8a98036a3d261f65729a6e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 12 Oct 2021 17:00:47 +0100 Subject: [PATCH 139/216] Replace explicit tests crate with single implicit integration tests crate --- Cargo.toml | 16 +++++++++++-- tests/Cargo.toml | 23 ------------------- tests/{src => integration}/client.rs | 0 tests/{src => integration}/frame/balances.rs | 2 +- tests/{src => integration}/frame/contracts.rs | 2 +- tests/{src => integration}/frame/mod.rs | 0 tests/{src => integration}/frame/staking.rs | 2 +- tests/{src => integration}/frame/sudo.rs | 2 +- tests/{src => integration}/frame/system.rs | 2 +- tests/{src/lib.rs => integration/main.rs} | 0 tests/{src => integration}/runtime.rs | 2 +- tests/{src => integration}/utils/context.rs | 2 +- tests/{src => integration}/utils/mod.rs | 0 tests/{src => integration}/utils/node_proc.rs | 2 +- 14 files changed, 22 insertions(+), 33 deletions(-) delete mode 100644 tests/Cargo.toml rename tests/{src => integration}/client.rs (100%) rename tests/{src => integration}/frame/balances.rs (99%) rename tests/{src => integration}/frame/contracts.rs (99%) rename tests/{src => integration}/frame/mod.rs (100%) rename tests/{src => integration}/frame/staking.rs (99%) rename tests/{src => integration}/frame/sudo.rs (98%) rename tests/{src => integration}/frame/system.rs (98%) rename tests/{src/lib.rs => integration/main.rs} (100%) rename tests/{src => integration}/runtime.rs (99%) rename tests/{src => integration}/utils/context.rs (98%) rename tests/{src => integration}/utils/mod.rs (100%) rename tests/{src => integration}/utils/node_proc.rs (99%) diff --git a/Cargo.toml b/Cargo.toml index 1c0d059880..cd86c63ad5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "codegen", "macro", "tests"] +members = [".", "codegen", "macro"] [package] name = "substrate-subxt" @@ -46,4 +46,16 @@ sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/ sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "master" } -frame-metadata = "14.0.0" \ No newline at end of file +frame-metadata = "14.0.0" + +[dev-dependencies] +assert_matches = "1.5.0" +async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } +env_logger = "0.8.3" +tempdir = "0.3.7" +wabt = "0.10.0" +which = "4.0.2" + +sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "master" } +sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "master" } + diff --git a/tests/Cargo.toml b/tests/Cargo.toml deleted file mode 100644 index 78b27a6d85..0000000000 --- a/tests/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -name = "subxt-tests" -version = "0.1.0" -edition = "2018" - -[dependencies] -subxt = { package = "substrate-subxt", path = ".." } - -codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } - -sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "master" } -sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } -sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "master" } -sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } - -assert_matches = "1.5.0" -async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } -env_logger = "0.8.3" -hex = "0.4.3" -log = "0.4.14" -tempdir = "0.3.7" -wabt = "0.10.0" -which = "4.0.2" diff --git a/tests/src/client.rs b/tests/integration/client.rs similarity index 100% rename from tests/src/client.rs rename to tests/integration/client.rs diff --git a/tests/src/frame/balances.rs b/tests/integration/frame/balances.rs similarity index 99% rename from tests/src/frame/balances.rs rename to tests/integration/frame/balances.rs index a14a12e1df..e66851d57c 100644 --- a/tests/src/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -29,7 +29,7 @@ use sp_core::{ Pair as _, }; use sp_keyring::AccountKeyring; -use subxt::{ +use substrate_subxt::{ extrinsic::{ PairSigner, Signer, diff --git a/tests/src/frame/contracts.rs b/tests/integration/frame/contracts.rs similarity index 99% rename from tests/src/frame/contracts.rs rename to tests/integration/frame/contracts.rs index 10a9186209..8b040101a7 100644 --- a/tests/src/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -31,7 +31,7 @@ use crate::{ }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; -use subxt::{ +use substrate_subxt::{ Client, Error, ExtrinsicSuccess, diff --git a/tests/src/frame/mod.rs b/tests/integration/frame/mod.rs similarity index 100% rename from tests/src/frame/mod.rs rename to tests/integration/frame/mod.rs diff --git a/tests/src/frame/staking.rs b/tests/integration/frame/staking.rs similarity index 99% rename from tests/src/frame/staking.rs rename to tests/integration/frame/staking.rs index fc1f9e0794..5640ac69c6 100644 --- a/tests/src/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -31,7 +31,7 @@ use sp_core::{ Pair, }; use sp_keyring::AccountKeyring; -use subxt::{ +use substrate_subxt::{ extrinsic::{ PairSigner, Signer, diff --git a/tests/src/frame/sudo.rs b/tests/integration/frame/sudo.rs similarity index 98% rename from tests/src/frame/sudo.rs rename to tests/integration/frame/sudo.rs index 8833204b08..4b5128b047 100644 --- a/tests/src/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -24,7 +24,7 @@ use crate::{ }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::PairSigner; +use substrate_subxt::extrinsic::PairSigner; // todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call type Call = runtime_types::node_runtime::Call; diff --git a/tests/src/frame/system.rs b/tests/integration/frame/system.rs similarity index 98% rename from tests/src/frame/system.rs rename to tests/integration/frame/system.rs index 71196c6d9f..d477d532d8 100644 --- a/tests/src/frame/system.rs +++ b/tests/integration/frame/system.rs @@ -21,7 +21,7 @@ use crate::{ }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::{ +use substrate_subxt::extrinsic::{ PairSigner, Signer, }; diff --git a/tests/src/lib.rs b/tests/integration/main.rs similarity index 100% rename from tests/src/lib.rs rename to tests/integration/main.rs diff --git a/tests/src/runtime.rs b/tests/integration/runtime.rs similarity index 99% rename from tests/src/runtime.rs rename to tests/integration/runtime.rs index 899c43c1c6..f5d397c61f 100644 --- a/tests/src/runtime.rs +++ b/tests/integration/runtime.rs @@ -15,7 +15,7 @@ // along with substrate-subxt. If not, see . use sp_runtime::traits::BlakeTwo256; -use subxt::{ +use substrate_subxt::{ subxt, Runtime, StorageEntry, diff --git a/tests/src/utils/context.rs b/tests/integration/utils/context.rs similarity index 98% rename from tests/src/utils/context.rs rename to tests/integration/utils/context.rs index bba2225f87..b31645b8ba 100644 --- a/tests/src/utils/context.rs +++ b/tests/integration/utils/context.rs @@ -21,7 +21,7 @@ pub use crate::{ }; use sp_keyring::AccountKeyring; -use subxt::Client; +use substrate_subxt::Client; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; diff --git a/tests/src/utils/mod.rs b/tests/integration/utils/mod.rs similarity index 100% rename from tests/src/utils/mod.rs rename to tests/integration/utils/mod.rs diff --git a/tests/src/utils/node_proc.rs b/tests/integration/utils/node_proc.rs similarity index 99% rename from tests/src/utils/node_proc.rs rename to tests/integration/utils/node_proc.rs index 7209366ca6..f9209e1236 100644 --- a/tests/src/utils/node_proc.rs +++ b/tests/integration/utils/node_proc.rs @@ -29,7 +29,7 @@ use std::{ thread, time, }; -use subxt::{ +use substrate_subxt::{ Client, ClientBuilder, Runtime, From 7d9884d99a6da626467985ad9d6179eba56c7310 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 13 Oct 2021 10:37:44 +0100 Subject: [PATCH 140/216] Rename from substrate-subxt to subxt --- CHANGELOG.md | 134 +++++++++++++-------------- Cargo.toml | 6 +- FILE_TEMPLATE | 4 +- README.md | 2 +- codegen/src/api.rs | 4 +- codegen/src/lib.rs | 4 +- codegen/src/struct_def.rs | 4 +- codegen/src/types.rs | 4 +- examples/fetch_all_accounts.rs | 6 +- examples/fetch_remote.rs | 6 +- examples/kusama_balance_transfer.rs | 6 +- examples/submit_and_watch.rs | 6 +- examples/transfer_subscribe.rs | 6 +- macro/Cargo.toml | 6 +- macro/src/lib.rs | 4 +- src/client.rs | 4 +- src/error.rs | 4 +- src/events.rs | 4 +- src/extrinsic/extra.rs | 4 +- src/extrinsic/mod.rs | 4 +- src/extrinsic/signer.rs | 4 +- src/lib.rs | 4 +- src/metadata.rs | 4 +- src/rpc.rs | 6 +- src/storage.rs | 4 +- src/subscription.rs | 4 +- tests/integration/client.rs | 4 +- tests/integration/frame/balances.rs | 6 +- tests/integration/frame/contracts.rs | 6 +- tests/integration/frame/mod.rs | 4 +- tests/integration/frame/staking.rs | 6 +- tests/integration/frame/sudo.rs | 6 +- tests/integration/frame/system.rs | 6 +- tests/integration/main.rs | 4 +- tests/integration/node_runtime.scale | Bin 0 -> 301517 bytes tests/integration/runtime.rs | 6 +- tests/integration/utils/context.rs | 8 +- tests/integration/utils/mod.rs | 4 +- tests/integration/utils/node_proc.rs | 6 +- 39 files changed, 157 insertions(+), 157 deletions(-) create mode 100644 tests/integration/node_runtime.scale diff --git a/CHANGELOG.md b/CHANGELOG.md index b8576b592f..4c275c8648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,105 +9,105 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.15.0] - 2021-03-15 ### Added -- implement variant of subscription that returns finalized storage changes - [#237](https://github.com/paritytech/substrate-subxt/pull/237) -- implement session handling for unsubscribe in subxt-client - [#242](https://github.com/paritytech/substrate-subxt/pull/242) +- implement variant of subscription that returns finalized storage changes - [#237](https://github.com/paritytech/subxt/pull/237) +- implement session handling for unsubscribe in subxt-client - [#242](https://github.com/paritytech/subxt/pull/242) ### Changed -- update jsonrpsee [#251](https://github.com/paritytech/substrate-subxt/pull/251) -- return none if subscription returns early [#250](https://github.com/paritytech/substrate-subxt/pull/250) -- export ModuleError and RuntimeError for downstream usage - [#246](https://github.com/paritytech/substrate-subxt/pull/246) -- rpc client methods should be public for downstream usage - [#240](https://github.com/paritytech/substrate-subxt/pull/240) -- re-export WasmExecutionMethod for downstream usage - [#239](https://github.com/paritytech/substrate-subxt/pull/239) -- integration with jsonrpsee v2 - [#214](https://github.com/paritytech/substrate-subxt/pull/214) -- expose wasm execution method on subxt client config - [#230](https://github.com/paritytech/substrate-subxt/pull/230) -- Add hooks to register event types for decoding - [#227](https://github.com/paritytech/substrate-subxt/pull/227) -- Substrate 3.0 - [#232](https://github.com/paritytech/substrate-subxt/pull/232) +- update jsonrpsee [#251](https://github.com/paritytech/subxt/pull/251) +- return none if subscription returns early [#250](https://github.com/paritytech/subxt/pull/250) +- export ModuleError and RuntimeError for downstream usage - [#246](https://github.com/paritytech/subxt/pull/246) +- rpc client methods should be public for downstream usage - [#240](https://github.com/paritytech/subxt/pull/240) +- re-export WasmExecutionMethod for downstream usage - [#239](https://github.com/paritytech/subxt/pull/239) +- integration with jsonrpsee v2 - [#214](https://github.com/paritytech/subxt/pull/214) +- expose wasm execution method on subxt client config - [#230](https://github.com/paritytech/subxt/pull/230) +- Add hooks to register event types for decoding - [#227](https://github.com/paritytech/subxt/pull/227) +- Substrate 3.0 - [#232](https://github.com/paritytech/subxt/pull/232) ## [0.14.0] - 2021-02-05 -- Refactor event type decoding and declaration [#221](https://github.com/paritytech/substrate-subxt/pull/221) -- Add Balances Locks [#197](https://github.com/paritytech/substrate-subxt/pull/197) -- Add event Phase::Initialization [#215](https://github.com/paritytech/substrate-subxt/pull/215) -- Make type explicit [#217](https://github.com/paritytech/substrate-subxt/pull/217) -- Upgrade dependencies, bumps substrate to 2.0.1 [#219](https://github.com/paritytech/substrate-subxt/pull/219) -- Export extra types [#212](https://github.com/paritytech/substrate-subxt/pull/212) -- Enable retrieval of constants from rutnime metadata [#207](https://github.com/paritytech/substrate-subxt/pull/207) -- register type sizes for u64 and u128 [#200](https://github.com/paritytech/substrate-subxt/pull/200) -- Remove some substrate dependencies to improve compile time [#194](https://github.com/paritytech/substrate-subxt/pull/194) -- propagate 'RuntimeError's to 'decode_raw_bytes' caller [#189](https://github.com/paritytech/substrate-subxt/pull/189) -- Derive `Clone` for `PairSigner` [#184](https://github.com/paritytech/substrate-subxt/pull/184) +- Refactor event type decoding and declaration [#221](https://github.com/paritytech/subxt/pull/221) +- Add Balances Locks [#197](https://github.com/paritytech/subxt/pull/197) +- Add event Phase::Initialization [#215](https://github.com/paritytech/subxt/pull/215) +- Make type explicit [#217](https://github.com/paritytech/subxt/pull/217) +- Upgrade dependencies, bumps substrate to 2.0.1 [#219](https://github.com/paritytech/subxt/pull/219) +- Export extra types [#212](https://github.com/paritytech/subxt/pull/212) +- Enable retrieval of constants from rutnime metadata [#207](https://github.com/paritytech/subxt/pull/207) +- register type sizes for u64 and u128 [#200](https://github.com/paritytech/subxt/pull/200) +- Remove some substrate dependencies to improve compile time [#194](https://github.com/paritytech/subxt/pull/194) +- propagate 'RuntimeError's to 'decode_raw_bytes' caller [#189](https://github.com/paritytech/subxt/pull/189) +- Derive `Clone` for `PairSigner` [#184](https://github.com/paritytech/subxt/pull/184) ## [0.13.0] -- Make the contract call extrinsic work [#165](https://github.com/paritytech/substrate-subxt/pull/165) -- Update to Substrate 2.0.0 [#173](https://github.com/paritytech/substrate-subxt/pull/173) -- Display RawEvent data in hex [#168](https://github.com/paritytech/substrate-subxt/pull/168) -- Add SudoUncheckedWeightCall [#167](https://github.com/paritytech/substrate-subxt/pull/167) -- Add Add SetCodeWithoutChecksCall [#166](https://github.com/paritytech/substrate-subxt/pull/166) -- Improve contracts pallet tests [#163](https://github.com/paritytech/substrate-subxt/pull/163) -- Make Metadata types public [#162](https://github.com/paritytech/substrate-subxt/pull/162) -- Fix option decoding and add basic sanity test [#161](https://github.com/paritytech/substrate-subxt/pull/161) -- Add staking support [#160](https://github.com/paritytech/substrate-subxt/pull/161) -- Decode option event arg [#158](https://github.com/paritytech/substrate-subxt/pull/158) -- Remove unnecessary Sync bound [#172](https://github.com/paritytech/substrate-subxt/pull/172) +- Make the contract call extrinsic work [#165](https://github.com/paritytech/subxt/pull/165) +- Update to Substrate 2.0.0 [#173](https://github.com/paritytech/subxt/pull/173) +- Display RawEvent data in hex [#168](https://github.com/paritytech/subxt/pull/168) +- Add SudoUncheckedWeightCall [#167](https://github.com/paritytech/subxt/pull/167) +- Add Add SetCodeWithoutChecksCall [#166](https://github.com/paritytech/subxt/pull/166) +- Improve contracts pallet tests [#163](https://github.com/paritytech/subxt/pull/163) +- Make Metadata types public [#162](https://github.com/paritytech/subxt/pull/162) +- Fix option decoding and add basic sanity test [#161](https://github.com/paritytech/subxt/pull/161) +- Add staking support [#160](https://github.com/paritytech/subxt/pull/161) +- Decode option event arg [#158](https://github.com/paritytech/subxt/pull/158) +- Remove unnecessary Sync bound [#172](https://github.com/paritytech/subxt/pull/172) ## [0.12.0] -- Only return an error if the extrinsic failed. [#156](https://github.com/paritytech/substrate-subxt/pull/156) -- Update to rc6. [#155](https://github.com/paritytech/substrate-subxt/pull/155) -- Different assert. [#153](https://github.com/paritytech/substrate-subxt/pull/153) -- Add a method to fetch an unhashed key, close #100 [#152](https://github.com/paritytech/substrate-subxt/pull/152) -- Fix port number. [#151](https://github.com/paritytech/substrate-subxt/pull/151) -- Implement the `concat` in `twox_64_concat` [#150](https://github.com/paritytech/substrate-subxt/pull/150) -- Storage map iter [#148](https://github.com/paritytech/substrate-subxt/pull/148) +- Only return an error if the extrinsic failed. [#156](https://github.com/paritytech/subxt/pull/156) +- Update to rc6. [#155](https://github.com/paritytech/subxt/pull/155) +- Different assert. [#153](https://github.com/paritytech/subxt/pull/153) +- Add a method to fetch an unhashed key, close #100 [#152](https://github.com/paritytech/subxt/pull/152) +- Fix port number. [#151](https://github.com/paritytech/subxt/pull/151) +- Implement the `concat` in `twox_64_concat` [#150](https://github.com/paritytech/subxt/pull/150) +- Storage map iter [#148](https://github.com/paritytech/subxt/pull/148) ## [0.11.0] -- Fix build error, wabt 0.9.2 is yanked [#146](https://github.com/paritytech/substrate-subxt/pull/146) -- Rc5 [#143](https://github.com/paritytech/substrate-subxt/pull/143) -- Refactor: extract functions and types for creating extrinsics [#138](https://github.com/paritytech/substrate-subxt/pull/138) -- event subscription example [#140](https://github.com/paritytech/substrate-subxt/pull/140) -- Document the `Call` derive macro [#137](https://github.com/paritytech/substrate-subxt/pull/137) -- Document the #[module] macro [#135](https://github.com/paritytech/substrate-subxt/pull/135) -- Support authors api. [#134](https://github.com/paritytech/substrate-subxt/pull/134) +- Fix build error, wabt 0.9.2 is yanked [#146](https://github.com/paritytech/subxt/pull/146) +- Rc5 [#143](https://github.com/paritytech/subxt/pull/143) +- Refactor: extract functions and types for creating extrinsics [#138](https://github.com/paritytech/subxt/pull/138) +- event subscription example [#140](https://github.com/paritytech/subxt/pull/140) +- Document the `Call` derive macro [#137](https://github.com/paritytech/subxt/pull/137) +- Document the #[module] macro [#135](https://github.com/paritytech/subxt/pull/135) +- Support authors api. [#134](https://github.com/paritytech/subxt/pull/134) ## [0.10.1] - 2020-06-19 -- Release client v0.2.0 [#133](https://github.com/paritytech/substrate-subxt/pull/133) +- Release client v0.2.0 [#133](https://github.com/paritytech/subxt/pull/133) ## [0.10.0] - 2020-06-19 -- Upgrade to substrate rc4 release [#131](https://github.com/paritytech/substrate-subxt/pull/131) -- Support unsigned extrinsics. [#130](https://github.com/paritytech/substrate-subxt/pull/130) +- Upgrade to substrate rc4 release [#131](https://github.com/paritytech/subxt/pull/131) +- Support unsigned extrinsics. [#130](https://github.com/paritytech/subxt/pull/130) ## [0.9.0] - 2020-06-25 -- Events sub [#126](https://github.com/paritytech/substrate-subxt/pull/126) -- Improve error handling in proc-macros, handle DispatchError etc. [#123](https://github.com/paritytech/substrate-subxt/pull/123) -- Support embedded full/light node clients. [#91](https://github.com/paritytech/substrate-subxt/pull/91) -- Zero sized types [#121](https://github.com/paritytech/substrate-subxt/pull/121) -- Fix optional store items. [#120](https://github.com/paritytech/substrate-subxt/pull/120) -- Make signing fallable and asynchronous [#119](https://github.com/paritytech/substrate-subxt/pull/119) +- Events sub [#126](https://github.com/paritytech/subxt/pull/126) +- Improve error handling in proc-macros, handle DispatchError etc. [#123](https://github.com/paritytech/subxt/pull/123) +- Support embedded full/light node clients. [#91](https://github.com/paritytech/subxt/pull/91) +- Zero sized types [#121](https://github.com/paritytech/subxt/pull/121) +- Fix optional store items. [#120](https://github.com/paritytech/subxt/pull/120) +- Make signing fallable and asynchronous [#119](https://github.com/paritytech/subxt/pull/119) ## [0.8.0] - 2020-05-26 -- Update to Substrate release candidate [#116](https://github.com/paritytech/substrate-subxt/pull/116) -- Update to alpha.8 [#114](https://github.com/paritytech/substrate-subxt/pull/114) -- Refactors the api [#113](https://github.com/paritytech/substrate-subxt/pull/113) +- Update to Substrate release candidate [#116](https://github.com/paritytech/subxt/pull/116) +- Update to alpha.8 [#114](https://github.com/paritytech/subxt/pull/114) +- Refactors the api [#113](https://github.com/paritytech/subxt/pull/113) ## [0.7.0] - 2020-05-13 -- Split subxt [#102](https://github.com/paritytech/substrate-subxt/pull/102) -- Add support for RPC `state_getReadProof` [#106](https://github.com/paritytech/substrate-subxt/pull/106) -- Update to substrate alpha.7 release [#105](https://github.com/paritytech/substrate-subxt/pull/105) -- Double map and plain storage support, introduce macros [#93](https://github.com/paritytech/substrate-subxt/pull/93) -- Raw payload return SignedPayload struct [#92](https://github.com/paritytech/substrate-subxt/pull/92) +- Split subxt [#102](https://github.com/paritytech/subxt/pull/102) +- Add support for RPC `state_getReadProof` [#106](https://github.com/paritytech/subxt/pull/106) +- Update to substrate alpha.7 release [#105](https://github.com/paritytech/subxt/pull/105) +- Double map and plain storage support, introduce macros [#93](https://github.com/paritytech/subxt/pull/93) +- Raw payload return SignedPayload struct [#92](https://github.com/paritytech/subxt/pull/92) ## [0.6.0] - 2020-04-15 -- Raw extrinsic payloads in Client [#83](https://github.com/paritytech/substrate-subxt/pull/83) -- Custom extras [#89](https://github.com/paritytech/substrate-subxt/pull/89) -- Wrap and export BlockNumber [#87](https://github.com/paritytech/substrate-subxt/pull/87) +- Raw extrinsic payloads in Client [#83](https://github.com/paritytech/subxt/pull/83) +- Custom extras [#89](https://github.com/paritytech/subxt/pull/89) +- Wrap and export BlockNumber [#87](https://github.com/paritytech/subxt/pull/87) - All substrate dependencies upgraded to `alpha.6` ## [0.5.0] - 2020-03-25 diff --git a/Cargo.toml b/Cargo.toml index cd86c63ad5..00d5a8ebdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,15 +2,15 @@ members = [".", "codegen", "macro"] [package] -name = "substrate-subxt" +name = "subxt" version = "0.15.0" authors = ["Parity Technologies "] edition = "2018" license = "GPL-3.0" readme = "README.md" -repository = "https://github.com/paritytech/substrate-subxt" -documentation = "https://docs.rs/substrate-subxt" +repository = "https://github.com/paritytech/subxt" +documentation = "https://docs.rs/subxt" homepage = "https://www.parity.io/" description = "Submit extrinsics (transactions) to a substrate node via RPC" keywords = ["parity", "substrate", "blockchain"] diff --git a/FILE_TEMPLATE b/FILE_TEMPLATE index 5bec9f892d..36c00e99b5 100644 --- a/FILE_TEMPLATE +++ b/FILE_TEMPLATE @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,4 +12,4 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . diff --git a/README.md b/README.md index d44dff8efd..8bf7e46084 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# subxt · ![build](https://github.com/paritytech/substrate-subxt/workflows/Rust/badge.svg) [![Latest Version](https://img.shields.io/crates/v/substrate-subxt.svg)](https://crates.io/crates/substrate-subxt) [![Documentation](https://docs.rs/substrate-subxt/badge.svg)](https://docs.rs/substrate-subxt) +# subxt · ![build](https://github.com/paritytech/subxt/workflows/Rust/badge.svg) [![Latest Version](https://img.shields.io/crates/v/subxt.svg)](https://crates.io/crates/subxt) [![Documentation](https://docs.rs/subxt/badge.svg)](https://docs.rs/subxt) A library to **sub**mit e**xt**rinsics to a [substrate](https://github.com/paritytech/substrate) node via RPC. diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 3e66ea282d..3be626939f 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ struct_def::StructDef, diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 32fec308c2..a11f18ec9e 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! Library to generate an API for a Substrate runtime from its metadata. diff --git a/codegen/src/struct_def.rs b/codegen/src/struct_def.rs index 5e90cc7c46..b48927dcd9 100644 --- a/codegen/src/struct_def.rs +++ b/codegen/src/struct_def.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::types::{ TypeGenerator, diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 4f10dffd0d..846c5ee6be 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use proc_macro2::{ Ident, diff --git a/examples/fetch_all_accounts.rs b/examples/fetch_all_accounts.rs index dde0094a61..3f96eca9e5 100644 --- a/examples/fetch_all_accounts.rs +++ b/examples/fetch_all_accounts.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,9 +12,9 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . -use substrate_subxt::{ +use subxt::{ system::AccountStoreExt, ClientBuilder, DefaultNodeRuntime, diff --git a/examples/fetch_remote.rs b/examples/fetch_remote.rs index cda160ed3e..d78c2d4d4a 100644 --- a/examples/fetch_remote.rs +++ b/examples/fetch_remote.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,9 +12,9 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . -use substrate_subxt::{ +use subxt::{ ClientBuilder, KusamaRuntime, }; diff --git a/examples/kusama_balance_transfer.rs b/examples/kusama_balance_transfer.rs index aa9b8a6b1a..e66f6d115d 100644 --- a/examples/kusama_balance_transfer.rs +++ b/examples/kusama_balance_transfer.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,10 +12,10 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use sp_keyring::AccountKeyring; -use substrate_subxt::{ +use subxt::{ balances::*, ClientBuilder, KusamaRuntime, diff --git a/examples/submit_and_watch.rs b/examples/submit_and_watch.rs index a71d12e880..e84e6149df 100644 --- a/examples/submit_and_watch.rs +++ b/examples/submit_and_watch.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,10 +12,10 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use sp_keyring::AccountKeyring; -use substrate_subxt::{ +use subxt::{ balances::{ TransferCallExt, TransferEventExt, diff --git a/examples/transfer_subscribe.rs b/examples/transfer_subscribe.rs index 11487133ac..b0ddc599a0 100644 --- a/examples/transfer_subscribe.rs +++ b/examples/transfer_subscribe.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,10 +12,10 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use sp_keyring::AccountKeyring; -use substrate_subxt::{ +use subxt::{ balances::{ TransferCallExt, TransferEvent, diff --git a/macro/Cargo.toml b/macro/Cargo.toml index 87b1522226..5e4296a175 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -6,8 +6,8 @@ edition = "2018" autotests = false license = "GPL-3.0" -repository = "https://github.com/paritytech/substrate-subxt" -documentation = "https://docs.rs/substrate-subxt" +repository = "https://github.com/paritytech/subxt" +documentation = "https://docs.rs/subxt" homepage = "https://www.parity.io/" description = "Generate types and helpers for interacting with Substrate runtimes." @@ -31,7 +31,7 @@ subxt-codegen = { version = "0.1.0", path = "../codegen" } [dev-dependencies] pretty_assertions = "0.6.1" -substrate-subxt = { path = ".." } +subxt = { path = ".." } trybuild = "1.0.38" sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/" } diff --git a/macro/src/lib.rs b/macro/src/lib.rs index 69fb742573..cb354fb3b3 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . extern crate proc_macro; diff --git a/src/client.rs b/src/client.rs index 88c4259fbc..6c40a0e223 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use futures::future; use jsonrpsee_http_client::HttpClientBuilder; diff --git a/src/error.rs b/src/error.rs index c8bf22ff65..538592dcff 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ metadata::{ diff --git a/src/events.rs b/src/events.rs index ebea83709c..605d2a70ba 100644 --- a/src/events.rs +++ b/src/events.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use codec::{ Codec, diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index b4281cf388..08fc88ce3a 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use codec::{ Decode, diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index 592c549575..01e45d8fce 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! Create signed or unsigned extrinsics. diff --git a/src/extrinsic/signer.rs b/src/extrinsic/signer.rs index 9010341985..b6058a87c3 100644 --- a/src/extrinsic/signer.rs +++ b/src/extrinsic/signer.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! A library to **sub**mit e**xt**rinsics to a //! [substrate](https://github.com/paritytech/substrate) node via RPC. diff --git a/src/lib.rs b/src/lib.rs index fd3ff825f8..5a3709fd6c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! A library to **sub**mit e**xt**rinsics to a //! [substrate](https://github.com/paritytech/substrate) node via RPC. diff --git a/src/metadata.rs b/src/metadata.rs index 0ab94e8476..0638aac575 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use std::{ collections::HashMap, diff --git a/src/rpc.rs b/src/rpc.rs index 64d1c8e89a..59a7c4ff08 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,13 +12,13 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! RPC types and client for interacting with a substrate node. // jsonrpsee subscriptions are interminable. // Allows `while let status = subscription.next().await {}` -// Related: https://github.com/paritytech/substrate-subxt/issues/66 +// Related: https://github.com/paritytech/subxt/issues/66 #![allow(irrefutable_let_patterns)] use std::sync::Arc; diff --git a/src/storage.rs b/src/storage.rs index 2007d037bd..4a8d20cc9c 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! For querying runtime storage. diff --git a/src/subscription.rs b/src/subscription.rs index de525e81ac..ead9bc6b28 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use jsonrpsee_types::{ DeserializeOwned, diff --git a/tests/integration/client.rs b/tests/integration/client.rs index a3b8a33656..70b5382597 100644 --- a/tests/integration/client.rs +++ b/tests/integration/client.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ runtime::node_runtime::system, diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index e66851d57c..fe89a178c1 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ node_runtime::{ @@ -29,7 +29,7 @@ use sp_core::{ Pair as _, }; use sp_keyring::AccountKeyring; -use substrate_subxt::{ +use subxt::{ extrinsic::{ PairSigner, Signer, diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index 8b040101a7..35ad098b6c 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use sp_keyring::AccountKeyring; @@ -31,7 +31,7 @@ use crate::{ }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; -use substrate_subxt::{ +use subxt::{ Client, Error, ExtrinsicSuccess, diff --git a/tests/integration/frame/mod.rs b/tests/integration/frame/mod.rs index 5a092cf474..8d18e46748 100644 --- a/tests/integration/frame/mod.rs +++ b/tests/integration/frame/mod.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . //! Test interactions with some built-in FRAME pallets. diff --git a/tests/integration/frame/staking.rs b/tests/integration/frame/staking.rs index 5640ac69c6..c1f63ae706 100644 --- a/tests/integration/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ node_runtime::{ @@ -31,7 +31,7 @@ use sp_core::{ Pair, }; use sp_keyring::AccountKeyring; -use substrate_subxt::{ +use subxt::{ extrinsic::{ PairSigner, Signer, diff --git a/tests/integration/frame/sudo.rs b/tests/integration/frame/sudo.rs index 4b5128b047..4960e2aaa9 100644 --- a/tests/integration/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ node_runtime::{ @@ -24,7 +24,7 @@ use crate::{ }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use substrate_subxt::extrinsic::PairSigner; +use subxt::extrinsic::PairSigner; // todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call type Call = runtime_types::node_runtime::Call; diff --git a/tests/integration/frame/system.rs b/tests/integration/frame/system.rs index d477d532d8..a23b3f2ca9 100644 --- a/tests/integration/frame/system.rs +++ b/tests/integration/frame/system.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use crate::{ node_runtime::system, @@ -21,7 +21,7 @@ use crate::{ }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use substrate_subxt::extrinsic::{ +use subxt::extrinsic::{ PairSigner, Signer, }; diff --git a/tests/integration/main.rs b/tests/integration/main.rs index 8a859b315a..318e5cd040 100644 --- a/tests/integration/main.rs +++ b/tests/integration/main.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . mod runtime; mod utils; diff --git a/tests/integration/node_runtime.scale b/tests/integration/node_runtime.scale new file mode 100644 index 0000000000000000000000000000000000000000..80692153a8cb67479eeb2a05a7e42334dc3bea02 GIT binary patch literal 301517 zcmeFa4QOT8buYfRbY^_VkrTNczrXyR^4{^Q{Bo5iU2E)dA}g{P%}CDZWj^GQ#&(`( z(7n3%NV=V?dzJe!GYToV;6ef}xR8JgE~Jn`0x6`Bf(t3Qj}-hM1sC!l1s76CA%zrD zNFfCm{=eT^d!LVct~8SEnSRhj$w=qyvp?2edws99ccO0PqtgX5GTzx;ueRFJShc;k z+iguPRI9CCv%6e-;&EdF6WH*j-t1?>Cmz4fKh1Dxj49y1=Gd?qDa>rPD?8D8XRp(Z zcH(cFo2|mhf> zi`f4*AYR{z#@YW1zC(;Zuse}d8TmCm-E04j_&T3ekNyY_rko!6Jk*!Fq8 zf94ruX3*tnbNYZTi^*5MTRT2~ZoAUNfNSk~bfwkm24=#_m}bZnSK84Pon67q+QoCg zl?dq4S!!<8o6&O3n4%r$e0sCb7_2^SaERuC8C{JkjYG6NW)@SET&-_m69O}j`6N@< zr{+F$@^W`OY6t0w8B=qsSZdy^w_D8};P2I4>|RvkS(?Sc!r{WN^9Mk0z-Tr&b1Axo zMQ_%(dWs%_Ib&bGyh}_;LpIX}n`O+IU`(44-xh6Q^ir!C;rZxlYbOfKqA}K(#h5_M zRCTTEUF=giweU>OSc9Ec{8_IzyEr+O#;6_XftuLU?s+4+88vWv<*7Ljthrz=^pTRK zn}E=j2$ZQ-2$t*$rZ|BkadLON(uwx0J-NbPj6I3In%xx}EEzl2ZSB^po!_u_j2N+o zRjw3fnyp&oG5n--YwRmyt3t5?vu1bGBy4U@TFkrMBAmvrcI%CLcP}uzcFoa|o<4G| z0jF_LyE+IU1!NzNs_jY@;CkJ@>?T(84|Cmq#Eg^PSL--V-?s0$_SF`sH5Pm`>ib|S9MEF9 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89aw*n%W_2xVoOk11t*mC*ZSdnRxcXD zK{y0^G7hj}{0$&uFsM~9gSEvhjn{^T9_bfZT81!_uTZF&>yms2M-7KiuaK1$Mrt-$ zwY~~s4qffb<*DlVf(oDocMfvMS8A$)`lcn`D8*xx?VnEGz4l)PpqiXCze7@ zK)lA_@WB-|0FHnzpjKZ;?#PO5b@DIe=toy<%P!nN&qxAvLBKm}R2^HfZED5;1w#eY AbpQYW literal 0 HcmV?d00001 diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index f5d397c61f..d215a7830f 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,10 +12,10 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use sp_runtime::traits::BlakeTwo256; -use substrate_subxt::{ +use subxt::{ subxt, Runtime, StorageEntry, diff --git a/tests/integration/utils/context.rs b/tests/integration/utils/context.rs index b31645b8ba..ef110df9d5 100644 --- a/tests/integration/utils/context.rs +++ b/tests/integration/utils/context.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . pub use crate::{ node_runtime, @@ -21,7 +21,7 @@ pub use crate::{ }; use sp_keyring::AccountKeyring; -use substrate_subxt::Client; +use subxt::Client; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; @@ -30,7 +30,7 @@ pub async fn test_node_process_with(key: AccountKeyring) -> TestNodeProcess. +// along with subxt. If not, see . mod context; mod node_proc; diff --git a/tests/integration/utils/node_proc.rs b/tests/integration/utils/node_proc.rs index f9209e1236..a67ce780d3 100644 --- a/tests/integration/utils/node_proc.rs +++ b/tests/integration/utils/node_proc.rs @@ -1,5 +1,5 @@ // Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of substrate-subxt. +// 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 @@ -12,7 +12,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with substrate-subxt. If not, see . +// along with subxt. If not, see . use sp_keyring::AccountKeyring; use std::{ @@ -29,7 +29,7 @@ use std::{ thread, time, }; -use substrate_subxt::{ +use subxt::{ Client, ClientBuilder, Runtime, From cc0212d9852988999c88dc7c7869b7a8bff3318d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 13 Oct 2021 10:39:09 +0100 Subject: [PATCH 141/216] Fix runtime path relative to root Cargo.toml --- tests/integration/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index d215a7830f..2895977d3d 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -21,7 +21,7 @@ use subxt::{ StorageEntry, }; -#[subxt(runtime_metadata_path = "node_runtime.scale")] +#[subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] pub mod node_runtime { #[subxt(substitute_type = "sp_core::crypto::AccountId32")] use sp_core::crypto::AccountId32; From ea4666fbf23d9c1b70c9975adafe8354c8653f35 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 13 Oct 2021 11:26:30 +0100 Subject: [PATCH 142/216] Move RpcClient creation to RpcClient --- src/client.rs | 18 ++---------------- src/rpc.rs | 26 +++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/client.rs b/src/client.rs index 6c40a0e223..29a2bdb582 100644 --- a/src/client.rs +++ b/src/client.rs @@ -15,14 +15,9 @@ // along with subxt. If not, see . use futures::future; -use jsonrpsee_http_client::HttpClientBuilder; -use jsonrpsee_ws_client::WsClientBuilder; pub use sp_runtime::traits::SignedExtension; pub use sp_version::RuntimeVersion; -use std::{ - marker::PhantomData, - sync::Arc, -}; +use std::marker::PhantomData; use crate::{ events::EventsDecoder, @@ -97,16 +92,7 @@ impl ClientBuilder { client } else { let url = self.url.as_deref().unwrap_or("ws://127.0.0.1:9944"); - if url.starts_with("ws://") || url.starts_with("wss://") { - let client = WsClientBuilder::default() - .max_notifs_per_subscription(4096) - .build(url) - .await?; - RpcClient::WebSocket(Arc::new(client)) - } else { - let client = HttpClientBuilder::default().build(&url)?; - RpcClient::Http(Arc::new(client)) - } + RpcClient::try_from_url(url).await? }; let mut rpc = Rpc::new(client); if self.accept_weak_inclusion { diff --git a/src/rpc.rs b/src/rpc.rs index 59a7c4ff08..2a1c19f2b9 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -33,7 +33,7 @@ use core::{ marker::PhantomData, }; use frame_metadata::RuntimeMetadataPrefixed; -use jsonrpsee_http_client::HttpClient; +use jsonrpsee_http_client::{HttpClient, HttpClientBuilder}; use jsonrpsee_types::{ to_json_value, traits::{ @@ -45,7 +45,7 @@ use jsonrpsee_types::{ JsonValue, Subscription, }; -use jsonrpsee_ws_client::WsClient; +use jsonrpsee_ws_client::{WsClient, WsClientBuilder}; use serde::{ Deserialize, Serialize, @@ -190,6 +190,24 @@ pub enum RpcClient { } impl RpcClient { + /// Create a new [`RpcClient`] from the given URL. + /// + /// Infers the protocol from the URL, supports: + /// - Websockets (`ws://`, `wss://`) + /// - Http (`http://`, `https://`) + pub async fn try_from_url(url: &str) -> Result { + if url.starts_with("ws://") || url.starts_with("wss://") { + let client = WsClientBuilder::default() + .max_notifs_per_subscription(4096) + .build(url) + .await?; + Ok(RpcClient::WebSocket(Arc::new(client))) + } else { + let client = HttpClientBuilder::default().build(&url)?; + Ok(RpcClient::Http(Arc::new(client))) + } + } + /// Start a JSON-RPC request. pub async fn request<'a, T: DeserializeOwned + std::fmt::Debug>( &self, @@ -290,7 +308,7 @@ impl Clone for Rpc { } impl Rpc { - /// Create a new [`Rpc`] for a given runtime. + /// Create a new [`Rpc`] pub fn new(client: RpcClient) -> Self { Self { client, @@ -299,6 +317,8 @@ impl Rpc { } } + + /// Configure the Rpc to accept non-finalized blocks /// in `submit_and_watch_extrinsic` pub fn accept_weak_inclusion(&mut self) { From 851f6123fe884e074132b0be6ac077b6742cfdb7 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 13 Oct 2021 14:56:09 +0100 Subject: [PATCH 143/216] WIP get examples to compile --- examples/fetch_remote.rs | 35 ++++++++++++++++++++++++++++++++++- tests/integration/runtime.rs | 1 + 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/examples/fetch_remote.rs b/examples/fetch_remote.rs index d78c2d4d4a..6195edabd8 100644 --- a/examples/fetch_remote.rs +++ b/examples/fetch_remote.rs @@ -16,8 +16,41 @@ use subxt::{ ClientBuilder, - KusamaRuntime, + Runtime, }; +use sp_runtime::traits::BlakeTwo256; + +#[subxt::subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] +pub mod node_runtime { + #[subxt(substitute_type = "sp_core::crypto::AccountId32")] + use sp_core::crypto::AccountId32; + #[subxt(substitute_type = "primitive_types::H256")] + use sp_core::H256; + #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] + use sp_runtime::MultiAddress; + + #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] + use sp_arithmetic::per_things::Perbill; + #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] + use sp_arithmetic::per_things::Perquintill; +} + +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct KusamaRuntime; + +impl Runtime for KusamaRuntime { + type Index = u32; + type BlockNumber = u32; + type Hash = sp_core::H256; + type Hashing = BlakeTwo256; + type AccountId = sp_runtime::AccountId32; + type Address = sp_runtime::MultiAddress; + type Header = sp_runtime::generic::Header; + type Extra = subxt::extrinsic::DefaultExtra; + type Signature = sp_runtime::MultiSignature; + type Extrinsic = sp_runtime::OpaqueExtrinsic; + type AccountData = node_runtime::system::storage::Account; +} #[async_std::main] async fn main() -> Result<(), Box> { diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index 2895977d3d..4037c69d86 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -30,6 +30,7 @@ pub mod node_runtime { #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] use sp_runtime::MultiAddress; + // todo: [AJ] remove the requirement for these by implementing Compact handling properly #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] use sp_arithmetic::per_things::Perbill; #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] From 69e6ed645feca2813f51109280448451abf5f92d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 13 Oct 2021 15:45:07 +0100 Subject: [PATCH 144/216] Rename Runtime to Config trait --- codegen/src/api.rs | 22 +++--- examples/fetch_remote.rs | 4 +- src/client.rs | 14 ++-- src/config.rs | 105 +++++++++++++++++++++++++++ src/events.rs | 4 +- src/extrinsic/extra.rs | 36 ++++----- src/extrinsic/mod.rs | 10 +-- src/extrinsic/signer.rs | 10 +-- src/lib.rs | 93 ++---------------------- src/rpc.rs | 14 ++-- src/storage.rs | 10 +-- src/subscription.rs | 14 ++-- tests/integration/frame/contracts.rs | 6 +- tests/integration/runtime.rs | 10 +-- tests/integration/utils/node_proc.rs | 10 +-- 15 files changed, 194 insertions(+), 168 deletions(-) create mode 100644 src/config.rs diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 3be626939f..2d9f7c9793 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -126,11 +126,11 @@ impl RuntimeGenerator { use super::#types_mod_ident; #( #call_structs )* - pub struct TransactionApi<'a, T: ::subxt::Runtime> { + pub struct TransactionApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Runtime> TransactionApi<'a, T> { + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } @@ -176,11 +176,11 @@ impl RuntimeGenerator { use super::#types_mod_ident; #( #storage_structs )* - pub struct StorageApi<'a, T: ::subxt::Runtime> { + pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Runtime> StorageApi<'a, T> { + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } @@ -242,17 +242,17 @@ impl RuntimeGenerator { #( #modules )* #types_mod - pub struct RuntimeApi { + pub struct RuntimeApi { pub client: ::subxt::Client, } - impl ::core::convert::From<::subxt::Client> for RuntimeApi { + impl ::core::convert::From<::subxt::Client> for RuntimeApi { fn from(client: ::subxt::Client) -> Self { Self { client } } } - impl<'a, T: ::subxt::Runtime> RuntimeApi { + impl<'a, T: ::subxt::Config> RuntimeApi { pub fn storage(&'a self) -> StorageApi<'a, T> { StorageApi { client: &self.client } } @@ -262,11 +262,11 @@ impl RuntimeGenerator { } } - pub struct StorageApi<'a, T: ::subxt::Runtime> { + pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Runtime> StorageApi<'a, T> { + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { #( pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { #pallets_with_storage::storage::StorageApi::new(self.client) @@ -274,11 +274,11 @@ impl RuntimeGenerator { )* } - pub struct TransactionApi<'a, T: ::subxt::Runtime> { + pub struct TransactionApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Runtime> TransactionApi<'a, T> { + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> { #( pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T> { #pallets_with_calls::calls::TransactionApi::new(self.client) diff --git a/examples/fetch_remote.rs b/examples/fetch_remote.rs index 6195edabd8..f214770c04 100644 --- a/examples/fetch_remote.rs +++ b/examples/fetch_remote.rs @@ -16,7 +16,7 @@ use subxt::{ ClientBuilder, - Runtime, + Config, }; use sp_runtime::traits::BlakeTwo256; @@ -38,7 +38,7 @@ pub mod node_runtime { #[derive(Clone, Debug, Eq, PartialEq)] pub struct KusamaRuntime; -impl Runtime for KusamaRuntime { +impl Config for KusamaRuntime { type Index = u32; type BlockNumber = u32; type Hash = sp_core::H256; diff --git a/src/client.rs b/src/client.rs index 29a2bdb582..85f9da8373 100644 --- a/src/client.rs +++ b/src/client.rs @@ -39,7 +39,7 @@ use crate::{ Encoded, Error, Metadata, - Runtime, + Config, }; /// ClientBuilder for constructing a Client. @@ -87,7 +87,7 @@ impl ClientBuilder { } /// Creates a new Client. - pub async fn build(self) -> Result, Error> { + pub async fn build(self) -> Result, Error> { let client = if let Some(client) = self.client { client } else { @@ -123,7 +123,7 @@ impl ClientBuilder { } /// Client to interface with a substrate node. -pub struct Client { +pub struct Client { rpc: Rpc, genesis_hash: T::Hash, metadata: Metadata, @@ -134,7 +134,7 @@ pub struct Client { iter_page_size: u32, } -impl Clone for Client { +impl Clone for Client { fn clone(&self) -> Self { Self { rpc: self.rpc.clone(), @@ -149,7 +149,7 @@ impl Clone for Client { } } -impl Client { +impl Client { /// Returns the genesis hash. pub fn genesis(&self) -> &T::Hash { &self.genesis_hash @@ -245,14 +245,14 @@ impl Client { } /// A constructed call ready to be signed and submitted. -pub struct SubmittableExtrinsic<'a, T: Runtime, C: Call> { +pub struct SubmittableExtrinsic<'a, T: Config, C: Call> { client: &'a Client, call: C, } impl<'a, T, C> SubmittableExtrinsic<'a, T, C> where - T: Runtime, + T: Config, C: Call + Send + Sync, { /// Create a new [`SubmittableExtrinsic`]. diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000000..6113e71b5e --- /dev/null +++ b/src/config.rs @@ -0,0 +1,105 @@ +// Copyright 2019-2021 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 codec::{ + Codec, + Encode, + EncodeLike, +}; +use crate::{ + SignedExtra, + StorageEntry, +}; +use sp_runtime::traits::{ + AtLeast32Bit, + Extrinsic, + Hash, + Header, + MaybeSerializeDeserialize, + Member, + Verify, +}; + +/// Runtime types. +pub trait Config: Clone + Sized + Send + Sync + 'static { + /// Account index (aka nonce) type. This stores the number of previous + /// transactions associated with a sender account. + type Index: Parameter + Member + Default + AtLeast32Bit + Copy + scale_info::TypeInfo; + + /// The block number type used by the runtime. + type BlockNumber: Parameter + + Member + // + MaybeMallocSizeOf + // + MaybeSerializeDeserialize + // + Debug + // + MaybeDisplay + // + AtLeast32BitUnsigned + + Default + // + Bounded + + Copy + + core::hash::Hash + + core::str::FromStr; + + /// The output of the `Hashing` function. + type Hash: Parameter + + Member + + MaybeSerializeDeserialize + + Ord + + Default + + Copy + + std::hash::Hash + + AsRef<[u8]> + + AsMut<[u8]> + + scale_info::TypeInfo; + + /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). + type Hashing: Hash; + + /// The user account identifier type for the runtime. + type AccountId: Parameter + Member; // + MaybeSerialize + MaybeDisplay + Ord + Default; + + /// The address type. This instead of `::Source`. + type Address: Codec + Clone + PartialEq; + // + Debug + Send + Sync; + + /// Data to be associated with an account (other than nonce/transaction counter, which this + /// pallet does regardless). + type AccountData: AccountData; + + /// The block header. + type Header: Parameter + + Header + + serde::de::DeserializeOwned; + + /// Transaction extras. + type Extra: SignedExtra + Send + Sync + 'static; + + /// Signature type. + type Signature: Verify + Encode + Send + Sync + 'static; + + /// Extrinsic type within blocks. + type Extrinsic: Parameter + Extrinsic + core::fmt::Debug + MaybeSerializeDeserialize; +} + +/// Parameter trait compied from substrate::frame_support +pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} +impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} + +/// Trait to fetch data about an account. +pub trait AccountData: StorageEntry + From { + /// Get the nonce from the storage entry value. + fn nonce(result: &::Value) -> T::Index; +} diff --git a/src/events.rs b/src/events.rs index 605d2a70ba..289cd65849 100644 --- a/src/events.rs +++ b/src/events.rs @@ -31,7 +31,7 @@ use crate::{ Error, Metadata, Phase, - Runtime, + Config, RuntimeError, }; use scale_info::{ @@ -64,7 +64,7 @@ pub struct EventsDecoder { impl EventsDecoder where - T: Runtime, + T: Config, { /// Creates a new `EventsDecoder`. pub fn new(metadata: Metadata) -> Self { diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index 08fc88ce3a..e2beadb734 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -29,10 +29,10 @@ use sp_runtime::{ transaction_validity::TransactionValidityError, }; -use crate::Runtime; +use crate::Config; /// Extra type. -pub type Extra = <::Extra as SignedExtra>::Extra; +pub type Extra = <::Extra as SignedExtra>::Extra; /// SignedExtra checks copied from substrate, in order to remove requirement to implement /// substrate's `frame_system::Trait` @@ -47,7 +47,7 @@ pub type Extra = <::Extra as SignedExtra>::Extra; /// Ensure the runtime version registered in the transaction is the same as at present. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckSpecVersion( +pub struct CheckSpecVersion( pub PhantomData, /// Local version to be used for `AdditionalSigned` #[codec(skip)] @@ -56,7 +56,7 @@ pub struct CheckSpecVersion( impl SignedExtension for CheckSpecVersion where - T: Runtime + Clone + Debug + Eq + Send + Sync, + T: Config + Clone + Debug + Eq + Send + Sync, { const IDENTIFIER: &'static str = "CheckSpecVersion"; type AccountId = u64; @@ -78,7 +78,7 @@ where /// returned via `additional_signed()`. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckTxVersion( +pub struct CheckTxVersion( pub PhantomData, /// Local version to be used for `AdditionalSigned` #[codec(skip)] @@ -87,7 +87,7 @@ pub struct CheckTxVersion( impl SignedExtension for CheckTxVersion where - T: Runtime + Clone + Debug + Eq + Send + Sync, + T: Config + Clone + Debug + Eq + Send + Sync, { const IDENTIFIER: &'static str = "CheckTxVersion"; type AccountId = u64; @@ -109,7 +109,7 @@ where /// returned via `additional_signed()`. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckGenesis( +pub struct CheckGenesis( pub PhantomData, /// Local genesis hash to be used for `AdditionalSigned` #[codec(skip)] @@ -118,7 +118,7 @@ pub struct CheckGenesis( impl SignedExtension for CheckGenesis where - T: Runtime + Clone + Debug + Eq + Send + Sync, + T: Config + Clone + Debug + Eq + Send + Sync, { const IDENTIFIER: &'static str = "CheckGenesis"; type AccountId = u64; @@ -141,7 +141,7 @@ where /// valid forever) #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckMortality( +pub struct CheckMortality( /// The default structure for the Extra encoding pub (Era, PhantomData), /// Local genesis hash to be used for `AdditionalSigned` @@ -151,7 +151,7 @@ pub struct CheckMortality( impl SignedExtension for CheckMortality where - T: Runtime + Clone + Debug + Eq + Send + Sync, + T: Config + Clone + Debug + Eq + Send + Sync, { const IDENTIFIER: &'static str = "CheckMortality"; type AccountId = u64; @@ -168,11 +168,11 @@ where /// Nonce check and increment to give replay protection for transactions. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckNonce(#[codec(compact)] pub T::Index); +pub struct CheckNonce(#[codec(compact)] pub T::Index); impl SignedExtension for CheckNonce where - T: Runtime + Clone + Debug + Eq + Send + Sync, + T: Config + Clone + Debug + Eq + Send + Sync, { const IDENTIFIER: &'static str = "CheckNonce"; type AccountId = u64; @@ -189,11 +189,11 @@ where /// Resource limit check. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct CheckWeight(pub PhantomData); +pub struct CheckWeight(pub PhantomData); impl SignedExtension for CheckWeight where - T: Runtime + Clone + Debug + Eq + Send + Sync, + T: Config + Clone + Debug + Eq + Send + Sync, { const IDENTIFIER: &'static str = "CheckWeight"; type AccountId = u64; @@ -227,7 +227,7 @@ impl SignedExtension for ChargeTransactionPayment { } /// Trait for implementing transaction extras for a runtime. -pub trait SignedExtra: SignedExtension { +pub trait SignedExtra: SignedExtension { /// The type the extras. type Extra: SignedExtension + Send + Sync; @@ -246,14 +246,14 @@ pub trait SignedExtra: SignedExtension { /// Default `SignedExtra` for substrate runtimes. #[derive(Encode, Decode, Clone, Eq, PartialEq, Debug, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct DefaultExtra { +pub struct DefaultExtra { spec_version: u32, tx_version: u32, nonce: T::Index, genesis_hash: T::Hash, } -impl SignedExtra for DefaultExtra { +impl SignedExtra for DefaultExtra { type Extra = ( CheckSpecVersion, CheckTxVersion, @@ -291,7 +291,7 @@ impl SignedExtra for DefaultEx } } -impl SignedExtension for DefaultExtra { +impl SignedExtension for DefaultExtra { const IDENTIFIER: &'static str = "DefaultExtra"; type AccountId = T::AccountId; type Call = (); diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index 01e45d8fce..d2345e710c 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -44,14 +44,14 @@ use sp_version::RuntimeVersion; use crate::{ Encoded, Error, - Runtime, + Config, }; /// UncheckedExtrinsic type. pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< - ::Address, + ::Address, Encoded, - ::Signature, + ::Signature, Extra, >; @@ -67,7 +67,7 @@ pub async fn create_signed( signer: &(dyn Signer + Send + Sync), ) -> Result, Error> where - T: Runtime, + T: Config, <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { @@ -82,7 +82,7 @@ where /// Creates an unsigned extrinsic pub fn create_unsigned(call: Encoded) -> UncheckedExtrinsic where - T: Runtime, + T: Config, { UncheckedExtrinsic::::new_unsigned(call) } diff --git a/src/extrinsic/signer.rs b/src/extrinsic/signer.rs index b6058a87c3..7ef0dad384 100644 --- a/src/extrinsic/signer.rs +++ b/src/extrinsic/signer.rs @@ -22,7 +22,7 @@ use super::{ SignedPayload, UncheckedExtrinsic, }; -use crate::Runtime; +use crate::Config; use codec::Encode; use sp_core::Pair; use sp_runtime::traits::{ @@ -33,7 +33,7 @@ use sp_runtime::traits::{ /// Extrinsic signer. #[async_trait::async_trait] -pub trait Signer { +pub trait Signer { /// Returns the account id. fn account_id(&self) -> &T::AccountId; @@ -52,7 +52,7 @@ pub trait Signer { /// Extrinsic signer using a private key. #[derive(Clone, Debug)] -pub struct PairSigner { +pub struct PairSigner { account_id: T::AccountId, nonce: Option, signer: P, @@ -60,7 +60,7 @@ pub struct PairSigner { impl PairSigner where - T: Runtime, + T: Config, T::Signature: From, ::Signer: From + IdentifyAccount, @@ -96,7 +96,7 @@ where #[async_trait::async_trait] impl Signer for PairSigner where - T: Runtime, + T: Config, T::AccountId: Into + 'static, <>::Extra as SignedExtension>::AdditionalSigned: Send, P: Pair + 'static, diff --git a/src/lib.rs b/src/lib.rs index 5a3709fd6c..43533bc070 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,20 +40,19 @@ )] #![allow(clippy::type_complexity)] +pub use frame_metadata::StorageHasher; pub use sp_core; pub use sp_runtime; pub use subxt_macro::subxt; use codec::{ - Codec, Decode, Encode, - EncodeLike, }; -use serde::de::DeserializeOwned; -use std::fmt::Debug; +use core::fmt::Debug; mod client; +mod config; mod error; mod events; pub mod extrinsic; @@ -63,6 +62,10 @@ pub mod storage; mod subscription; pub use crate::{ + config::{ + Config, + AccountData, + }, client::{ Client, ClientBuilder, @@ -102,88 +105,6 @@ pub use crate::{ FinalizedEventStorageSubscription, }, }; -pub use frame_metadata::StorageHasher; - -use sp_runtime::traits::{ - AtLeast32Bit, - Extrinsic, - Hash, - Header, - MaybeSerializeDeserialize, - Member, - Verify, -}; - -/// Parameter trait compied from substrate::frame_support -pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} -impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} - -/// Runtime types. -pub trait Runtime: Clone + Sized + Send + Sync + 'static { - /// Account index (aka nonce) type. This stores the number of previous - /// transactions associated with a sender account. - type Index: Parameter + Member + Default + AtLeast32Bit + Copy + scale_info::TypeInfo; - - /// The block number type used by the runtime. - type BlockNumber: Parameter - + Member - // + MaybeMallocSizeOf - // + MaybeSerializeDeserialize - // + Debug - // + MaybeDisplay - // + AtLeast32BitUnsigned - + Default - // + Bounded - + Copy - + std::hash::Hash - + std::str::FromStr; - - /// The output of the `Hashing` function. - type Hash: Parameter - + Member - + MaybeSerializeDeserialize - + Ord - + Default - + Copy - + std::hash::Hash - + AsRef<[u8]> - + AsMut<[u8]> - + scale_info::TypeInfo; - - /// The hashing system (algorithm) being used in the runtime (e.g. Blake2). - type Hashing: Hash; - - /// The user account identifier type for the runtime. - type AccountId: Parameter + Member; // + MaybeSerialize + MaybeDisplay + Ord + Default; - - /// The address type. This instead of `::Source`. - type Address: Codec + Clone + PartialEq; - // + Debug + Send + Sync; - - /// Data to be associated with an account (other than nonce/transaction counter, which this - /// pallet does regardless). - type AccountData: AccountData; - - /// The block header. - type Header: Parameter - + Header - + DeserializeOwned; - - /// Transaction extras. - type Extra: SignedExtra + Send + Sync + 'static; - - /// Signature type. - type Signature: Verify + Encode + Send + Sync + 'static; - - /// Extrinsic type within blocks. - type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; -} - -/// Trait to fetch data about an account. -pub trait AccountData: StorageEntry + From { - /// Get the nonce from the storage entry value. - fn nonce(result: &::Value) -> T::Index; -} /// Call trait. pub trait Call: Encode { diff --git a/src/rpc.rs b/src/rpc.rs index 2a1c19f2b9..a7438b09e5 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -83,7 +83,7 @@ use crate::{ }, Event, Metadata, - Runtime, + Config, }; /// A number type that can be serialized both as a number or a string that encodes a number in a @@ -115,7 +115,7 @@ pub enum ListOrValue { /// Alias for the type of a block returned by `chain_getBlock` pub type ChainBlock = - SignedBlock::Header, ::Extrinsic>>; + SignedBlock::Header, ::Extrinsic>>; /// Wrapper for NumberOrHex to allow custom From impls #[derive(Serialize)] @@ -290,14 +290,14 @@ pub struct ReadProof { } /// Client for substrate rpc interfaces -pub struct Rpc { +pub struct Rpc { /// Rpc client for sending requests. pub client: RpcClient, marker: PhantomData, accept_weak_inclusion: bool, } -impl Clone for Rpc { +impl Clone for Rpc { fn clone(&self) -> Self { Self { client: self.client.clone(), @@ -307,7 +307,7 @@ impl Clone for Rpc { } } -impl Rpc { +impl Rpc { /// Create a new [`Rpc`] pub fn new(client: RpcClient) -> Self { Self { @@ -704,7 +704,7 @@ impl Rpc { /// Captures data for when an extrinsic is successfully included in a block #[derive(Debug)] -pub struct ExtrinsicSuccess { +pub struct ExtrinsicSuccess { /// Block hash. pub block: T::Hash, /// Extrinsic hash. @@ -713,7 +713,7 @@ pub struct ExtrinsicSuccess { pub events: Vec, } -impl ExtrinsicSuccess { +impl ExtrinsicSuccess { /// Find the Event for the given module/variant, with raw encoded event data. /// Returns `None` if the Event is not found. pub fn find_event_raw(&self, module: &str, variant: &str) -> Option<&RawEvent> { diff --git a/src/storage.rs b/src/storage.rs index 4a8d20cc9c..97d7b16c8e 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -36,7 +36,7 @@ use crate::{ }, rpc::Rpc, Error, - Runtime, + Config, StorageHasher, }; @@ -134,13 +134,13 @@ impl StorageMapKey { /// Client for querying runtime storage. #[derive(Clone)] -pub struct StorageClient<'a, T: Runtime> { +pub struct StorageClient<'a, T: Config> { rpc: &'a Rpc, metadata: &'a Metadata, iter_page_size: u32, } -impl<'a, T: Runtime> StorageClient<'a, T> { +impl<'a, T: Config> StorageClient<'a, T> { /// Create a new [`StorageClient`] pub fn new(rpc: &'a Rpc, metadata: &'a Metadata, iter_page_size: u32) -> Self { Self { @@ -251,7 +251,7 @@ impl<'a, T: Runtime> StorageClient<'a, T> { } /// Iterates over key value pairs in a map. -pub struct KeyIter<'a, T: Runtime, F: StorageEntry> { +pub struct KeyIter<'a, T: Config, F: StorageEntry> { client: StorageClient<'a, T>, _marker: PhantomData, count: u32, @@ -260,7 +260,7 @@ pub struct KeyIter<'a, T: Runtime, F: StorageEntry> { buffer: Vec<(StorageKey, StorageData)>, } -impl<'a, T: Runtime, F: StorageEntry> KeyIter<'a, T, F> { +impl<'a, T: Config, F: StorageEntry> KeyIter<'a, T, F> { /// Returns the next key value pair from a map. pub async fn next(&mut self) -> Result, Error> { loop { diff --git a/src/subscription.rs b/src/subscription.rs index ead9bc6b28..cfa6c7c6e6 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -38,12 +38,12 @@ use crate::{ rpc::Rpc, Event, Phase, - Runtime, + Config, }; /// Event subscription simplifies filtering a storage change set stream for /// events of interest. -pub struct EventSubscription<'a, T: Runtime> { +pub struct EventSubscription<'a, T: Config> { subscription: EventStorageSubscription, decoder: &'a EventsDecoder, block: Option, @@ -53,7 +53,7 @@ pub struct EventSubscription<'a, T: Runtime> { finished: bool, } -impl<'a, T: Runtime> EventSubscription<'a, T> { +impl<'a, T: Config> EventSubscription<'a, T> { /// Creates a new event subscription. pub fn new( subscription: EventStorageSubscription, @@ -153,14 +153,14 @@ impl From for StorageKey { } /// Event subscription to only fetch finalized storage changes. -pub struct FinalizedEventStorageSubscription { +pub struct FinalizedEventStorageSubscription { rpc: Rpc, subscription: Subscription, storage_changes: VecDeque>, storage_key: StorageKey, } -impl FinalizedEventStorageSubscription { +impl FinalizedEventStorageSubscription { /// Creates a new finalized event storage subscription. pub fn new(rpc: Rpc, subscription: Subscription) -> Self { Self { @@ -191,14 +191,14 @@ impl FinalizedEventStorageSubscription { } /// Wrapper over imported and finalized event subscriptions. -pub enum EventStorageSubscription { +pub enum EventStorageSubscription { /// Events that are InBlock Imported(Subscription>), /// Events that are Finalized Finalized(FinalizedEventStorageSubscription), } -impl EventStorageSubscription { +impl EventStorageSubscription { /// Gets the next change_set from the subscription. pub async fn next(&mut self) -> Option> { match self { diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index 35ad098b6c..5ad73ffb8d 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -36,7 +36,7 @@ use subxt::{ Error, ExtrinsicSuccess, PairSigner, - Runtime, + Config, StorageEntry, }; @@ -45,8 +45,8 @@ struct ContractsTestContext { signer: PairSigner, } -type Hash = ::Hash; -type AccountId = ::AccountId; +type Hash = ::Hash; +type AccountId = ::AccountId; impl ContractsTestContext { async fn init() -> Self { diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index 4037c69d86..5e9afc8f30 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -17,7 +17,7 @@ use sp_runtime::traits::BlakeTwo256; use subxt::{ subxt, - Runtime, + Config, StorageEntry, }; @@ -40,7 +40,7 @@ pub mod node_runtime { #[derive(Clone, Debug, Eq, PartialEq)] pub struct TestRuntime; -impl Runtime for TestRuntime { +impl Config for TestRuntime { type Index = u32; type BlockNumber = u32; type Hash = sp_core::H256; @@ -54,16 +54,16 @@ impl Runtime for TestRuntime { type AccountData = node_runtime::system::storage::Account; } -impl From<::AccountId> +impl From<::AccountId> for node_runtime::system::storage::Account { - fn from(account_id: ::AccountId) -> Self { + fn from(account_id: ::AccountId) -> Self { Self(account_id) } } impl subxt::AccountData for node_runtime::system::storage::Account { - fn nonce(result: &::Value) -> ::Index { + fn nonce(result: &::Value) -> ::Index { result.nonce } } diff --git a/tests/integration/utils/node_proc.rs b/tests/integration/utils/node_proc.rs index a67ce780d3..41505a0cc6 100644 --- a/tests/integration/utils/node_proc.rs +++ b/tests/integration/utils/node_proc.rs @@ -32,18 +32,18 @@ use std::{ use subxt::{ Client, ClientBuilder, - Runtime, + Config, }; /// Spawn a local substrate node for testing subxt. -pub struct TestNodeProcess { +pub struct TestNodeProcess { proc: process::Child, client: Client, } impl Drop for TestNodeProcess where - R: Runtime, + R: Config, { fn drop(&mut self) { let _ = self.kill(); @@ -52,7 +52,7 @@ where impl TestNodeProcess where - R: Runtime, + R: Config, { /// Construct a builder for spawning a test node process. pub fn build(program: S) -> TestNodeProcessBuilder @@ -119,7 +119,7 @@ impl TestNodeProcessBuilder { /// Spawn the substrate node at the given path, and wait for rpc to be initialized. pub async fn spawn(&self) -> Result, String> where - R: Runtime, + R: Config, { let mut cmd = process::Command::new(&self.node_path); cmd.env("RUST_LOG", "error").arg("--dev").arg("--tmp"); From a30f9f87130ced353ec7aa5124d090940959573a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 14 Oct 2021 10:28:23 +0100 Subject: [PATCH 145/216] WIP implementing default Config --- codegen/src/api.rs | 24 ++++++++++++++ src/config.rs | 48 ++++++++++++++++++++++++++-- src/events.rs | 4 +-- src/lib.rs | 1 + tests/integration/frame/balances.rs | 16 +++++----- tests/integration/frame/contracts.rs | 14 ++++---- tests/integration/frame/staking.rs | 22 ++++++------- tests/integration/frame/sudo.rs | 6 ++-- tests/integration/frame/system.rs | 6 ++-- tests/integration/main.rs | 5 +-- tests/integration/runtime.rs | 40 +---------------------- tests/integration/utils/context.rs | 17 +++++----- 12 files changed, 114 insertions(+), 89 deletions(-) diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 2d9f7c9793..bb20c031cd 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -242,6 +242,30 @@ impl RuntimeGenerator { #( #modules )* #types_mod + fn id() { + let _: ::AccountId = sp_runtime::AccountId32::default(); + } + + pub type DefaultConfig = ::subxt::DefaultConfig; + pub type DefaultAccountId = <::subxt::DefaultConfig as ::subxt::Config>::AccountId; + + // todo: [AJ] check for this type's existence or allow config + pub type AccountData = self::system::storage::Account; + + // todo: [AJ] is there a simpler way to implment this, or at least clean up the generics + impl From<::AccountId> for self::system::storage::Account + { + fn from(account_id: ::AccountId) -> self::system::storage::Account { + self::system::storage::Account(account_id) + } + } + + impl ::subxt::AccountData for AccountData { + fn nonce(result: &::Value) -> <::subxt::DefaultConfig as ::subxt::Config>::Index { + result.nonce + } + } + pub struct RuntimeApi { pub client: ::subxt::Client, } diff --git a/src/config.rs b/src/config.rs index 6113e71b5e..dd839903dc 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,6 +19,7 @@ use codec::{ Encode, EncodeLike, }; +use core::fmt::Debug; use crate::{ SignedExtra, StorageEntry, @@ -91,15 +92,56 @@ pub trait Config: Clone + Sized + Send + Sync + 'static { type Signature: Verify + Encode + Send + Sync + 'static; /// Extrinsic type within blocks. - type Extrinsic: Parameter + Extrinsic + core::fmt::Debug + MaybeSerializeDeserialize; + type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; } /// Parameter trait compied from substrate::frame_support -pub trait Parameter: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} -impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + std::fmt::Debug {} +pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug {} +impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug {} /// Trait to fetch data about an account. pub trait AccountData: StorageEntry + From { /// Get the nonce from the storage entry value. fn nonce(result: &::Value) -> T::Index; } + +/// Default configuration of common types for a target Substrate runtime. +pub struct DefaultConfig(core::marker::PhantomData T>); + +impl Clone for DefaultConfig { + fn clone(&self) -> Self { + Self(Default::default()) + } +} + +impl Debug for DefaultConfig { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + self.0.fmt(f) + } +} + +impl core::cmp::PartialEq for DefaultConfig { + fn eq(&self, _: &Self) -> bool { + true + } +} + +impl core::cmp::Eq for DefaultConfig { +} + +impl Config for DefaultConfig +where + T: AccountData + 'static +{ + type Index = u32; + type BlockNumber = u32; + type Hash = sp_core::H256; + type Hashing = sp_runtime::traits::BlakeTwo256; + type AccountId = sp_runtime::AccountId32; + type Address = sp_runtime::MultiAddress; + type Header = sp_runtime::generic::Header; + type Extra = crate::extrinsic::DefaultExtra; + type Signature = sp_runtime::MultiSignature; + type Extrinsic = sp_runtime::OpaqueExtrinsic; + type AccountData = T; +} diff --git a/src/events.rs b/src/events.rs index 289cd65849..1055be4bd7 100644 --- a/src/events.rs +++ b/src/events.rs @@ -293,11 +293,11 @@ pub enum Raw { // use super::*; // use std::convert::TryFrom; // -// type TestRuntime = crate::NodeTemplateRuntime; +// type DefaultConfig = crate::NodeTemplateRuntime; // // #[test] // fn test_decode_option() { -// let decoder = EventsDecoder::::new( +// let decoder = EventsDecoder::::new( // Metadata::default(), // ); // diff --git a/src/lib.rs b/src/lib.rs index 43533bc070..28f7ba7c8b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,6 +64,7 @@ mod subscription; pub use crate::{ config::{ Config, + DefaultConfig, AccountData, }, client::{ diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index fe89a178c1..8a1bbfd805 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -21,7 +21,7 @@ use crate::{ system, }, test_context, - TestRuntime, + DefaultConfig, }; use codec::Decode; use sp_core::{ @@ -42,8 +42,8 @@ use subxt::{ #[async_std::test] async fn tx_basic_transfer() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let bob_address = bob.account_id().clone().into(); let cxt = test_context().await; let api = &cxt.api; @@ -116,7 +116,7 @@ async fn storage_total_issuance() { #[async_std::test] async fn storage_balance_lock() -> Result<(), subxt::Error> { - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let charlie = AccountKeyring::Charlie.to_account_id(); let cxt = test_context().await; @@ -157,9 +157,9 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { #[async_std::test] async fn transfer_error() { env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let alice_addr = alice.account_id().clone().into(); - let hans = PairSigner::::new(Pair::generate().0); + let hans = PairSigner::::new(Pair::generate().0); let hans_address = hans.account_id().clone().into(); let cxt = test_context().await; @@ -194,13 +194,13 @@ async fn transfer_error() { #[async_std::test] async fn transfer_subscription() { env_logger::try_init().ok(); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id(); let bob_addr = bob.clone().into(); let cxt = test_context().await; let sub = cxt.client().rpc().subscribe_events().await.unwrap(); let decoder = cxt.client().events_decoder(); - let mut sub = EventSubscription::::new(sub, &decoder); + let mut sub = EventSubscription::::new(sub, &decoder); sub.filter_event::(); cxt.api diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index 5ad73ffb8d..241057c756 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -27,7 +27,7 @@ use crate::{ }, test_context, TestContext, - TestRuntime, + DefaultConfig, }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; @@ -42,11 +42,11 @@ use subxt::{ struct ContractsTestContext { cxt: TestContext, - signer: PairSigner, + signer: PairSigner, } -type Hash = ::Hash; -type AccountId = ::AccountId; +type Hash = ::Hash; +type AccountId = ::AccountId; impl ContractsTestContext { async fn init() -> Self { @@ -56,11 +56,11 @@ impl ContractsTestContext { Self { cxt, signer } } - fn client(&self) -> &Client { + fn client(&self) -> &Client { &self.cxt.client() } - fn contracts_tx(&self) -> TransactionApi { + fn contracts_tx(&self) -> TransactionApi { self.cxt.api.tx().contracts() } @@ -138,7 +138,7 @@ impl ContractsTestContext { &self, contract: AccountId, input_data: Vec, - ) -> Result, Error> { + ) -> Result, Error> { log::info!("call: {:?}", contract); let result = self .contracts_tx() diff --git a/tests/integration/frame/staking.rs b/tests/integration/frame/staking.rs index c1f63ae706..a5c7eb8f5d 100644 --- a/tests/integration/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -23,7 +23,7 @@ use crate::{ staking, }, test_context, - TestRuntime, + DefaultConfig, }; use assert_matches::assert_matches; use sp_core::{ @@ -56,7 +56,7 @@ fn default_validator_prefs() -> ValidatorPrefs { #[async_std::test] async fn validate_with_controller_account() -> Result<(), Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; let announce_validator = cxt .api @@ -75,7 +75,7 @@ async fn validate_with_controller_account() -> Result<(), Error> { #[async_std::test] async fn validate_not_possible_for_stash_account() -> Result<(), Error> { - let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); + let alice_stash = PairSigner::::new(get_from_seed("Alice//stash")); let cxt = test_context().await; let announce_validator = cxt .api @@ -93,8 +93,8 @@ async fn validate_not_possible_for_stash_account() -> Result<(), Error> { #[async_std::test] async fn nominate_with_controller_account() -> Result<(), Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let cxt = test_context().await; let nomination = cxt @@ -114,8 +114,8 @@ async fn nominate_with_controller_account() -> Result<(), Error> { #[async_std::test] async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); - let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + PairSigner::::new(get_from_seed("Alice//stash")); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let cxt = test_context().await; let nomination = cxt @@ -136,10 +136,10 @@ async fn nominate_not_possible_for_stash_account() -> Result<(), Error> { #[async_std::test] async fn chill_works_for_controller_only() -> Result<(), Error> { let alice_stash = - PairSigner::::new(get_from_seed("Alice//stash")); + PairSigner::::new(get_from_seed("Alice//stash")); let bob_stash = - PairSigner::::new(get_from_seed("Bob//stash")); - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + PairSigner::::new(get_from_seed("Bob//stash")); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; // this will fail the second time, which is why this is one test, not two @@ -186,7 +186,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { #[async_std::test] async fn tx_bond() -> Result<(), Error> { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; let bond = cxt diff --git a/tests/integration/frame/sudo.rs b/tests/integration/frame/sudo.rs index 4960e2aaa9..5e918f1fa0 100644 --- a/tests/integration/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -20,7 +20,7 @@ use crate::{ sudo, }, test_context, - TestRuntime, + DefaultConfig, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; @@ -32,7 +32,7 @@ type BalancesCall = runtime_types::pallet_balances::pallet::Call; #[async_std::test] async fn test_sudo() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id().clone().into(); let cxt = test_context().await; @@ -56,7 +56,7 @@ async fn test_sudo() { #[async_std::test] async fn test_sudo_unchecked_weight() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let bob = AccountKeyring::Bob.to_account_id().into(); let cxt = test_context().await; diff --git a/tests/integration/frame/system.rs b/tests/integration/frame/system.rs index a23b3f2ca9..fee597c8d2 100644 --- a/tests/integration/frame/system.rs +++ b/tests/integration/frame/system.rs @@ -17,7 +17,7 @@ use crate::{ node_runtime::system, test_context, - TestRuntime, + DefaultConfig, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; @@ -28,7 +28,7 @@ use subxt::extrinsic::{ #[async_std::test] async fn storage_account() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; let account_info = cxt @@ -42,7 +42,7 @@ async fn storage_account() { #[async_std::test] async fn tx_remark_with_event() { - let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; let result = cxt diff --git a/tests/integration/main.rs b/tests/integration/main.rs index 318e5cd040..0dcdd79136 100644 --- a/tests/integration/main.rs +++ b/tests/integration/main.rs @@ -22,8 +22,5 @@ mod client; #[cfg(test)] mod frame; -pub use runtime::{ - node_runtime, - TestRuntime, -}; +pub use runtime::node_runtime; pub use utils::*; diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index 5e9afc8f30..dc4f29cc14 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -14,14 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use sp_runtime::traits::BlakeTwo256; -use subxt::{ - subxt, - Config, - StorageEntry, -}; - -#[subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] +#[subxt::subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] pub mod node_runtime { #[subxt(substitute_type = "sp_core::crypto::AccountId32")] use sp_core::crypto::AccountId32; @@ -36,34 +29,3 @@ pub mod node_runtime { #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] use sp_arithmetic::per_things::Perquintill; } - -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct TestRuntime; - -impl Config for TestRuntime { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; - type AccountId = sp_runtime::AccountId32; - type Address = sp_runtime::MultiAddress; - type Header = sp_runtime::generic::Header; - type Extra = subxt::extrinsic::DefaultExtra; - type Signature = sp_runtime::MultiSignature; - type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = node_runtime::system::storage::Account; -} - -impl From<::AccountId> - for node_runtime::system::storage::Account -{ - fn from(account_id: ::AccountId) -> Self { - Self(account_id) - } -} - -impl subxt::AccountData for node_runtime::system::storage::Account { - fn nonce(result: &::Value) -> ::Index { - result.nonce - } -} diff --git a/tests/integration/utils/context.rs b/tests/integration/utils/context.rs index ef110df9d5..d3be2277b4 100644 --- a/tests/integration/utils/context.rs +++ b/tests/integration/utils/context.rs @@ -15,9 +15,8 @@ // along with subxt. If not, see . pub use crate::{ - node_runtime, + node_runtime::{self, DefaultConfig}, TestNodeProcess, - TestRuntime, }; use sp_keyring::AccountKeyring; @@ -26,7 +25,7 @@ use subxt::Client; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; -pub async fn test_node_process_with(key: AccountKeyring) -> TestNodeProcess { +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. \ @@ -35,25 +34,25 @@ pub async fn test_node_process_with(key: AccountKeyring) -> TestNodeProcess::build(path.as_str()) + let proc = TestNodeProcess::::build(path.as_str()) .with_authority(key) .scan_for_open_ports() - .spawn::() + .spawn::() .await; proc.unwrap() } -pub async fn test_node_process() -> TestNodeProcess { +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, + pub node_proc: TestNodeProcess, + pub api: node_runtime::RuntimeApi, } impl TestContext { - pub fn client(&self) -> &Client { + pub fn client(&self) -> &Client { &self.api.client } } From d5bec8c1943a2356250da769578d6c361dc8e421 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 15 Oct 2021 07:59:51 +0100 Subject: [PATCH 146/216] WIP implementing default extrinsic extras --- codegen/src/api.rs | 34 ++++---- src/client.rs | 121 ++++++++++++--------------- src/config.rs | 62 ++++---------- src/extrinsic/extra.rs | 2 +- src/extrinsic/mod.rs | 29 +++---- src/extrinsic/signer.rs | 32 ++++--- src/lib.rs | 2 + src/metadata.rs | 2 +- tests/integration/frame/balances.rs | 2 +- tests/integration/frame/contracts.rs | 5 +- tests/integration/frame/staking.rs | 2 +- tests/integration/frame/sudo.rs | 6 +- tests/integration/runtime.rs | 2 +- tests/integration/utils/context.rs | 4 +- 14 files changed, 134 insertions(+), 171 deletions(-) diff --git a/codegen/src/api.rs b/codegen/src/api.rs index bb20c031cd..efb15539a4 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -242,28 +242,27 @@ impl RuntimeGenerator { #( #modules )* #types_mod - fn id() { - let _: ::AccountId = sp_runtime::AccountId32::default(); - } - - pub type DefaultConfig = ::subxt::DefaultConfig; - pub type DefaultAccountId = <::subxt::DefaultConfig as ::subxt::Config>::AccountId; - // todo: [AJ] check for this type's existence or allow config pub type AccountData = self::system::storage::Account; - // todo: [AJ] is there a simpler way to implment this, or at least clean up the generics - impl From<::AccountId> for self::system::storage::Account - { - fn from(account_id: ::AccountId) -> self::system::storage::Account { - self::system::storage::Account(account_id) - } - } + // todo: [AJ] make this configurable or auto-generated from metadata + pub type Extra = ::subxt::DefaultExtra<::subxt::DefaultConfig>; - impl ::subxt::AccountData for AccountData { - fn nonce(result: &::Value) -> <::subxt::DefaultConfig as ::subxt::Config>::Index { + impl ::subxt::AccountData<::subxt::DefaultConfig> for AccountData { + fn nonce(result: &::Value) -> <::subxt::DefaultConfig as ::subxt::Config>::Index { result.nonce } + fn storage_entry(account_id: <::subxt::DefaultConfig as ::subxt::Config>::AccountId) -> Self { + Self(account_id) + } + } + + #[derive(Debug)] + pub struct ExtrinsicExtra; + + impl ::subxt::ExtrinsicExtraData<::subxt::DefaultConfig> for ExtrinsicExtra { + type AccountData = AccountData; + type Extra = Extra; } pub struct RuntimeApi { @@ -366,6 +365,7 @@ impl RuntimeGenerator { pallet: &PalletMetadata, call: &PalletCallMetadata, ) -> (Vec, Vec) { + let extra_type = quote!( super::super::ExtrinsicExtra ); let struct_defs = self.generate_structs_from_variants(type_gen, call.ty.id(), "Call"); struct_defs @@ -400,7 +400,7 @@ impl RuntimeGenerator { pub fn #fn_name( &self, #( #call_fn_args, )* - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic { let call = #call_struct_name { #( #call_args, )* }; ::subxt::SubmittableExtrinsic::new(self.client, call) } diff --git a/src/client.rs b/src/client.rs index 85f9da8373..c9f6bba04b 100644 --- a/src/client.rs +++ b/src/client.rs @@ -23,9 +23,9 @@ use crate::{ events::EventsDecoder, extrinsic::{ self, - SignedExtra, Signer, UncheckedExtrinsic, + SignedExtra, }, rpc::{ ExtrinsicSuccess, @@ -36,8 +36,8 @@ use crate::{ storage::StorageClient, AccountData, Call, - Encoded, Error, + ExtrinsicExtraData, Metadata, Config, }; @@ -116,7 +116,6 @@ impl ClientBuilder { events_decoder, properties: properties.unwrap_or_else(|_| Default::default()), runtime_version: runtime_version?, - _marker: PhantomData, iter_page_size: self.page_size.unwrap_or(10), }) } @@ -130,7 +129,7 @@ pub struct Client { events_decoder: EventsDecoder, properties: SystemProperties, runtime_version: RuntimeVersion, - _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, + // _marker: PhantomData<(fn() -> T::Signature, T::Extra)>, iter_page_size: u32, } @@ -143,7 +142,6 @@ impl Clone for Client { events_decoder: self.events_decoder.clone(), properties: self.properties.clone(), runtime_version: self.runtime_version.clone(), - _marker: PhantomData, iter_page_size: self.iter_page_size, } } @@ -183,81 +181,28 @@ impl Client { self.into() } - /// Creates a signed extrinsic. - pub async fn create_signed( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let account_nonce = if let Some(nonce) = signer.nonce() { - nonce - } else { - let account_storage_entry = - >::from(signer.account_id().clone()); - let account_data = self - .storage() - .fetch_or_default(&account_storage_entry, None) - .await?; - >::nonce(&account_data) - }; - let call = self.encode(call)?; - let signed = extrinsic::create_signed( - &self.runtime_version, - self.genesis_hash, - account_nonce, - call, - signer, - ) - .await?; - Ok(signed) - } - - /// Encodes a call. - pub fn encode(&self, call: C) -> Result { - Ok(self - .metadata() - .pallet(C::PALLET) - .and_then(|pallet| pallet.encode_call(call))?) - } - /// Returns the events decoder. pub fn events_decoder(&self) -> &EventsDecoder { &self.events_decoder } - - /// Submits a transaction to the chain. - pub async fn submit( - &self, - call: C, - signer: &(dyn Signer + Send + Sync), - ) -> Result - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, - { - let extrinsic = self.create_signed(call, signer).await?; - self.rpc().submit_extrinsic(extrinsic).await - } } /// A constructed call ready to be signed and submitted. -pub struct SubmittableExtrinsic<'a, T: Config, C: Call> { +pub struct SubmittableExtrinsic<'a, T: Config, E, C> { client: &'a Client, call: C, + marker: PhantomData E> } -impl<'a, T, C> SubmittableExtrinsic<'a, T, C> +impl<'a, T, E, C> SubmittableExtrinsic<'a, T, E, C> where T: Config, + E: ExtrinsicExtraData, C: Call + Send + Sync, { /// Create a new [`SubmittableExtrinsic`]. pub fn new(client: &'a Client, call: C) -> Self { - Self { client, call } + Self { client, call, marker: PhantomData } } /// Creates and signs an extrinsic and submits to the chain. @@ -266,13 +211,13 @@ where /// events which were triggered by the extrinsic. pub async fn sign_and_submit_then_watch( self, - signer: &(dyn Signer + Send + Sync), + signer: &(dyn Signer + Send + Sync), ) -> Result, Error> where - <>::Extra as SignedExtension>::AdditionalSigned: + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { - let extrinsic = self.client.create_signed(self.call, signer).await?; + let extrinsic = self.create_signed(signer).await?; self.client .rpc() .submit_and_watch_extrinsic(extrinsic, self.client.events_decoder()) @@ -289,13 +234,51 @@ where /// and has been included in the transaction pool. pub async fn sign_and_submit( self, - signer: &(dyn Signer + Send + Sync), + signer: &(dyn Signer + Send + Sync), ) -> Result where - <>::Extra as SignedExtension>::AdditionalSigned: + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { - let extrinsic = self.client.create_signed(self.call, signer).await?; + let extrinsic = self.create_signed(signer).await?; self.client.rpc().submit_extrinsic(extrinsic).await } + + /// Creates a signed extrinsic. + pub async fn create_signed( + &self, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> + where + <>::Extra as SignedExtension>::AdditionalSigned: + Send + Sync, + { + let account_nonce = if let Some(nonce) = signer.nonce() { + nonce + } else { + let account_storage_entry = + >::storage_entry(signer.account_id().clone()); + let account_data = self + .client + .storage() + .fetch_or_default(&account_storage_entry, None) + .await?; + >::nonce(&account_data) + }; + let call = self + .client + .metadata() + .pallet(C::PALLET) + .and_then(|pallet| pallet.encode_call(&self.call))?; + + let signed = extrinsic::create_signed( + &self.client.runtime_version, + self.client.genesis_hash, + account_nonce, + call, + signer, + ) + .await?; + Ok(signed) + } } diff --git a/src/config.rs b/src/config.rs index dd839903dc..394e14ca55 100644 --- a/src/config.rs +++ b/src/config.rs @@ -43,13 +43,7 @@ pub trait Config: Clone + Sized + Send + Sync + 'static { /// The block number type used by the runtime. type BlockNumber: Parameter + Member - // + MaybeMallocSizeOf - // + MaybeSerializeDeserialize - // + Debug - // + MaybeDisplay - // + AtLeast32BitUnsigned + Default - // + Bounded + Copy + core::hash::Hash + core::str::FromStr; @@ -70,24 +64,16 @@ pub trait Config: Clone + Sized + Send + Sync + 'static { type Hashing: Hash; /// The user account identifier type for the runtime. - type AccountId: Parameter + Member; // + MaybeSerialize + MaybeDisplay + Ord + Default; + type AccountId: Parameter + Member; /// The address type. This instead of `::Source`. type Address: Codec + Clone + PartialEq; - // + Debug + Send + Sync; - - /// Data to be associated with an account (other than nonce/transaction counter, which this - /// pallet does regardless). - type AccountData: AccountData; /// The block header. type Header: Parameter + Header + serde::de::DeserializeOwned; - /// Transaction extras. - type Extra: SignedExtra + Send + Sync + 'static; - /// Signature type. type Signature: Verify + Encode + Send + Sync + 'static; @@ -95,44 +81,34 @@ pub trait Config: Clone + Sized + Send + Sync + 'static { type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize; } -/// Parameter trait compied from substrate::frame_support +/// Parameter trait copied from `substrate::frame_support` pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug {} impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug {} /// Trait to fetch data about an account. -pub trait AccountData: StorageEntry + From { +/// +/// Should be implemented on a type implementing `StorageEntry`, +/// usually generated by the `subxt` macro. +pub trait AccountData: StorageEntry { + /// Create a new storage entry key from the account id. + fn storage_entry(account_id: T::AccountId) -> Self; /// Get the nonce from the storage entry value. fn nonce(result: &::Value) -> T::Index; } -/// Default configuration of common types for a target Substrate runtime. -pub struct DefaultConfig(core::marker::PhantomData T>); - -impl Clone for DefaultConfig { - fn clone(&self) -> Self { - Self(Default::default()) - } -} - -impl Debug for DefaultConfig { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - self.0.fmt(f) - } -} - -impl core::cmp::PartialEq for DefaultConfig { - fn eq(&self, _: &Self) -> bool { - true - } +/// Trait to configure the extra data for an extrinsic. +pub trait ExtrinsicExtraData { + /// The type of the [`StorageEntry`] which can be used to retrieve an account nonce. + type AccountData: AccountData; + /// The type of extra data and additional signed data to be included in a transaction. + type Extra: SignedExtra + Send + Sync + 'static; } -impl core::cmp::Eq for DefaultConfig { -} +/// Default configuration of common types for a target Substrate runtime. +#[derive(Clone, Debug, Default, Eq, PartialEq)] +pub struct DefaultConfig; -impl Config for DefaultConfig -where - T: AccountData + 'static -{ +impl Config for DefaultConfig { type Index = u32; type BlockNumber = u32; type Hash = sp_core::H256; @@ -140,8 +116,6 @@ where type AccountId = sp_runtime::AccountId32; type Address = sp_runtime::MultiAddress; type Header = sp_runtime::generic::Header; - type Extra = crate::extrinsic::DefaultExtra; type Signature = sp_runtime::MultiSignature; type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = T; } diff --git a/src/extrinsic/extra.rs b/src/extrinsic/extra.rs index e2beadb734..62c66bd6f6 100644 --- a/src/extrinsic/extra.rs +++ b/src/extrinsic/extra.rs @@ -32,7 +32,7 @@ use sp_runtime::{ use crate::Config; /// Extra type. -pub type Extra = <::Extra as SignedExtra>::Extra; +// pub type Extra = <::Extra as SignedExtra>::Extra; /// SignedExtra checks copied from substrate, in order to remove requirement to implement /// substrate's `frame_system::Trait` diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index d2345e710c..a6cba9217d 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -29,7 +29,6 @@ pub use self::{ CheckTxVersion, CheckWeight, DefaultExtra, - Extra, SignedExtra, }, signer::{ @@ -45,44 +44,38 @@ use crate::{ Encoded, Error, Config, + ExtrinsicExtraData, }; /// UncheckedExtrinsic type. -pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< +pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< ::Address, Encoded, ::Signature, - Extra, + <>::Extra as SignedExtra>::Extra, >; /// SignedPayload type. -pub type SignedPayload = sp_runtime::generic::SignedPayload>; +pub type SignedPayload = sp_runtime::generic::SignedPayload>::Extra as SignedExtra>::Extra>; /// Creates a signed extrinsic -pub async fn create_signed( +pub async fn create_signed( runtime_version: &RuntimeVersion, genesis_hash: T::Hash, nonce: T::Index, call: Encoded, - signer: &(dyn Signer + Send + Sync), -) -> Result, Error> + signer: &(dyn Signer + Send + Sync), +) -> Result, Error> where T: Config, - <>::Extra as SignedExtension>::AdditionalSigned: + E: ExtrinsicExtraData, + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { let spec_version = runtime_version.spec_version; let tx_version = runtime_version.transaction_version; - let extra: T::Extra = T::Extra::new(spec_version, tx_version, nonce, genesis_hash); - let payload = SignedPayload::::new(call, extra.extra())?; + let extra: E::Extra = E::Extra::new(spec_version, tx_version, nonce, genesis_hash); + let payload = SignedPayload::::new(call, extra.extra())?; let signed = signer.sign(payload).await?; Ok(signed) } - -/// Creates an unsigned extrinsic -pub fn create_unsigned(call: Encoded) -> UncheckedExtrinsic -where - T: Config, -{ - UncheckedExtrinsic::::new_unsigned(call) -} diff --git a/src/extrinsic/signer.rs b/src/extrinsic/signer.rs index 7ef0dad384..4b9a4c731e 100644 --- a/src/extrinsic/signer.rs +++ b/src/extrinsic/signer.rs @@ -18,12 +18,16 @@ //! [substrate](https://github.com/paritytech/substrate) node via RPC. use super::{ - SignedExtra, SignedPayload, UncheckedExtrinsic, }; -use crate::Config; +use crate::{ + Config, + ExtrinsicExtraData, + SignedExtra, +}; use codec::Encode; +use core::marker::PhantomData; use sp_core::Pair; use sp_runtime::traits::{ IdentifyAccount, @@ -33,7 +37,7 @@ use sp_runtime::traits::{ /// Extrinsic signer. #[async_trait::async_trait] -pub trait Signer { +pub trait Signer> { /// Returns the account id. fn account_id(&self) -> &T::AccountId; @@ -46,21 +50,23 @@ pub trait Signer { /// refused the operation. async fn sign( &self, - extrinsic: SignedPayload, - ) -> Result, String>; + extrinsic: SignedPayload, + ) -> Result, String>; } /// Extrinsic signer using a private key. #[derive(Clone, Debug)] -pub struct PairSigner { +pub struct PairSigner { account_id: T::AccountId, nonce: Option, signer: P, + marker: PhantomData E>, } -impl PairSigner +impl PairSigner where T: Config, + E: ExtrinsicExtraData, T::Signature: From, ::Signer: From + IdentifyAccount, @@ -74,6 +80,7 @@ where account_id, nonce: None, signer, + marker: PhantomData, } } @@ -94,11 +101,12 @@ where } #[async_trait::async_trait] -impl Signer for PairSigner +impl Signer for PairSigner where T: Config, + E: ExtrinsicExtraData, T::AccountId: Into + 'static, - <>::Extra as SignedExtension>::AdditionalSigned: Send, + <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static, P: Pair + 'static, P::Signature: Into + 'static, { @@ -112,11 +120,11 @@ where async fn sign( &self, - extrinsic: SignedPayload, - ) -> Result, String> { + extrinsic: SignedPayload, + ) -> Result, String> { let signature = extrinsic.using_encoded(|payload| self.signer.sign(payload)); let (call, extra, _) = extrinsic.deconstruct(); - let extrinsic = UncheckedExtrinsic::::new_signed( + let extrinsic = UncheckedExtrinsic::::new_signed( call, self.account_id.clone().into(), signature.into(), diff --git a/src/lib.rs b/src/lib.rs index 28f7ba7c8b..4fabede598 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,6 +66,7 @@ pub use crate::{ Config, DefaultConfig, AccountData, + ExtrinsicExtraData, }, client::{ Client, @@ -82,6 +83,7 @@ pub use crate::{ RawEvent, }, extrinsic::{ + DefaultExtra, PairSigner, SignedExtra, Signer, diff --git a/src/metadata.rs b/src/metadata.rs index 0638aac575..c7f14adc0c 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -141,7 +141,7 @@ pub struct PalletMetadata { } impl PalletMetadata { - pub fn encode_call(&self, call: C) -> Result + pub fn encode_call(&self, call: &C) -> Result where C: Call, { diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index 8a1bbfd805..33adbb40b5 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -21,7 +21,6 @@ use crate::{ system, }, test_context, - DefaultConfig, }; use codec::Decode; use sp_core::{ @@ -34,6 +33,7 @@ use subxt::{ PairSigner, Signer, }, + DefaultConfig, Error, EventSubscription, PalletError, diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index 241057c756..2a54065260 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -18,6 +18,7 @@ use sp_keyring::AccountKeyring; use crate::{ node_runtime::{ + ExtrinsicExtra, contracts::{ calls::TransactionApi, events, @@ -27,12 +28,12 @@ use crate::{ }, test_context, TestContext, - DefaultConfig, }; use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; use subxt::{ Client, + DefaultConfig, Error, ExtrinsicSuccess, PairSigner, @@ -42,7 +43,7 @@ use subxt::{ struct ContractsTestContext { cxt: TestContext, - signer: PairSigner, + signer: PairSigner, } type Hash = ::Hash; diff --git a/tests/integration/frame/staking.rs b/tests/integration/frame/staking.rs index a5c7eb8f5d..7efc7a45bb 100644 --- a/tests/integration/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -23,7 +23,6 @@ use crate::{ staking, }, test_context, - DefaultConfig, }; use assert_matches::assert_matches; use sp_core::{ @@ -36,6 +35,7 @@ use subxt::{ PairSigner, Signer, }, + DefaultConfig, Error, ExtrinsicSuccess, RuntimeError, diff --git a/tests/integration/frame/sudo.rs b/tests/integration/frame/sudo.rs index 5e918f1fa0..1e0823cac0 100644 --- a/tests/integration/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -20,11 +20,13 @@ use crate::{ sudo, }, test_context, - DefaultConfig, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::PairSigner; +use subxt::{ + DefaultConfig, + extrinsic::PairSigner +}; // todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call type Call = runtime_types::node_runtime::Call; diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index dc4f29cc14..8108801082 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -28,4 +28,4 @@ pub mod node_runtime { use sp_arithmetic::per_things::Perbill; #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] use sp_arithmetic::per_things::Perquintill; -} +} \ No newline at end of file diff --git a/tests/integration/utils/context.rs b/tests/integration/utils/context.rs index d3be2277b4..e9ab13ca9e 100644 --- a/tests/integration/utils/context.rs +++ b/tests/integration/utils/context.rs @@ -15,12 +15,12 @@ // along with subxt. If not, see . pub use crate::{ - node_runtime::{self, DefaultConfig}, + node_runtime, TestNodeProcess, }; use sp_keyring::AccountKeyring; -use subxt::Client; +use subxt::{Client, DefaultConfig}; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; From 567ce0eb4f0e667343c658623ec6706db2757c6d Mon Sep 17 00:00:00 2001 From: Paulo Martins Date: Fri, 15 Oct 2021 10:12:31 +0100 Subject: [PATCH 147/216] fix metadata constants (#299) --- src/metadata.rs | 6 +++++- tests/src/frame/balances.rs | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/metadata.rs b/src/metadata.rs index 0ab94e8476..7272add1a9 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -279,12 +279,16 @@ impl TryFrom for Metadata { .collect() }); + let constants = pallet.constants.iter().map(|constant| + (constant.name.clone(), constant.clone())) + .collect(); + let pallet_metadata = PalletMetadata { index: pallet.index, name: pallet.name.to_string(), calls, storage, - constants: Default::default(), // todo: [AJ] constants + constants, }; Ok((pallet.name.to_string(), pallet_metadata)) diff --git a/tests/src/frame/balances.rs b/tests/src/frame/balances.rs index a14a12e1df..f55e7bf300 100644 --- a/tests/src/frame/balances.rs +++ b/tests/src/frame/balances.rs @@ -218,3 +218,18 @@ async fn transfer_subscription() { balances::events::Transfer(alice.account_id().clone(), bob.clone(), 10_000,) ); } + +#[async_std::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, 10_000_000_000); +} \ No newline at end of file From a672dc4dfa08fd2668a9d278b669bef7c61b02a1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 15 Oct 2021 13:32:16 +0100 Subject: [PATCH 148/216] Move DefaultConfig definition and impl to macro --- codegen/src/api.rs | 81 +++++++++++++++++++--------- src/client.rs | 34 +++++------- src/config.rs | 16 ------ src/extrinsic/mod.rs | 21 ++++---- src/extrinsic/signer.rs | 29 +++++----- src/lib.rs | 1 - tests/integration/frame/balances.rs | 2 +- tests/integration/frame/contracts.rs | 5 +- tests/integration/frame/staking.rs | 2 +- tests/integration/frame/sudo.rs | 6 +-- tests/integration/frame/system.rs | 8 +-- tests/integration/utils/context.rs | 4 +- 12 files changed, 105 insertions(+), 104 deletions(-) diff --git a/codegen/src/api.rs b/codegen/src/api.rs index efb15539a4..818d2f08f7 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -126,11 +126,14 @@ impl RuntimeGenerator { use super::#types_mod_ident; #( #call_structs )* - pub struct TransactionApi<'a, T: ::subxt::Config> { + pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> { + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } @@ -242,40 +245,60 @@ impl RuntimeGenerator { #( #modules )* #types_mod + /// Default configuration of common types for a target Substrate runtime. + // todo: allow to define/override this as part of the annotated mod + #[derive(Clone, Debug, Default, Eq, PartialEq)] + pub struct DefaultConfig; + + impl ::subxt::Config for DefaultConfig { + type Index = u32; + type BlockNumber = u32; + type Hash = ::subxt::sp_core::H256; + type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; + type AccountId = ::subxt::sp_runtime::AccountId32; + type Address = ::subxt::sp_runtime::MultiAddress; + type Header = ::subxt::sp_runtime::generic::Header< + Self::BlockNumber, ::subxt::sp_runtime::traits::BlakeTwo256 + >; + type Signature = ::subxt::sp_runtime::MultiSignature; + type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; + } + + impl ::subxt::ExtrinsicExtraData for DefaultConfig { + type AccountData = AccountData; + // todo: [AJ] make this configurable or auto-generated from metadata + type Extra = ::subxt::DefaultExtra; + } + // todo: [AJ] check for this type's existence or allow config pub type AccountData = self::system::storage::Account; - // todo: [AJ] make this configurable or auto-generated from metadata - pub type Extra = ::subxt::DefaultExtra<::subxt::DefaultConfig>; - - impl ::subxt::AccountData<::subxt::DefaultConfig> for AccountData { - fn nonce(result: &::Value) -> <::subxt::DefaultConfig as ::subxt::Config>::Index { + impl ::subxt::AccountData for AccountData { + fn nonce(result: &::Value) -> ::Index { result.nonce } - fn storage_entry(account_id: <::subxt::DefaultConfig as ::subxt::Config>::AccountId) -> Self { + fn storage_entry(account_id: ::AccountId) -> Self { Self(account_id) } } - #[derive(Debug)] - pub struct ExtrinsicExtra; - - impl ::subxt::ExtrinsicExtraData<::subxt::DefaultConfig> for ExtrinsicExtra { - type AccountData = AccountData; - type Extra = Extra; - } - - pub struct RuntimeApi { + pub struct RuntimeApi> { pub client: ::subxt::Client, } - impl ::core::convert::From<::subxt::Client> for RuntimeApi { + impl ::core::convert::From<::subxt::Client> for RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { fn from(client: ::subxt::Client) -> Self { Self { client } } } - impl<'a, T: ::subxt::Config> RuntimeApi { + impl<'a, T> RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { pub fn storage(&'a self) -> StorageApi<'a, T> { StorageApi { client: &self.client } } @@ -285,11 +308,17 @@ impl RuntimeGenerator { } } - pub struct StorageApi<'a, T: ::subxt::Config> { + pub struct StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + impl<'a, T> StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { #( pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { #pallets_with_storage::storage::StorageApi::new(self.client) @@ -297,11 +326,14 @@ impl RuntimeGenerator { )* } - pub struct TransactionApi<'a, T: ::subxt::Config> { + pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { client: &'a ::subxt::Client, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> { + impl<'a, T> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { #( pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T> { #pallets_with_calls::calls::TransactionApi::new(self.client) @@ -365,7 +397,6 @@ impl RuntimeGenerator { pallet: &PalletMetadata, call: &PalletCallMetadata, ) -> (Vec, Vec) { - let extra_type = quote!( super::super::ExtrinsicExtra ); let struct_defs = self.generate_structs_from_variants(type_gen, call.ty.id(), "Call"); struct_defs @@ -400,7 +431,7 @@ impl RuntimeGenerator { pub fn #fn_name( &self, #( #call_fn_args, )* - ) -> ::subxt::SubmittableExtrinsic { + ) -> ::subxt::SubmittableExtrinsic { let call = #call_struct_name { #( #call_args, )* }; ::subxt::SubmittableExtrinsic::new(self.client, call) } diff --git a/src/client.rs b/src/client.rs index c9f6bba04b..8741ef9980 100644 --- a/src/client.rs +++ b/src/client.rs @@ -17,7 +17,6 @@ use futures::future; pub use sp_runtime::traits::SignedExtension; pub use sp_version::RuntimeVersion; -use std::marker::PhantomData; use crate::{ events::EventsDecoder, @@ -188,21 +187,19 @@ impl Client { } /// A constructed call ready to be signed and submitted. -pub struct SubmittableExtrinsic<'a, T: Config, E, C> { +pub struct SubmittableExtrinsic<'a, T: Config, C> { client: &'a Client, call: C, - marker: PhantomData E> } -impl<'a, T, E, C> SubmittableExtrinsic<'a, T, E, C> +impl<'a, T, C> SubmittableExtrinsic<'a, T, C> where - T: Config, - E: ExtrinsicExtraData, + T: Config + ExtrinsicExtraData, C: Call + Send + Sync, { /// Create a new [`SubmittableExtrinsic`]. pub fn new(client: &'a Client, call: C) -> Self { - Self { client, call, marker: PhantomData } + Self { client, call } } /// Creates and signs an extrinsic and submits to the chain. @@ -211,11 +208,10 @@ where /// events which were triggered by the extrinsic. pub async fn sign_and_submit_then_watch( self, - signer: &(dyn Signer + Send + Sync), + signer: &(dyn Signer + Send + Sync), ) -> Result, Error> where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, + <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static { let extrinsic = self.create_signed(signer).await?; self.client @@ -234,11 +230,10 @@ where /// and has been included in the transaction pool. pub async fn sign_and_submit( self, - signer: &(dyn Signer + Send + Sync), + signer: &(dyn Signer + Send + Sync), ) -> Result where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, + <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static { let extrinsic = self.create_signed(signer).await?; self.client.rpc().submit_extrinsic(extrinsic).await @@ -247,23 +242,22 @@ where /// Creates a signed extrinsic. pub async fn create_signed( &self, - signer: &(dyn Signer + Send + Sync), - ) -> Result, Error> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync, + signer: &(dyn Signer + Send + Sync), + ) -> Result, Error> + where + <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static { let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { let account_storage_entry = - >::storage_entry(signer.account_id().clone()); + <>::AccountData as AccountData>::storage_entry(signer.account_id().clone()); let account_data = self .client .storage() .fetch_or_default(&account_storage_entry, None) .await?; - >::nonce(&account_data) + <>::AccountData as AccountData>::nonce(&account_data) }; let call = self .client diff --git a/src/config.rs b/src/config.rs index 394e14ca55..a1d166bfa5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -103,19 +103,3 @@ pub trait ExtrinsicExtraData { /// The type of extra data and additional signed data to be included in a transaction. type Extra: SignedExtra + Send + Sync + 'static; } - -/// Default configuration of common types for a target Substrate runtime. -#[derive(Clone, Debug, Default, Eq, PartialEq)] -pub struct DefaultConfig; - -impl Config for DefaultConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = sp_runtime::traits::BlakeTwo256; - type AccountId = sp_runtime::AccountId32; - type Address = sp_runtime::MultiAddress; - type Header = sp_runtime::generic::Header; - type Signature = sp_runtime::MultiSignature; - type Extrinsic = sp_runtime::OpaqueExtrinsic; -} diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index a6cba9217d..a5959f2993 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -48,34 +48,33 @@ use crate::{ }; /// UncheckedExtrinsic type. -pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< +pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< ::Address, Encoded, ::Signature, - <>::Extra as SignedExtra>::Extra, + <>::Extra as SignedExtra>::Extra, >; /// SignedPayload type. -pub type SignedPayload = sp_runtime::generic::SignedPayload>::Extra as SignedExtra>::Extra>; +pub type SignedPayload = sp_runtime::generic::SignedPayload>::Extra as SignedExtra>::Extra>; /// Creates a signed extrinsic -pub async fn create_signed( +pub async fn create_signed( runtime_version: &RuntimeVersion, genesis_hash: T::Hash, nonce: T::Index, call: Encoded, - signer: &(dyn Signer + Send + Sync), -) -> Result, Error> + signer: &(dyn Signer + Send + Sync), +) -> Result, Error> where - T: Config, - E: ExtrinsicExtraData, - <>::Extra as SignedExtension>::AdditionalSigned: + T: Config + ExtrinsicExtraData, + <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync, { let spec_version = runtime_version.spec_version; let tx_version = runtime_version.transaction_version; - let extra: E::Extra = E::Extra::new(spec_version, tx_version, nonce, genesis_hash); - let payload = SignedPayload::::new(call, extra.extra())?; + let extra = >::Extra::new(spec_version, tx_version, nonce, genesis_hash); + let payload = SignedPayload::::new(call, extra.extra())?; let signed = signer.sign(payload).await?; Ok(signed) } diff --git a/src/extrinsic/signer.rs b/src/extrinsic/signer.rs index 4b9a4c731e..36c42e01a5 100644 --- a/src/extrinsic/signer.rs +++ b/src/extrinsic/signer.rs @@ -27,7 +27,6 @@ use crate::{ SignedExtra, }; use codec::Encode; -use core::marker::PhantomData; use sp_core::Pair; use sp_runtime::traits::{ IdentifyAccount, @@ -37,7 +36,7 @@ use sp_runtime::traits::{ /// Extrinsic signer. #[async_trait::async_trait] -pub trait Signer> { +pub trait Signer> { /// Returns the account id. fn account_id(&self) -> &T::AccountId; @@ -50,23 +49,21 @@ pub trait Signer> { /// refused the operation. async fn sign( &self, - extrinsic: SignedPayload, - ) -> Result, String>; + extrinsic: SignedPayload, + ) -> Result, String>; } /// Extrinsic signer using a private key. #[derive(Clone, Debug)] -pub struct PairSigner { +pub struct PairSigner { account_id: T::AccountId, nonce: Option, signer: P, - marker: PhantomData E>, } -impl PairSigner +impl PairSigner where - T: Config, - E: ExtrinsicExtraData, + T: Config + ExtrinsicExtraData, T::Signature: From, ::Signer: From + IdentifyAccount, @@ -80,7 +77,6 @@ where account_id, nonce: None, signer, - marker: PhantomData, } } @@ -101,12 +97,11 @@ where } #[async_trait::async_trait] -impl Signer for PairSigner +impl Signer for PairSigner where - T: Config, - E: ExtrinsicExtraData, + T: Config + ExtrinsicExtraData, T::AccountId: Into + 'static, - <>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static, + <<>::Extra as SignedExtra>::Extra as SignedExtension>::AdditionalSigned: Send + Sync + 'static, P: Pair + 'static, P::Signature: Into + 'static, { @@ -120,11 +115,11 @@ where async fn sign( &self, - extrinsic: SignedPayload, - ) -> Result, String> { + extrinsic: SignedPayload, + ) -> Result, String> { let signature = extrinsic.using_encoded(|payload| self.signer.sign(payload)); let (call, extra, _) = extrinsic.deconstruct(); - let extrinsic = UncheckedExtrinsic::::new_signed( + let extrinsic = UncheckedExtrinsic::::new_signed( call, self.account_id.clone().into(), signature.into(), diff --git a/src/lib.rs b/src/lib.rs index 4fabede598..d64598b454 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,7 +64,6 @@ mod subscription; pub use crate::{ config::{ Config, - DefaultConfig, AccountData, ExtrinsicExtraData, }, diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index 33adbb40b5..bf640d1e20 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -16,6 +16,7 @@ use crate::{ node_runtime::{ + DefaultConfig, balances, runtime_types, system, @@ -33,7 +34,6 @@ use subxt::{ PairSigner, Signer, }, - DefaultConfig, Error, EventSubscription, PalletError, diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index 2a54065260..553dc0aa44 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -18,7 +18,7 @@ use sp_keyring::AccountKeyring; use crate::{ node_runtime::{ - ExtrinsicExtra, + DefaultConfig, contracts::{ calls::TransactionApi, events, @@ -33,7 +33,6 @@ use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; use subxt::{ Client, - DefaultConfig, Error, ExtrinsicSuccess, PairSigner, @@ -43,7 +42,7 @@ use subxt::{ struct ContractsTestContext { cxt: TestContext, - signer: PairSigner, + signer: PairSigner, } type Hash = ::Hash; diff --git a/tests/integration/frame/staking.rs b/tests/integration/frame/staking.rs index 7efc7a45bb..5d21032cd1 100644 --- a/tests/integration/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -16,6 +16,7 @@ use crate::{ node_runtime::{ + DefaultConfig, runtime_types::pallet_staking::{ RewardDestination, ValidatorPrefs, @@ -35,7 +36,6 @@ use subxt::{ PairSigner, Signer, }, - DefaultConfig, Error, ExtrinsicSuccess, RuntimeError, diff --git a/tests/integration/frame/sudo.rs b/tests/integration/frame/sudo.rs index 1e0823cac0..c84f7114b6 100644 --- a/tests/integration/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -16,6 +16,7 @@ use crate::{ node_runtime::{ + DefaultConfig, runtime_types, sudo, }, @@ -23,10 +24,7 @@ use crate::{ }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::{ - DefaultConfig, - extrinsic::PairSigner -}; +use subxt::extrinsic::PairSigner; // todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call type Call = runtime_types::node_runtime::Call; diff --git a/tests/integration/frame/system.rs b/tests/integration/frame/system.rs index fee597c8d2..e8058d1529 100644 --- a/tests/integration/frame/system.rs +++ b/tests/integration/frame/system.rs @@ -15,13 +15,15 @@ // along with subxt. If not, see . use crate::{ - node_runtime::system, + node_runtime::{ + DefaultConfig, + system, + }, test_context, - DefaultConfig, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::{ +use subxt::{ PairSigner, Signer, }; diff --git a/tests/integration/utils/context.rs b/tests/integration/utils/context.rs index e9ab13ca9e..d3be2277b4 100644 --- a/tests/integration/utils/context.rs +++ b/tests/integration/utils/context.rs @@ -15,12 +15,12 @@ // along with subxt. If not, see . pub use crate::{ - node_runtime, + node_runtime::{self, DefaultConfig}, TestNodeProcess, }; use sp_keyring::AccountKeyring; -use subxt::{Client, DefaultConfig}; +use subxt::Client; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; From 518c02818423321437b94918a74aea50cbd31dfa Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 15 Oct 2021 15:30:43 +0100 Subject: [PATCH 149/216] Extract type substitute parsing to ir mod --- codegen/src/api.rs | 71 ++------------------- codegen/src/ir.rs | 149 +++++++++++++++++++++++++++++++++++++++++++++ codegen/src/lib.rs | 1 + 3 files changed, 154 insertions(+), 67 deletions(-) create mode 100644 codegen/src/ir.rs diff --git a/codegen/src/api.rs b/codegen/src/api.rs index 818d2f08f7..199fc741a7 100644 --- a/codegen/src/api.rs +++ b/codegen/src/api.rs @@ -15,11 +15,11 @@ // along with subxt. If not, see . use crate::{ + ir, struct_def::StructDef, types::TypeGenerator, }; use codec::Decode; -use darling::FromMeta; use frame_metadata::{ v14::RuntimeMetadataV14, PalletCallMetadata, @@ -35,7 +35,6 @@ use frame_metadata::{ use heck::SnakeCase as _; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::{ - abort, abort_call_site, }; use quote::{ @@ -48,12 +47,10 @@ use scale_info::{ TypeDef, }; use std::{ - collections::HashMap, fs, io::Read, path, }; -use syn::spanned::Spanned as _; pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 where @@ -74,20 +71,6 @@ where generator.generate_runtime(item_mod) } -#[derive(Debug, FromMeta)] -#[darling(rename_all = "snake_case")] -enum Subxt { - SubstituteType(String), -} - -impl Subxt { - fn substitute_type(&self) -> String { - match self { - Self::SubstituteType(path) => path.clone(), - } - } -} - pub struct RuntimeGenerator { metadata: RuntimeMetadataV14, } @@ -101,7 +84,8 @@ impl RuntimeGenerator { } pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { - let type_substitutes = Self::parse_type_substitutes(&item_mod); + let item_mod_ir = ir::ItemMod::from(item_mod); + let type_substitutes = item_mod_ir.type_substitutes(); let type_gen = TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); let types_mod = type_gen.generate_types_mod(); @@ -224,7 +208,7 @@ impl RuntimeGenerator { }; // todo: [AJ] keep all other code items from decorated mod? - let mod_ident = item_mod.ident; + let mod_ident = item_mod_ir.ident; let pallets_with_storage = pallets_with_mod_names .iter() @@ -344,53 +328,6 @@ impl RuntimeGenerator { } } - fn parse_type_substitutes(item_mod: &syn::ItemMod) -> HashMap { - if let Some(ref content) = item_mod.content { - content - .1 - .iter() - .filter_map(|item| { - if let syn::Item::Use(use_) = item { - let substitute_attrs = use_ - .attrs - .iter() - .map(|attr| { - let meta = attr.parse_meta().unwrap_or_else(|e| { - abort!(attr.span(), "Error parsing attribute: {}", e) - }); - let substitute_type_args = Subxt::from_meta(&meta) - .unwrap_or_else(|e| { - abort!( - attr.span(), - "Error parsing attribute meta: {}", - e - ) - }); - substitute_type_args - }) - .collect::>(); - if substitute_attrs.len() > 1 { - abort!( - use_.attrs[0].span(), - "Duplicate `substitute_type` attributes" - ) - } - substitute_attrs.iter().next().map(|attr| { - let substitute_type = attr.substitute_type(); - let use_path = &use_.tree; - let use_type_path = syn::parse_quote!( #use_path ); - (substitute_type.to_string(), use_type_path) - }) - } else { - None - } - }) - .collect() - } else { - HashMap::new() - } - } - fn generate_calls( &self, type_gen: &TypeGenerator, diff --git a/codegen/src/ir.rs b/codegen/src/ir.rs new file mode 100644 index 0000000000..57a61414e2 --- /dev/null +++ b/codegen/src/ir.rs @@ -0,0 +1,149 @@ +// Copyright 2019-2021 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 std::{ + collections::HashMap, +}; +use syn::{ + token, + spanned::Spanned as _, +}; +use proc_macro_error::abort; + +// todo: [AJ] implement ToTokens for this to generate the actual mod +// todo: [AJ] figure out how to incorporate the types and api codegen here... +#[derive(Debug, PartialEq, Eq)] +pub struct ItemMod { + // attrs: Vec, // todo: [AJ] partition attributes between subxt and non-subxt + vis: syn::Visibility, + mod_token: token::Mod, + pub ident: syn::Ident, + brace: token::Brace, + items: Vec, +} + +impl From for ItemMod { + fn from(module: syn::ItemMod) -> Self { + let (brace, items) = match module.content { + Some((brace, items)) => (brace, items), + None => { + abort!( + module, + "out-of-line subxt modules are not supported", + ) + } + }; + let items = items + .into_iter() + .map(>::from) + .collect::>(); + Self { + vis: module.vis, + mod_token: module.mod_token, + ident: module.ident, + brace, + items, + } + } +} + +impl ItemMod { + pub fn type_substitutes(&self) -> HashMap { + self.items.iter().filter_map(|item| + if let Item::Subxt(SubxtItem::TypeSubstitute { generated_type_path, substitute_with: substitute_type }) = item { + Some((generated_type_path.clone(), substitute_type.clone())) + } else { + None + } + ).collect() + } +} + +#[derive(Debug, PartialEq, Eq)] +pub enum Item { + Rust(syn::Item), + Subxt(SubxtItem), +} + +impl From for Item { + fn from(item: syn::Item) -> Self { + if let syn::Item::Use(ref use_) = item { + let substitute_attrs = use_ + .attrs + .iter() + .map(|attr| { + let meta = attr.parse_meta().unwrap_or_else(|e| { + abort!(attr.span(), "Error parsing attribute: {}", e) + }); + let substitute_type_args = ::from_meta(&meta) + .unwrap_or_else(|e| { + abort!( + attr.span(), + "Error parsing attribute meta: {}", + e + ) + }); + substitute_type_args + }) + .collect::>(); + if substitute_attrs.len() > 1 { + abort!( + use_.attrs[0].span(), + "Duplicate `substitute_type` attributes" + ) + } + if let Some(attr) = substitute_attrs.iter().next() { + let use_path = &use_.tree; + let substitute_with: syn::TypePath = syn::parse_quote!( #use_path ); + let type_substitute = SubxtItem::TypeSubstitute { + generated_type_path: attr.substitute_type().to_string(), + substitute_with + }; + Self::Subxt(type_substitute) + } else { + Self::Rust(item) + } + } else { + Self::Rust(item) + } + } +} + +#[derive(Debug, PartialEq, Eq)] +pub enum SubxtItem { + TypeSubstitute { + generated_type_path: String, + substitute_with: syn::TypePath, + } +} + +mod attrs { + use darling::FromMeta; + + #[derive(Debug, FromMeta)] + #[darling(rename_all = "snake_case")] + pub enum Subxt { + SubstituteType(String), + } + + impl Subxt { + pub fn substitute_type(&self) -> String { + match self { + Self::SubstituteType(path) => path.clone(), + } + } + } +} \ No newline at end of file diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index a11f18ec9e..90d08420a5 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -17,6 +17,7 @@ //! Library to generate an API for a Substrate runtime from its metadata. mod api; +mod ir; mod struct_def; mod types; From 699ce1891512ae697ac29cbf162775586535b355 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 11:30:44 +0100 Subject: [PATCH 150/216] Extract calls, events and storage from api generation --- codegen/src/api.rs | 583 ------------------------------------- codegen/src/api/calls.rs | 104 +++++++ codegen/src/api/events.rs | 62 ++++ codegen/src/api/mod.rs | 298 +++++++++++++++++++ codegen/src/api/storage.rs | 207 +++++++++++++ codegen/src/types.rs | 21 +- 6 files changed, 683 insertions(+), 592 deletions(-) delete mode 100644 codegen/src/api.rs create mode 100644 codegen/src/api/calls.rs create mode 100644 codegen/src/api/events.rs create mode 100644 codegen/src/api/mod.rs create mode 100644 codegen/src/api/storage.rs diff --git a/codegen/src/api.rs b/codegen/src/api.rs deleted file mode 100644 index 199fc741a7..0000000000 --- a/codegen/src/api.rs +++ /dev/null @@ -1,583 +0,0 @@ -// Copyright 2019-2021 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::{ - ir, - struct_def::StructDef, - types::TypeGenerator, -}; -use codec::Decode; -use frame_metadata::{ - v14::RuntimeMetadataV14, - PalletCallMetadata, - PalletEventMetadata, - PalletMetadata, - RuntimeMetadata, - RuntimeMetadataPrefixed, - StorageEntryMetadata, - StorageEntryModifier, - StorageEntryType, - StorageHasher, -}; -use heck::SnakeCase as _; -use proc_macro2::TokenStream as TokenStream2; -use proc_macro_error::{ - abort_call_site, -}; -use quote::{ - format_ident, - quote, -}; -use scale_info::{ - form::PortableForm, - prelude::string::ToString, - TypeDef, -}; -use std::{ - fs, - io::Read, - path, -}; - -pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 -where - P: AsRef, -{ - let mut file = fs::File::open(&path).unwrap_or_else(|e| { - abort_call_site!("Failed to open {}: {}", path.as_ref().to_string_lossy(), e) - }); - - let mut bytes = Vec::new(); - file.read_to_end(&mut bytes) - .unwrap_or_else(|e| abort_call_site!("Failed to read metadata file: {}", e)); - - let metadata = frame_metadata::RuntimeMetadataPrefixed::decode(&mut &bytes[..]) - .unwrap_or_else(|e| abort_call_site!("Failed to decode metadata: {}", e)); - - let generator = RuntimeGenerator::new(metadata); - generator.generate_runtime(item_mod) -} - -pub struct RuntimeGenerator { - metadata: RuntimeMetadataV14, -} - -impl RuntimeGenerator { - pub fn new(metadata: RuntimeMetadataPrefixed) -> Self { - match metadata.1 { - RuntimeMetadata::V14(v14) => Self { metadata: v14 }, - _ => panic!("Unsupported metadata version {:?}", metadata.1), - } - } - - pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { - let item_mod_ir = ir::ItemMod::from(item_mod); - let type_substitutes = item_mod_ir.type_substitutes(); - let type_gen = - TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); - let types_mod = type_gen.generate_types_mod(); - let types_mod_ident = types_mod.ident(); - let pallets_with_mod_names = self - .metadata - .pallets - .iter() - .map(|pallet| { - ( - pallet, - format_ident!("{}", pallet.name.to_string().to_snake_case()), - ) - }) - .collect::>(); - let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { - let calls = if let Some(ref calls) = pallet.calls { - let (call_structs, call_fns) = - self.generate_calls(&type_gen, pallet, calls); - quote! { - pub mod calls { - use super::#types_mod_ident; - #( #call_structs )* - - pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { - client: &'a ::subxt::Client, - } - - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - - #( #call_fns )* - } - } - } - } else { - quote!() - }; - - let event = if let Some(ref event) = pallet.event { - let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); - let event_structs = self.generate_event_structs(&type_gen, pallet, event); - quote! { - pub type Event = #event_type; - pub mod events { - use super::#types_mod_ident; - #( #event_structs )* - } - } - } else { - quote!() - }; - - let (storage_structs, storage_fns) = if let Some(ref storage) = pallet.storage - { - let (storage_structs, storage_fns) = storage - .entries - .iter() - .map(|entry| { - self.generate_storage_entry_fns(&type_gen, &pallet, entry) - }) - .unzip(); - (storage_structs, storage_fns) - } else { - (Vec::new(), Vec::new()) - }; - - let storage_mod = quote! { - pub mod storage { - use super::#types_mod_ident; - #( #storage_structs )* - - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - - #( #storage_fns )* - } - } - }; - - quote! { - pub mod #mod_name { - use super::#types_mod_ident; - #calls - #event - #storage_mod - } - } - }); - - let outer_event_variants = self.metadata.pallets.iter().filter_map(|p| { - let variant_name = format_ident!("{}", p.name); - let mod_name = format_ident!("{}", p.name.to_string().to_snake_case()); - let index = proc_macro2::Literal::u8_unsuffixed(p.index); - - p.event.as_ref().map(|_| { - quote! { - #[codec(index = #index)] - #variant_name(#mod_name::Event), - } - }) - }); - - let outer_event = quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] - pub enum Event { - #( #outer_event_variants )* - } - }; - - // todo: [AJ] keep all other code items from decorated mod? - let mod_ident = item_mod_ir.ident; - let pallets_with_storage = - pallets_with_mod_names - .iter() - .filter_map(|(pallet, pallet_mod_name)| { - pallet.storage.as_ref().map(|_| pallet_mod_name) - }); - let pallets_with_calls = - pallets_with_mod_names - .iter() - .filter_map(|(pallet, pallet_mod_name)| { - pallet.calls.as_ref().map(|_| pallet_mod_name) - }); - - quote! { - #[allow(dead_code, unused_imports, non_camel_case_types)] - pub mod #mod_ident { - #outer_event - #( #modules )* - #types_mod - - /// Default configuration of common types for a target Substrate runtime. - // todo: allow to define/override this as part of the annotated mod - #[derive(Clone, Debug, Default, Eq, PartialEq)] - pub struct DefaultConfig; - - impl ::subxt::Config for DefaultConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = ::subxt::sp_core::H256; - type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; - type AccountId = ::subxt::sp_runtime::AccountId32; - type Address = ::subxt::sp_runtime::MultiAddress; - type Header = ::subxt::sp_runtime::generic::Header< - Self::BlockNumber, ::subxt::sp_runtime::traits::BlakeTwo256 - >; - type Signature = ::subxt::sp_runtime::MultiSignature; - type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; - } - - impl ::subxt::ExtrinsicExtraData for DefaultConfig { - type AccountData = AccountData; - // todo: [AJ] make this configurable or auto-generated from metadata - type Extra = ::subxt::DefaultExtra; - } - - // todo: [AJ] check for this type's existence or allow config - pub type AccountData = self::system::storage::Account; - - impl ::subxt::AccountData for AccountData { - fn nonce(result: &::Value) -> ::Index { - result.nonce - } - fn storage_entry(account_id: ::AccountId) -> Self { - Self(account_id) - } - } - - pub struct RuntimeApi> { - pub client: ::subxt::Client, - } - - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - fn from(client: ::subxt::Client) -> Self { - Self { client } - } - } - - impl<'a, T> RuntimeApi - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { client: &self.client } - } - - pub fn tx(&'a self) -> TransactionApi<'a, T> { - TransactionApi { client: &self.client } - } - } - - pub struct StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - client: &'a ::subxt::Client, - } - - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - #( - pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { - #pallets_with_storage::storage::StorageApi::new(self.client) - } - )* - } - - pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { - client: &'a ::subxt::Client, - } - - impl<'a, T> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - #( - pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T> { - #pallets_with_calls::calls::TransactionApi::new(self.client) - } - )* - } - } - } - } - - fn generate_calls( - &self, - type_gen: &TypeGenerator, - pallet: &PalletMetadata, - call: &PalletCallMetadata, - ) -> (Vec, Vec) { - let struct_defs = - self.generate_structs_from_variants(type_gen, call.ty.id(), "Call"); - struct_defs - .iter() - .map(|struct_def| { - let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def - .named_fields() - .unwrap_or_else(|| { - abort_call_site!( - "Call variant for type {} must have all named fields", - call.ty.id() - ) - }) - .iter() - .map(|(name, ty)| (quote!( #name: #ty ), name)) - .unzip(); - - let pallet_name = &pallet.name; - let call_struct_name = &struct_def.name; - let function_name = struct_def.name.to_string().to_snake_case(); - let fn_name = format_ident!("{}", function_name); - - let call_struct = quote! { - #struct_def - - impl ::subxt::Call for #call_struct_name { - const PALLET: &'static str = #pallet_name; - const FUNCTION: &'static str = #function_name; - } - }; - let client_fn = quote! { - pub fn #fn_name( - &self, - #( #call_fn_args, )* - ) -> ::subxt::SubmittableExtrinsic { - let call = #call_struct_name { #( #call_args, )* }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - }; - (call_struct, client_fn) - }) - .unzip() - } - - fn generate_event_structs( - &self, - type_gen: &TypeGenerator, - pallet: &PalletMetadata, - event: &PalletEventMetadata, - ) -> Vec { - let struct_defs = - self.generate_structs_from_variants(type_gen, event.ty.id(), "Event"); - struct_defs - .iter() - .map(|struct_def| { - let pallet_name = &pallet.name; - let event_struct = &struct_def.name; - let event_name = struct_def.name.to_string(); - - let event_struct = quote! { - #struct_def - - impl ::subxt::Event for #event_struct { - const PALLET: &'static str = #pallet_name; - const EVENT: &'static str = #event_name; - } - }; - event_struct - }) - .collect() - } - - fn generate_structs_from_variants( - &self, - type_gen: &TypeGenerator, - type_id: u32, - error_message_type_name: &str, - ) -> Vec { - let ty = self.metadata.types.resolve(type_id).unwrap_or_else(|| { - abort_call_site!("Failed to resolve {} type", error_message_type_name) - }); - if let scale_info::TypeDef::Variant(variant) = ty.type_def() { - variant - .variants() - .iter() - .map(|var| { - StructDef::new( - var.name(), - var.fields(), - Some(syn::parse_quote!(pub)), - type_gen, - ) - }) - .collect() - } else { - abort_call_site!( - "{} type should be an variant/enum type", - error_message_type_name - ) - } - } - - fn generate_storage_entry_fns( - &self, - type_gen: &TypeGenerator, - pallet: &PalletMetadata, - storage_entry: &StorageEntryMetadata, - ) -> (TokenStream2, TokenStream2) { - let entry_struct_ident = format_ident!("{}", storage_entry.name); - let (fields, entry_struct, constructor, key_impl) = match storage_entry.ty { - StorageEntryType::Plain(_) => { - let entry_struct = quote!( pub struct #entry_struct_ident; ); - let constructor = quote!( #entry_struct_ident ); - let key_impl = quote!(::subxt::StorageEntryKey::Plain); - (vec![], entry_struct, constructor, key_impl) - } - StorageEntryType::Map { - ref key, - ref hashers, - .. - } => { - let key_ty = self.metadata.types.resolve(key.id()).unwrap_or_else(|| { - abort_call_site!("Failed to resolve storage key type") - }); - let hashers = hashers - .iter() - .map(|hasher| { - let hasher = match hasher { - StorageHasher::Blake2_128 => "Blake2_128", - StorageHasher::Blake2_256 => "Blake2_256", - StorageHasher::Blake2_128Concat => "Blake2_128Concat", - StorageHasher::Twox128 => "Twox128", - StorageHasher::Twox256 => "Twox256", - StorageHasher::Twox64Concat => "Twox64Concat", - StorageHasher::Identity => "Identity", - }; - let hasher = format_ident!("{}", hasher); - quote!( ::subxt::StorageHasher::#hasher ) - }) - .collect::>(); - match key_ty.type_def() { - TypeDef::Tuple(tuple) => { - let fields = tuple - .fields() - .iter() - .enumerate() - .map(|(i, f)| { - let field_name = - format_ident!("_{}", syn::Index::from(i)); - let field_type = type_gen.resolve_type_path(f.id(), &[]); - (field_name, field_type) - }) - .collect::>(); - // toddo: [AJ] use unzip here? - let tuple_struct_fields = - fields.iter().map(|(_, field_type)| field_type); - let field_names = fields.iter().map(|(field_name, _)| field_name); - let entry_struct = quote! { - pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); - }; - let constructor = - quote!( #entry_struct_ident( #( #field_names ),* ) ); - let keys = (0..tuple.fields().len()) - .into_iter() - .zip(hashers) - .map(|(field, hasher)| { - let index = syn::Index::from(field); - quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) - }); - let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ #( #keys ),* ] - ) - }; - (fields, entry_struct, constructor, key_impl) - } - _ => { - let ty_path = type_gen.resolve_type_path(key.id(), &[]); - let fields = vec![(format_ident!("_0"), ty_path.clone())]; - let entry_struct = quote! { - pub struct #entry_struct_ident( pub #ty_path ); - }; - let constructor = quote!( #entry_struct_ident(_0) ); - let hasher = hashers.get(0).unwrap_or_else(|| { - abort_call_site!("No hasher found for single key") - }); - let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] - ) - }; - (fields, entry_struct, constructor, key_impl) - } - } - } - }; - let pallet_name = &pallet.name; - let storage_name = &storage_entry.name; - let fn_name = format_ident!("{}", storage_entry.name.to_snake_case()); - let storage_entry_ty = match storage_entry.ty { - StorageEntryType::Plain(ref ty) => ty, - StorageEntryType::Map { ref value, .. } => value, - }; - let storage_entry_value_ty = - type_gen.resolve_type_path(storage_entry_ty.id(), &[]); - let (return_ty, fetch) = match storage_entry.modifier { - StorageEntryModifier::Default => { - (quote!( #storage_entry_value_ty ), quote!(fetch_or_default)) - } - StorageEntryModifier::Optional => { - ( - quote!( ::core::option::Option<#storage_entry_value_ty> ), - quote!(fetch), - ) - } - }; - - let storage_entry_type = quote! { - #entry_struct - - impl ::subxt::StorageEntry for #entry_struct_ident { - const PALLET: &'static str = #pallet_name; - const STORAGE: &'static str = #storage_name; - type Value = #storage_entry_value_ty; - fn key(&self) -> ::subxt::StorageEntryKey { - #key_impl - } - } - }; - - let key_args = fields - .iter() - .map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? - let client_fn = quote! { - pub async fn #fn_name( - &self, - #( #key_args, )* - hash: ::core::option::Option, - ) -> ::core::result::Result<#return_ty, ::subxt::Error> { - let entry = #constructor; - self.client.storage().#fetch(&entry, hash).await - } - }; - - (storage_entry_type, client_fn) - } -} diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs new file mode 100644 index 0000000000..b99ef3a6eb --- /dev/null +++ b/codegen/src/api/calls.rs @@ -0,0 +1,104 @@ +// Copyright 2019-2021 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::{ + types::TypeGenerator, +}; +use frame_metadata::{ + PalletCallMetadata, + PalletMetadata +}; +use heck::SnakeCase as _; +use proc_macro2::TokenStream as TokenStream2; +use proc_macro_error::abort_call_site; +use quote::{ + format_ident, + quote, +}; +use scale_info::form::PortableForm; + +pub fn generate_calls( + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + call: &PalletCallMetadata, + types_mod_ident: &syn::Ident, +) -> TokenStream2 { + let struct_defs = + super::generate_structs_from_variants(type_gen, call.ty.id(), "Call"); + let (call_structs, call_fns): (Vec<_>, Vec<_>) = + struct_defs + .iter() + .map(|struct_def| { + let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def + .named_fields() + .unwrap_or_else(|| { + abort_call_site!( + "Call variant for type {} must have all named fields", + call.ty.id() + ) + }) + .iter() + .map(|(name, ty)| (quote!( #name: #ty ), name)) + .unzip(); + + let pallet_name = &pallet.name; + let call_struct_name = &struct_def.name; + let function_name = struct_def.name.to_string().to_snake_case(); + let fn_name = format_ident!("{}", function_name); + + let call_struct = quote! { + #struct_def + + impl ::subxt::Call for #call_struct_name { + const PALLET: &'static str = #pallet_name; + const FUNCTION: &'static str = #function_name; + } + }; + let client_fn = quote! { + pub fn #fn_name( + &self, + #( #call_fn_args, )* + ) -> ::subxt::SubmittableExtrinsic { + let call = #call_struct_name { #( #call_args, )* }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + }; + (call_struct, client_fn) + }) + .unzip(); + + quote! { + pub mod calls { + use super::#types_mod_ident; + #( #call_structs )* + + pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { + client: &'a ::subxt::Client, + } + + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + + #( #call_fns )* + } + } + } +} diff --git a/codegen/src/api/events.rs b/codegen/src/api/events.rs new file mode 100644 index 0000000000..78bb52bb53 --- /dev/null +++ b/codegen/src/api/events.rs @@ -0,0 +1,62 @@ +// Copyright 2019-2021 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::{ + types::TypeGenerator, +}; +use frame_metadata::{ + PalletEventMetadata, + PalletMetadata +}; +use proc_macro2::TokenStream as TokenStream2; +use quote::quote; +use scale_info::form::PortableForm; + +pub fn generate_events( + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + event: &PalletEventMetadata, + types_mod_ident: &syn::Ident, +) -> TokenStream2 { + let struct_defs = + super::generate_structs_from_variants(type_gen, event.ty.id(), "Event"); + let event_structs = + struct_defs + .iter() + .map(|struct_def| { + let pallet_name = &pallet.name; + let event_struct = &struct_def.name; + let event_name = struct_def.name.to_string(); + + quote! { + #struct_def + + impl ::subxt::Event for #event_struct { + const PALLET: &'static str = #pallet_name; + const EVENT: &'static str = #event_name; + } + } + }); + let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); + + quote! { + pub type Event = #event_type; + pub mod events { + use super::#types_mod_ident; + #( #event_structs )* + } + } +} \ No newline at end of file diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs new file mode 100644 index 0000000000..c0ce53ff4f --- /dev/null +++ b/codegen/src/api/mod.rs @@ -0,0 +1,298 @@ +// Copyright 2019-2021 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 calls; +mod events; +mod storage; + +use crate::{ + ir, + struct_def::StructDef, + types::TypeGenerator, +}; +use codec::Decode; +use frame_metadata::{ + v14::RuntimeMetadataV14, + RuntimeMetadata, + RuntimeMetadataPrefixed, +}; +use heck::SnakeCase as _; +use proc_macro2::TokenStream as TokenStream2; +use proc_macro_error::{ + abort_call_site, +}; +use quote::{ + format_ident, + quote, +}; +use std::{ + fs, + io::Read, + path, + string::ToString, +}; + +pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 +where + P: AsRef, +{ + let mut file = fs::File::open(&path).unwrap_or_else(|e| { + abort_call_site!("Failed to open {}: {}", path.as_ref().to_string_lossy(), e) + }); + + let mut bytes = Vec::new(); + file.read_to_end(&mut bytes) + .unwrap_or_else(|e| abort_call_site!("Failed to read metadata file: {}", e)); + + let metadata = frame_metadata::RuntimeMetadataPrefixed::decode(&mut &bytes[..]) + .unwrap_or_else(|e| abort_call_site!("Failed to decode metadata: {}", e)); + + let generator = RuntimeGenerator::new(metadata); + generator.generate_runtime(item_mod) +} + +pub struct RuntimeGenerator { + metadata: RuntimeMetadataV14, +} + +impl RuntimeGenerator { + pub fn new(metadata: RuntimeMetadataPrefixed) -> Self { + match metadata.1 { + RuntimeMetadata::V14(v14) => Self { metadata: v14 }, + _ => panic!("Unsupported metadata version {:?}", metadata.1), + } + } + + pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { + let item_mod_ir = ir::ItemMod::from(item_mod); + let type_substitutes = item_mod_ir.type_substitutes(); + // todo: [AJ] add hardcoded type subs as per test runtime... + let type_gen = + TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); + let types_mod = type_gen.generate_types_mod(); + let types_mod_ident = types_mod.ident(); + let pallets_with_mod_names = self + .metadata + .pallets + .iter() + .map(|pallet| { + ( + pallet, + format_ident!("{}", pallet.name.to_string().to_snake_case()), + ) + }) + .collect::>(); + let modules = pallets_with_mod_names.iter().map(|(pallet, mod_name)| { + let calls = if let Some(ref calls) = pallet.calls { + calls::generate_calls(&type_gen, pallet, calls, types_mod_ident) + } else { + quote!() + }; + + let event = if let Some(ref event) = pallet.event { + events::generate_events(&type_gen, pallet, event, types_mod_ident) + } else { + quote!() + }; + + let storage_mod = if let Some(ref storage) = pallet.storage { + storage::generate_storage(&type_gen, pallet, storage, types_mod_ident) + } else { + quote!() + }; + + quote! { + pub mod #mod_name { + use super::#types_mod_ident; + #calls + #event + #storage_mod + } + } + }); + + let outer_event_variants = self.metadata.pallets.iter().filter_map(|p| { + let variant_name = format_ident!("{}", p.name); + let mod_name = format_ident!("{}", p.name.to_string().to_snake_case()); + let index = proc_macro2::Literal::u8_unsuffixed(p.index); + + p.event.as_ref().map(|_| { + quote! { + #[codec(index = #index)] + #variant_name(#mod_name::Event), + } + }) + }); + + let outer_event = quote! { + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + pub enum Event { + #( #outer_event_variants )* + } + }; + + // todo: [AJ] keep all other code items from decorated mod? + let mod_ident = item_mod_ir.ident; + let pallets_with_storage = + pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + pallet.storage.as_ref().map(|_| pallet_mod_name) + }); + let pallets_with_calls = + pallets_with_mod_names + .iter() + .filter_map(|(pallet, pallet_mod_name)| { + pallet.calls.as_ref().map(|_| pallet_mod_name) + }); + + quote! { + #[allow(dead_code, unused_imports, non_camel_case_types)] + pub mod #mod_ident { + #outer_event + #( #modules )* + #types_mod + + /// Default configuration of common types for a target Substrate runtime. + // todo: allow to define/override this as part of the annotated mod + #[derive(Clone, Debug, Default, Eq, PartialEq)] + pub struct DefaultConfig; + + impl ::subxt::Config for DefaultConfig { + type Index = u32; + type BlockNumber = u32; + type Hash = ::subxt::sp_core::H256; + type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; + type AccountId = ::subxt::sp_runtime::AccountId32; + type Address = ::subxt::sp_runtime::MultiAddress; + type Header = ::subxt::sp_runtime::generic::Header< + Self::BlockNumber, ::subxt::sp_runtime::traits::BlakeTwo256 + >; + type Signature = ::subxt::sp_runtime::MultiSignature; + type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; + } + + impl ::subxt::ExtrinsicExtraData for DefaultConfig { + type AccountData = AccountData; + // todo: [AJ] make this configurable or auto-generated from metadata + type Extra = ::subxt::DefaultExtra; + } + + // todo: [AJ] check for this type's existence or allow config + pub type AccountData = self::system::storage::Account; + + impl ::subxt::AccountData for AccountData { + fn nonce(result: &::Value) -> ::Index { + result.nonce + } + fn storage_entry(account_id: ::AccountId) -> Self { + Self(account_id) + } + } + + pub struct RuntimeApi> { + pub client: ::subxt::Client, + } + + impl ::core::convert::From<::subxt::Client> for RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + fn from(client: ::subxt::Client) -> Self { + Self { client } + } + } + + impl<'a, T> RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn storage(&'a self) -> StorageApi<'a, T> { + StorageApi { client: &self.client } + } + + pub fn tx(&'a self) -> TransactionApi<'a, T> { + TransactionApi { client: &self.client } + } + } + + pub struct StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + client: &'a ::subxt::Client, + } + + impl<'a, T> StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + #( + pub fn #pallets_with_storage(&self) -> #pallets_with_storage::storage::StorageApi<'a, T> { + #pallets_with_storage::storage::StorageApi::new(self.client) + } + )* + } + + pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { + client: &'a ::subxt::Client, + } + + impl<'a, T> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + #( + pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T> { + #pallets_with_calls::calls::TransactionApi::new(self.client) + } + )* + } + } + } + } + +} + +pub fn generate_structs_from_variants( + type_gen: &TypeGenerator, + type_id: u32, + error_message_type_name: &str, +) -> Vec { + let ty = type_gen.resolve_type(type_id); + if let scale_info::TypeDef::Variant(variant) = ty.type_def() { + variant + .variants() + .iter() + .map(|var| { + StructDef::new( + var.name(), + var.fields(), + Some(syn::parse_quote!(pub)), + type_gen, + ) + }) + .collect() + } else { + abort_call_site!( + "{} type should be an variant/enum type", + error_message_type_name + ) + } +} + + + diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs new file mode 100644 index 0000000000..e8660d4d73 --- /dev/null +++ b/codegen/src/api/storage.rs @@ -0,0 +1,207 @@ +// Copyright 2019-2021 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::{ + types::TypeGenerator, +}; +use frame_metadata::{StorageEntryMetadata, StorageEntryType, StorageEntryModifier, StorageHasher, PalletMetadata, PalletStorageMetadata}; +use heck::SnakeCase as _; +use proc_macro2::TokenStream as TokenStream2; +use proc_macro_error::abort_call_site; +use quote::{ + format_ident, + quote, +}; +use scale_info::{ + form::PortableForm, + TypeDef, +}; + +pub fn generate_storage( + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + storage: &PalletStorageMetadata, + types_mod_ident: &syn::Ident, +) -> TokenStream2 { + let (storage_structs, storage_fns): (Vec<_>, Vec<_>) = storage + .entries + .iter() + .map(|entry| { + generate_storage_entry_fns(&type_gen, &pallet, entry) + }) + .unzip(); + + quote! { + pub mod storage { + use super::#types_mod_ident; + #( #storage_structs )* + + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + + #( #storage_fns )* + } + } + } +} + +fn generate_storage_entry_fns( + type_gen: &TypeGenerator, + pallet: &PalletMetadata, + storage_entry: &StorageEntryMetadata, +) -> (TokenStream2, TokenStream2) { + let entry_struct_ident = format_ident!("{}", storage_entry.name); + let (fields, entry_struct, constructor, key_impl) = match storage_entry.ty { + StorageEntryType::Plain(_) => { + let entry_struct = quote!( pub struct #entry_struct_ident; ); + let constructor = quote!( #entry_struct_ident ); + let key_impl = quote!(::subxt::StorageEntryKey::Plain); + (vec![], entry_struct, constructor, key_impl) + } + StorageEntryType::Map { + ref key, + ref hashers, + .. + } => { + let key_ty = type_gen.resolve_type(key.id()); + let hashers = hashers + .iter() + .map(|hasher| { + let hasher = match hasher { + StorageHasher::Blake2_128 => "Blake2_128", + StorageHasher::Blake2_256 => "Blake2_256", + StorageHasher::Blake2_128Concat => "Blake2_128Concat", + StorageHasher::Twox128 => "Twox128", + StorageHasher::Twox256 => "Twox256", + StorageHasher::Twox64Concat => "Twox64Concat", + StorageHasher::Identity => "Identity", + }; + let hasher = format_ident!("{}", hasher); + quote!( ::subxt::StorageHasher::#hasher ) + }) + .collect::>(); + match key_ty.type_def() { + TypeDef::Tuple(tuple) => { + let fields = tuple + .fields() + .iter() + .enumerate() + .map(|(i, f)| { + let field_name = + format_ident!("_{}", syn::Index::from(i)); + let field_type = type_gen.resolve_type_path(f.id(), &[]); + (field_name, field_type) + }) + .collect::>(); + // toddo: [AJ] use unzip here? + let tuple_struct_fields = + fields.iter().map(|(_, field_type)| field_type); + let field_names = fields.iter().map(|(field_name, _)| field_name); + let entry_struct = quote! { + pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); + }; + let constructor = + quote!( #entry_struct_ident( #( #field_names ),* ) ); + let keys = (0..tuple.fields().len()) + .into_iter() + .zip(hashers) + .map(|(field, hasher)| { + let index = syn::Index::from(field); + quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) + }); + let key_impl = quote! { + ::subxt::StorageEntryKey::Map( + vec![ #( #keys ),* ] + ) + }; + (fields, entry_struct, constructor, key_impl) + } + _ => { + let ty_path = type_gen.resolve_type_path(key.id(), &[]); + let fields = vec![(format_ident!("_0"), ty_path.clone())]; + let entry_struct = quote! { + pub struct #entry_struct_ident( pub #ty_path ); + }; + let constructor = quote!( #entry_struct_ident(_0) ); + let hasher = hashers.get(0).unwrap_or_else(|| { + abort_call_site!("No hasher found for single key") + }); + let key_impl = quote! { + ::subxt::StorageEntryKey::Map( + vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] + ) + }; + (fields, entry_struct, constructor, key_impl) + } + } + } + }; + let pallet_name = &pallet.name; + let storage_name = &storage_entry.name; + let fn_name = format_ident!("{}", storage_entry.name.to_snake_case()); + let storage_entry_ty = match storage_entry.ty { + StorageEntryType::Plain(ref ty) => ty, + StorageEntryType::Map { ref value, .. } => value, + }; + let storage_entry_value_ty = + type_gen.resolve_type_path(storage_entry_ty.id(), &[]); + let (return_ty, fetch) = match storage_entry.modifier { + StorageEntryModifier::Default => { + (quote!( #storage_entry_value_ty ), quote!(fetch_or_default)) + } + StorageEntryModifier::Optional => { + ( + quote!( ::core::option::Option<#storage_entry_value_ty> ), + quote!(fetch), + ) + } + }; + + let storage_entry_type = quote! { + #entry_struct + + impl ::subxt::StorageEntry for #entry_struct_ident { + const PALLET: &'static str = #pallet_name; + const STORAGE: &'static str = #storage_name; + type Value = #storage_entry_value_ty; + fn key(&self) -> ::subxt::StorageEntryKey { + #key_impl + } + } + }; + + let key_args = fields + .iter() + .map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? + let client_fn = quote! { + pub async fn #fn_name( + &self, + #( #key_args, )* + hash: ::core::option::Option, + ) -> ::core::result::Result<#return_ty, ::subxt::Error> { + let entry = #constructor; + self.client.storage().#fetch(&entry, hash).await + } + }; + + (storage_entry_type, client_fn) +} diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 846c5ee6be..9a9812aabe 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -113,6 +113,16 @@ impl<'a> TypeGenerator<'a> { } } + /// # Panics + /// + /// If no type with the given id found in the type registry. + pub fn resolve_type(&self, id: u32) -> Type { + self.type_registry + .resolve(id) + .unwrap_or_else(|| panic!("No type with id {} found", id)) + .clone() + } + /// # Panics /// /// If no type with the given id found in the type registry. @@ -128,17 +138,10 @@ impl<'a> TypeGenerator<'a> { return TypePath::Parameter(parent_type_param.clone()) } - let resolve_type = |id| { - self.type_registry - .resolve(id) - .unwrap_or_else(|| panic!("No type with id {} found", id)) - .clone() - }; - - let mut ty = resolve_type(id); + let mut ty = self.resolve_type(id); if ty.path().ident() == Some("Cow".to_string()) { - ty = resolve_type( + ty = self.resolve_type( ty.type_params()[0] .ty() .expect("type parameters to Cow are not expected to be skipped; qed") From 021c186193eef1855d88be149a947db8bd3d80bb Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 12:31:59 +0100 Subject: [PATCH 151/216] Add some hardcoded type substitute defaults --- Cargo.toml | 2 +- codegen/src/api/mod.rs | 21 +++++++++++++++++++-- src/lib.rs | 4 +++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00d5a8ebdd..3dadaf521d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,7 @@ url = "2.2.1" subxt-macro = { version = "0.1.0", path = "macro" } +sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "master" } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate/", branch = "master" } sp-runtime = { package = "sp-runtime", git = "https://github.com/paritytech/substrate/", branch = "master" } sp-version = { package = "sp-version", git = "https://github.com/paritytech/substrate/", branch = "master" } @@ -56,6 +57,5 @@ tempdir = "0.3.7" wabt = "0.10.0" which = "4.0.2" -sp-arithmetic = { package = "sp-arithmetic", git = "https://github.com/paritytech/substrate/", branch = "master" } sp-keyring = { package = "sp-keyring", git = "https://github.com/paritytech/substrate/", branch = "master" } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index c0ce53ff4f..5caf9154c5 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -39,11 +39,13 @@ use quote::{ quote, }; use std::{ + collections::HashMap, fs, io::Read, path, string::ToString, }; +use syn::parse_quote; pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 where @@ -78,8 +80,23 @@ impl RuntimeGenerator { pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { let item_mod_ir = ir::ItemMod::from(item_mod); - let type_substitutes = item_mod_ir.type_substitutes(); - // todo: [AJ] add hardcoded type subs as per test runtime... + + // some hardcoded default type substitutes, can be overridden by user + let mut type_substitutes = [ + ("sp_core::crypto::AccountId32", parse_quote!( ::subxt::sp_core::crypto::AccountId32 )), + ("primitive_types::H256", parse_quote!( ::subxt::sp_core::H256 )), + ("sp_runtime::multiaddress::MultiAddress", parse_quote!( ::subxt::sp_runtime::MultiAddress )), + // todo: [AJ] remove the requirement for these by implementing Compact handling properly + ("sp_arithmetic::per_things::Perbill", parse_quote!( ::subxt::sp_arithmetic::per_things::Perbill )), + ("sp_arithmetic::per_things::Perquintill", parse_quote!( ::subxt::sp_arithmetic::per_things::Perquintill )), + ] + .iter() + .map(|(path, substitute): &(&str, syn::TypePath)| (path.to_string(), substitute.clone())).collect::>(); + + for (path, substitute) in item_mod_ir.type_substitutes().iter() { + type_substitutes.insert(path.to_string(), substitute.clone()); + }; + let type_gen = TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); let types_mod = type_gen.generate_types_mod(); diff --git a/src/lib.rs b/src/lib.rs index d64598b454..e9a4eab2be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,9 +41,11 @@ #![allow(clippy::type_complexity)] pub use frame_metadata::StorageHasher; +pub use subxt_macro::subxt; + +pub use sp_arithmetic; pub use sp_core; pub use sp_runtime; -pub use subxt_macro::subxt; use codec::{ Decode, From 99a83c7a949b81104252e223e298b3d8b6f24f80 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 12:33:01 +0100 Subject: [PATCH 152/216] Fmt --- codegen/src/api/calls.rs | 81 ++++++++++++------------- codegen/src/api/events.rs | 35 +++++------ codegen/src/api/mod.rs | 42 ++++++++----- codegen/src/api/storage.rs | 90 ++++++++++++++-------------- codegen/src/ir.rs | 53 ++++++++-------- examples/fetch_remote.rs | 2 +- src/client.rs | 10 ++-- src/config.rs | 8 +-- src/events.rs | 2 +- src/extrinsic/mod.rs | 14 ++++- src/lib.rs | 10 ++-- src/rpc.rs | 14 +++-- src/storage.rs | 2 +- src/subscription.rs | 2 +- tests/integration/frame/balances.rs | 2 +- tests/integration/frame/contracts.rs | 4 +- tests/integration/frame/staking.rs | 2 +- tests/integration/frame/sudo.rs | 2 +- tests/integration/frame/system.rs | 2 +- tests/integration/runtime.rs | 2 +- tests/integration/utils/context.rs | 9 ++- 21 files changed, 205 insertions(+), 183 deletions(-) diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index b99ef3a6eb..6d52f597af 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -14,12 +14,10 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use crate::{ - types::TypeGenerator, -}; +use crate::types::TypeGenerator; use frame_metadata::{ PalletCallMetadata, - PalletMetadata + PalletMetadata, }; use heck::SnakeCase as _; use proc_macro2::TokenStream as TokenStream2; @@ -38,47 +36,46 @@ pub fn generate_calls( ) -> TokenStream2 { let struct_defs = super::generate_structs_from_variants(type_gen, call.ty.id(), "Call"); - let (call_structs, call_fns): (Vec<_>, Vec<_>) = - struct_defs - .iter() - .map(|struct_def| { - let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def - .named_fields() - .unwrap_or_else(|| { - abort_call_site!( - "Call variant for type {} must have all named fields", - call.ty.id() - ) - }) - .iter() - .map(|(name, ty)| (quote!( #name: #ty ), name)) - .unzip(); + let (call_structs, call_fns): (Vec<_>, Vec<_>) = struct_defs + .iter() + .map(|struct_def| { + let (call_fn_args, call_args): (Vec<_>, Vec<_>) = struct_def + .named_fields() + .unwrap_or_else(|| { + abort_call_site!( + "Call variant for type {} must have all named fields", + call.ty.id() + ) + }) + .iter() + .map(|(name, ty)| (quote!( #name: #ty ), name)) + .unzip(); - let pallet_name = &pallet.name; - let call_struct_name = &struct_def.name; - let function_name = struct_def.name.to_string().to_snake_case(); - let fn_name = format_ident!("{}", function_name); + let pallet_name = &pallet.name; + let call_struct_name = &struct_def.name; + let function_name = struct_def.name.to_string().to_snake_case(); + let fn_name = format_ident!("{}", function_name); - let call_struct = quote! { - #struct_def + let call_struct = quote! { + #struct_def - impl ::subxt::Call for #call_struct_name { - const PALLET: &'static str = #pallet_name; - const FUNCTION: &'static str = #function_name; - } - }; - let client_fn = quote! { - pub fn #fn_name( - &self, - #( #call_fn_args, )* - ) -> ::subxt::SubmittableExtrinsic { - let call = #call_struct_name { #( #call_args, )* }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - }; - (call_struct, client_fn) - }) - .unzip(); + impl ::subxt::Call for #call_struct_name { + const PALLET: &'static str = #pallet_name; + const FUNCTION: &'static str = #function_name; + } + }; + let client_fn = quote! { + pub fn #fn_name( + &self, + #( #call_fn_args, )* + ) -> ::subxt::SubmittableExtrinsic { + let call = #call_struct_name { #( #call_args, )* }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + }; + (call_struct, client_fn) + }) + .unzip(); quote! { pub mod calls { diff --git a/codegen/src/api/events.rs b/codegen/src/api/events.rs index 78bb52bb53..2cfe804273 100644 --- a/codegen/src/api/events.rs +++ b/codegen/src/api/events.rs @@ -14,12 +14,10 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use crate::{ - types::TypeGenerator, -}; +use crate::types::TypeGenerator; use frame_metadata::{ PalletEventMetadata, - PalletMetadata + PalletMetadata, }; use proc_macro2::TokenStream as TokenStream2; use quote::quote; @@ -33,23 +31,20 @@ pub fn generate_events( ) -> TokenStream2 { let struct_defs = super::generate_structs_from_variants(type_gen, event.ty.id(), "Event"); - let event_structs = - struct_defs - .iter() - .map(|struct_def| { - let pallet_name = &pallet.name; - let event_struct = &struct_def.name; - let event_name = struct_def.name.to_string(); + let event_structs = struct_defs.iter().map(|struct_def| { + let pallet_name = &pallet.name; + let event_struct = &struct_def.name; + let event_name = struct_def.name.to_string(); - quote! { - #struct_def + quote! { + #struct_def - impl ::subxt::Event for #event_struct { - const PALLET: &'static str = #pallet_name; - const EVENT: &'static str = #event_name; - } - } - }); + impl ::subxt::Event for #event_struct { + const PALLET: &'static str = #pallet_name; + const EVENT: &'static str = #event_name; + } + } + }); let event_type = type_gen.resolve_type_path(event.ty.id(), &[]); quote! { @@ -59,4 +54,4 @@ pub fn generate_events( #( #event_structs )* } } -} \ No newline at end of file +} diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 5caf9154c5..4cc148a727 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -31,9 +31,7 @@ use frame_metadata::{ }; use heck::SnakeCase as _; use proc_macro2::TokenStream as TokenStream2; -use proc_macro_error::{ - abort_call_site, -}; +use proc_macro_error::abort_call_site; use quote::{ format_ident, quote, @@ -83,19 +81,37 @@ impl RuntimeGenerator { // some hardcoded default type substitutes, can be overridden by user let mut type_substitutes = [ - ("sp_core::crypto::AccountId32", parse_quote!( ::subxt::sp_core::crypto::AccountId32 )), - ("primitive_types::H256", parse_quote!( ::subxt::sp_core::H256 )), - ("sp_runtime::multiaddress::MultiAddress", parse_quote!( ::subxt::sp_runtime::MultiAddress )), + ( + "sp_core::crypto::AccountId32", + parse_quote!(::subxt::sp_core::crypto::AccountId32), + ), + ( + "primitive_types::H256", + parse_quote!(::subxt::sp_core::H256), + ), + ( + "sp_runtime::multiaddress::MultiAddress", + parse_quote!(::subxt::sp_runtime::MultiAddress), + ), // todo: [AJ] remove the requirement for these by implementing Compact handling properly - ("sp_arithmetic::per_things::Perbill", parse_quote!( ::subxt::sp_arithmetic::per_things::Perbill )), - ("sp_arithmetic::per_things::Perquintill", parse_quote!( ::subxt::sp_arithmetic::per_things::Perquintill )), + ( + "sp_arithmetic::per_things::Perbill", + parse_quote!(::subxt::sp_arithmetic::per_things::Perbill), + ), + ( + "sp_arithmetic::per_things::Perquintill", + parse_quote!(::subxt::sp_arithmetic::per_things::Perquintill), + ), ] - .iter() - .map(|(path, substitute): &(&str, syn::TypePath)| (path.to_string(), substitute.clone())).collect::>(); + .iter() + .map(|(path, substitute): &(&str, syn::TypePath)| { + (path.to_string(), substitute.clone()) + }) + .collect::>(); for (path, substitute) in item_mod_ir.type_substitutes().iter() { type_substitutes.insert(path.to_string(), substitute.clone()); - }; + } let type_gen = TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); @@ -281,7 +297,6 @@ impl RuntimeGenerator { } } } - } pub fn generate_structs_from_variants( @@ -310,6 +325,3 @@ pub fn generate_structs_from_variants( ) } } - - - diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index e8660d4d73..a49b372d6f 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -14,10 +14,15 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use crate::{ - types::TypeGenerator, +use crate::types::TypeGenerator; +use frame_metadata::{ + PalletMetadata, + PalletStorageMetadata, + StorageEntryMetadata, + StorageEntryModifier, + StorageEntryType, + StorageHasher, }; -use frame_metadata::{StorageEntryMetadata, StorageEntryType, StorageEntryModifier, StorageHasher, PalletMetadata, PalletStorageMetadata}; use heck::SnakeCase as _; use proc_macro2::TokenStream as TokenStream2; use proc_macro_error::abort_call_site; @@ -39,9 +44,7 @@ pub fn generate_storage( let (storage_structs, storage_fns): (Vec<_>, Vec<_>) = storage .entries .iter() - .map(|entry| { - generate_storage_entry_fns(&type_gen, &pallet, entry) - }) + .map(|entry| generate_storage_entry_fns(&type_gen, &pallet, entry)) .unzip(); quote! { @@ -106,8 +109,7 @@ fn generate_storage_entry_fns( .iter() .enumerate() .map(|(i, f)| { - let field_name = - format_ident!("_{}", syn::Index::from(i)); + let field_name = format_ident!("_{}", syn::Index::from(i)); let field_type = type_gen.resolve_type_path(f.id(), &[]); (field_name, field_type) }) @@ -117,39 +119,38 @@ fn generate_storage_entry_fns( fields.iter().map(|(_, field_type)| field_type); let field_names = fields.iter().map(|(field_name, _)| field_name); let entry_struct = quote! { - pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); - }; + pub struct #entry_struct_ident( #( #tuple_struct_fields ),* ); + }; let constructor = quote!( #entry_struct_ident( #( #field_names ),* ) ); - let keys = (0..tuple.fields().len()) - .into_iter() - .zip(hashers) - .map(|(field, hasher)| { + let keys = (0..tuple.fields().len()).into_iter().zip(hashers).map( + |(field, hasher)| { let index = syn::Index::from(field); quote!( ::subxt::StorageMapKey::new(&self.#index, #hasher) ) - }); + }, + ); let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ #( #keys ),* ] - ) - }; + ::subxt::StorageEntryKey::Map( + vec![ #( #keys ),* ] + ) + }; (fields, entry_struct, constructor, key_impl) } _ => { let ty_path = type_gen.resolve_type_path(key.id(), &[]); let fields = vec![(format_ident!("_0"), ty_path.clone())]; let entry_struct = quote! { - pub struct #entry_struct_ident( pub #ty_path ); - }; + pub struct #entry_struct_ident( pub #ty_path ); + }; let constructor = quote!( #entry_struct_ident(_0) ); let hasher = hashers.get(0).unwrap_or_else(|| { abort_call_site!("No hasher found for single key") }); let key_impl = quote! { - ::subxt::StorageEntryKey::Map( - vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] - ) - }; + ::subxt::StorageEntryKey::Map( + vec![ ::subxt::StorageMapKey::new(&self.0, #hasher) ] + ) + }; (fields, entry_struct, constructor, key_impl) } } @@ -162,8 +163,7 @@ fn generate_storage_entry_fns( StorageEntryType::Plain(ref ty) => ty, StorageEntryType::Map { ref value, .. } => value, }; - let storage_entry_value_ty = - type_gen.resolve_type_path(storage_entry_ty.id(), &[]); + let storage_entry_value_ty = type_gen.resolve_type_path(storage_entry_ty.id(), &[]); let (return_ty, fetch) = match storage_entry.modifier { StorageEntryModifier::Default => { (quote!( #storage_entry_value_ty ), quote!(fetch_or_default)) @@ -177,31 +177,31 @@ fn generate_storage_entry_fns( }; let storage_entry_type = quote! { - #entry_struct + #entry_struct - impl ::subxt::StorageEntry for #entry_struct_ident { - const PALLET: &'static str = #pallet_name; - const STORAGE: &'static str = #storage_name; - type Value = #storage_entry_value_ty; - fn key(&self) -> ::subxt::StorageEntryKey { - #key_impl - } + impl ::subxt::StorageEntry for #entry_struct_ident { + const PALLET: &'static str = #pallet_name; + const STORAGE: &'static str = #storage_name; + type Value = #storage_entry_value_ty; + fn key(&self) -> ::subxt::StorageEntryKey { + #key_impl } - }; + } + }; let key_args = fields .iter() .map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? let client_fn = quote! { - pub async fn #fn_name( - &self, - #( #key_args, )* - hash: ::core::option::Option, - ) -> ::core::result::Result<#return_ty, ::subxt::Error> { - let entry = #constructor; - self.client.storage().#fetch(&entry, hash).await - } - }; + pub async fn #fn_name( + &self, + #( #key_args, )* + hash: ::core::option::Option, + ) -> ::core::result::Result<#return_ty, ::subxt::Error> { + let entry = #constructor; + self.client.storage().#fetch(&entry, hash).await + } + }; (storage_entry_type, client_fn) } diff --git a/codegen/src/ir.rs b/codegen/src/ir.rs index 57a61414e2..3304f28313 100644 --- a/codegen/src/ir.rs +++ b/codegen/src/ir.rs @@ -14,14 +14,12 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use std::{ - collections::HashMap, -}; +use proc_macro_error::abort; +use std::collections::HashMap; use syn::{ - token, spanned::Spanned as _, + token, }; -use proc_macro_error::abort; // todo: [AJ] implement ToTokens for this to generate the actual mod // todo: [AJ] figure out how to incorporate the types and api codegen here... @@ -40,10 +38,7 @@ impl From for ItemMod { let (brace, items) = match module.content { Some((brace, items)) => (brace, items), None => { - abort!( - module, - "out-of-line subxt modules are not supported", - ) + abort!(module, "out-of-line subxt modules are not supported",) } }; let items = items @@ -62,13 +57,20 @@ impl From for ItemMod { impl ItemMod { pub fn type_substitutes(&self) -> HashMap { - self.items.iter().filter_map(|item| - if let Item::Subxt(SubxtItem::TypeSubstitute { generated_type_path, substitute_with: substitute_type }) = item { - Some((generated_type_path.clone(), substitute_type.clone())) - } else { - None - } - ).collect() + self.items + .iter() + .filter_map(|item| { + if let Item::Subxt(SubxtItem::TypeSubstitute { + generated_type_path, + substitute_with: substitute_type, + }) = item + { + Some((generated_type_path.clone(), substitute_type.clone())) + } else { + None + } + }) + .collect() } } @@ -88,14 +90,11 @@ impl From for Item { let meta = attr.parse_meta().unwrap_or_else(|e| { abort!(attr.span(), "Error parsing attribute: {}", e) }); - let substitute_type_args = ::from_meta(&meta) - .unwrap_or_else(|e| { - abort!( - attr.span(), - "Error parsing attribute meta: {}", - e - ) - }); + let substitute_type_args = + ::from_meta(&meta) + .unwrap_or_else(|e| { + abort!(attr.span(), "Error parsing attribute meta: {}", e) + }); substitute_type_args }) .collect::>(); @@ -110,7 +109,7 @@ impl From for Item { let substitute_with: syn::TypePath = syn::parse_quote!( #use_path ); let type_substitute = SubxtItem::TypeSubstitute { generated_type_path: attr.substitute_type().to_string(), - substitute_with + substitute_with, }; Self::Subxt(type_substitute) } else { @@ -127,7 +126,7 @@ pub enum SubxtItem { TypeSubstitute { generated_type_path: String, substitute_with: syn::TypePath, - } + }, } mod attrs { @@ -146,4 +145,4 @@ mod attrs { } } } -} \ No newline at end of file +} diff --git a/examples/fetch_remote.rs b/examples/fetch_remote.rs index f214770c04..ac655a5605 100644 --- a/examples/fetch_remote.rs +++ b/examples/fetch_remote.rs @@ -14,11 +14,11 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use sp_runtime::traits::BlakeTwo256; use subxt::{ ClientBuilder, Config, }; -use sp_runtime::traits::BlakeTwo256; #[subxt::subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] pub mod node_runtime { diff --git a/src/client.rs b/src/client.rs index 8741ef9980..aa8a13828a 100644 --- a/src/client.rs +++ b/src/client.rs @@ -22,9 +22,9 @@ use crate::{ events::EventsDecoder, extrinsic::{ self, + SignedExtra, Signer, UncheckedExtrinsic, - SignedExtra, }, rpc::{ ExtrinsicSuccess, @@ -35,10 +35,10 @@ use crate::{ storage::StorageClient, AccountData, Call, + Config, Error, ExtrinsicExtraData, Metadata, - Config, }; /// ClientBuilder for constructing a Client. @@ -257,7 +257,9 @@ where .storage() .fetch_or_default(&account_storage_entry, None) .await?; - <>::AccountData as AccountData>::nonce(&account_data) + <>::AccountData as AccountData>::nonce( + &account_data, + ) }; let call = self .client @@ -272,7 +274,7 @@ where call, signer, ) - .await?; + .await?; Ok(signed) } } diff --git a/src/config.rs b/src/config.rs index a1d166bfa5..460cc4c5f0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,16 +14,16 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use crate::{ + SignedExtra, + StorageEntry, +}; use codec::{ Codec, Encode, EncodeLike, }; use core::fmt::Debug; -use crate::{ - SignedExtra, - StorageEntry, -}; use sp_runtime::traits::{ AtLeast32Bit, Extrinsic, diff --git a/src/events.rs b/src/events.rs index 1055be4bd7..02dbd52a6a 100644 --- a/src/events.rs +++ b/src/events.rs @@ -28,10 +28,10 @@ use crate::{ EventMetadata, MetadataError, }, + Config, Error, Metadata, Phase, - Config, RuntimeError, }; use scale_info::{ diff --git a/src/extrinsic/mod.rs b/src/extrinsic/mod.rs index a5959f2993..542382bab5 100644 --- a/src/extrinsic/mod.rs +++ b/src/extrinsic/mod.rs @@ -41,9 +41,9 @@ use sp_runtime::traits::SignedExtension; use sp_version::RuntimeVersion; use crate::{ + Config, Encoded, Error, - Config, ExtrinsicExtraData, }; @@ -56,7 +56,10 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< >; /// SignedPayload type. -pub type SignedPayload = sp_runtime::generic::SignedPayload>::Extra as SignedExtra>::Extra>; +pub type SignedPayload = sp_runtime::generic::SignedPayload< + Encoded, + <>::Extra as SignedExtra>::Extra, +>; /// Creates a signed extrinsic pub async fn create_signed( @@ -73,7 +76,12 @@ where { let spec_version = runtime_version.spec_version; let tx_version = runtime_version.transaction_version; - let extra = >::Extra::new(spec_version, tx_version, nonce, genesis_hash); + let extra = >::Extra::new( + spec_version, + tx_version, + nonce, + genesis_hash, + ); let payload = SignedPayload::::new(call, extra.extra())?; let signed = signer.sign(payload).await?; Ok(signed) diff --git a/src/lib.rs b/src/lib.rs index e9a4eab2be..9867292c05 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -64,16 +64,16 @@ pub mod storage; mod subscription; pub use crate::{ - config::{ - Config, - AccountData, - ExtrinsicExtraData, - }, client::{ Client, ClientBuilder, SubmittableExtrinsic, }, + config::{ + AccountData, + Config, + ExtrinsicExtraData, + }, error::{ Error, PalletError, diff --git a/src/rpc.rs b/src/rpc.rs index a7438b09e5..2be0a5cbc4 100644 --- a/src/rpc.rs +++ b/src/rpc.rs @@ -33,7 +33,10 @@ use core::{ marker::PhantomData, }; use frame_metadata::RuntimeMetadataPrefixed; -use jsonrpsee_http_client::{HttpClient, HttpClientBuilder}; +use jsonrpsee_http_client::{ + HttpClient, + HttpClientBuilder, +}; use jsonrpsee_types::{ to_json_value, traits::{ @@ -45,7 +48,10 @@ use jsonrpsee_types::{ JsonValue, Subscription, }; -use jsonrpsee_ws_client::{WsClient, WsClientBuilder}; +use jsonrpsee_ws_client::{ + WsClient, + WsClientBuilder, +}; use serde::{ Deserialize, Serialize, @@ -81,9 +87,9 @@ use crate::{ FinalizedEventStorageSubscription, SystemEvents, }, + Config, Event, Metadata, - Config, }; /// A number type that can be serialized both as a number or a string that encodes a number in a @@ -317,8 +323,6 @@ impl Rpc { } } - - /// Configure the Rpc to accept non-finalized blocks /// in `submit_and_watch_extrinsic` pub fn accept_weak_inclusion(&mut self) { diff --git a/src/storage.rs b/src/storage.rs index 97d7b16c8e..487119fe34 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -35,8 +35,8 @@ use crate::{ MetadataError, }, rpc::Rpc, - Error, Config, + Error, StorageHasher, }; diff --git a/src/subscription.rs b/src/subscription.rs index cfa6c7c6e6..31ad50c3e8 100644 --- a/src/subscription.rs +++ b/src/subscription.rs @@ -36,9 +36,9 @@ use crate::{ RawEvent, }, rpc::Rpc, + Config, Event, Phase, - Config, }; /// Event subscription simplifies filtering a storage change set stream for diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index bf640d1e20..e70f7a19ef 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -16,10 +16,10 @@ use crate::{ node_runtime::{ - DefaultConfig, balances, runtime_types, system, + DefaultConfig, }, test_context, }; diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index 553dc0aa44..ca91f5cd4b 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -18,13 +18,13 @@ use sp_keyring::AccountKeyring; use crate::{ node_runtime::{ - DefaultConfig, contracts::{ calls::TransactionApi, events, storage, }, system, + DefaultConfig, }, test_context, TestContext, @@ -33,10 +33,10 @@ use sp_core::sr25519::Pair; use sp_runtime::MultiAddress; use subxt::{ Client, + Config, Error, ExtrinsicSuccess, PairSigner, - Config, StorageEntry, }; diff --git a/tests/integration/frame/staking.rs b/tests/integration/frame/staking.rs index 5d21032cd1..25ea69359e 100644 --- a/tests/integration/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -16,12 +16,12 @@ use crate::{ node_runtime::{ - DefaultConfig, runtime_types::pallet_staking::{ RewardDestination, ValidatorPrefs, }, staking, + DefaultConfig, }, test_context, }; diff --git a/tests/integration/frame/sudo.rs b/tests/integration/frame/sudo.rs index c84f7114b6..7ddeddfe3a 100644 --- a/tests/integration/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -16,9 +16,9 @@ use crate::{ node_runtime::{ - DefaultConfig, runtime_types, sudo, + DefaultConfig, }, test_context, }; diff --git a/tests/integration/frame/system.rs b/tests/integration/frame/system.rs index e8058d1529..2f59d5f15c 100644 --- a/tests/integration/frame/system.rs +++ b/tests/integration/frame/system.rs @@ -16,8 +16,8 @@ use crate::{ node_runtime::{ - DefaultConfig, system, + DefaultConfig, }, test_context, }; diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index 8108801082..dc4f29cc14 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -28,4 +28,4 @@ pub mod node_runtime { use sp_arithmetic::per_things::Perbill; #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] use sp_arithmetic::per_things::Perquintill; -} \ No newline at end of file +} diff --git a/tests/integration/utils/context.rs b/tests/integration/utils/context.rs index d3be2277b4..321a568ca4 100644 --- a/tests/integration/utils/context.rs +++ b/tests/integration/utils/context.rs @@ -15,7 +15,10 @@ // along with subxt. If not, see . pub use crate::{ - node_runtime::{self, DefaultConfig}, + node_runtime::{ + self, + DefaultConfig, + }, TestNodeProcess, }; @@ -25,7 +28,9 @@ use subxt::Client; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; -pub async fn test_node_process_with(key: AccountKeyring) -> TestNodeProcess { +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. \ From 27c5b920ac7e11bf65fc723e906d753be2acfcac Mon Sep 17 00:00:00 2001 From: Paulo Martins Date: Mon, 18 Oct 2021 15:26:35 +0100 Subject: [PATCH 153/216] Add utility pallet tests (#300) * add batch call test example * add pallet utility tests * add utility module * fix warnings --- tests/src/frame/mod.rs | 1 + tests/src/frame/system.rs | 8 +--- tests/src/frame/utility.rs | 82 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 tests/src/frame/utility.rs diff --git a/tests/src/frame/mod.rs b/tests/src/frame/mod.rs index 5a092cf474..59574b33c4 100644 --- a/tests/src/frame/mod.rs +++ b/tests/src/frame/mod.rs @@ -21,3 +21,4 @@ mod contracts; mod staking; mod sudo; mod system; +mod utility; diff --git a/tests/src/frame/system.rs b/tests/src/frame/system.rs index 71196c6d9f..fdcf4dc330 100644 --- a/tests/src/frame/system.rs +++ b/tests/src/frame/system.rs @@ -16,15 +16,11 @@ use crate::{ node_runtime::system, - test_context, - TestRuntime, + test_context, TestRuntime, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::{ - PairSigner, - Signer, -}; +use subxt::extrinsic::{PairSigner, Signer}; #[async_std::test] async fn storage_account() { diff --git a/tests/src/frame/utility.rs b/tests/src/frame/utility.rs new file mode 100644 index 0000000000..544854c66d --- /dev/null +++ b/tests/src/frame/utility.rs @@ -0,0 +1,82 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of substrate-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 substrate-subxt. If not, see . + +use crate::{ + node_runtime::runtime_types, + node_runtime::utility, test_context, TestRuntime, +}; +use assert_matches::assert_matches; +use sp_keyring::AccountKeyring; +use subxt::extrinsic::{PairSigner, Signer}; + +type Call = runtime_types::node_runtime::Call; +type SystemCall = runtime_types::frame_system::pallet::Call; +type BalancesCall = runtime_types::pallet_balances::pallet::Call; + +#[async_std::test] +async fn tx_batch_remarks() { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let cxt = test_context().await; + + let call_a = Call::System(SystemCall::remark { + remark: b"cool remark".to_vec(), + }); + + let call_b = Call::System(SystemCall::remark { + remark: b"awesome remark".to_vec(), + }); + + let result = cxt + .api + .tx() + .utility() + .batch(vec![call_a, call_b]) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); + + let batch_completed = result.find_event::(); + assert_matches!(batch_completed, Ok(Some(_))); +} + +#[async_std::test] +async fn tx_batch_transfers() { + let alice = PairSigner::::new(AccountKeyring::Alice.pair()); + let bob = PairSigner::::new(AccountKeyring::Bob.pair()); + let bob_address = bob.account_id().clone().into(); + let cxt = test_context().await; + + let call = Call::Balances(BalancesCall::transfer { + dest: bob_address, + value: 10_000, + }); + + let result = cxt + .api + .tx() + .utility() + .batch(vec![call]) + .sign_and_submit_then_watch(&alice) + .await + .unwrap(); + + // todo: test fails with error Rpc(RestartNeeded("Custom error: Unparsable response")) + + let batch_completed = result.find_event::(); + assert_matches!(batch_completed, Ok(Some(_))); + + +} \ No newline at end of file From 4df1313ee0a062082c4f8706eb21cba5e66b5b57 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 16:27:08 +0100 Subject: [PATCH 154/216] Add polkadot runtime metadata for example --- ...ransfer.rs => polkadot_balance_transfer.rs} | 14 ++++++++++---- examples/polkadot_metadata.scale | Bin 0 -> 269992 bytes tests/integration/runtime.rs | 15 +-------------- 3 files changed, 11 insertions(+), 18 deletions(-) rename examples/{kusama_balance_transfer.rs => polkadot_balance_transfer.rs} (76%) create mode 100644 examples/polkadot_metadata.scale diff --git a/examples/kusama_balance_transfer.rs b/examples/polkadot_balance_transfer.rs similarity index 76% rename from examples/kusama_balance_transfer.rs rename to examples/polkadot_balance_transfer.rs index e66f6d115d..f4bb0d6a43 100644 --- a/examples/kusama_balance_transfer.rs +++ b/examples/polkadot_balance_transfer.rs @@ -16,12 +16,13 @@ use sp_keyring::AccountKeyring; use subxt::{ - balances::*, ClientBuilder, - KusamaRuntime, PairSigner, }; +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} + #[async_std::main] async fn main() -> Result<(), Box> { env_logger::init(); @@ -29,8 +30,13 @@ async fn main() -> Result<(), Box> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let client = ClientBuilder::::new().build().await?; - let hash = client.transfer(&signer, &dest, 10_000).await?; + let api = ClientBuilder::new() + .build() + .await? + .to_runtime_api::>(); + let hash = api.tx().transfer(&dest, 10_000) + .sign_and_submit(&signer) + .await?; println!("Balance transfer extrinsic submitted: {}", hash); diff --git a/examples/polkadot_metadata.scale b/examples/polkadot_metadata.scale new file mode 100644 index 0000000000000000000000000000000000000000..678aba31610e193f4911839737af3e81c12bb4af GIT binary patch literal 269992 zcmeFa4QQm-c`ts>?8u%?0x2YrLJBG55BWn1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8@`> literal 0 HcmV?d00001 diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index dc4f29cc14..c3c368bced 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -15,17 +15,4 @@ // along with subxt. If not, see . #[subxt::subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] -pub mod node_runtime { - #[subxt(substitute_type = "sp_core::crypto::AccountId32")] - use sp_core::crypto::AccountId32; - #[subxt(substitute_type = "primitive_types::H256")] - use sp_core::H256; - #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] - use sp_runtime::MultiAddress; - - // todo: [AJ] remove the requirement for these by implementing Compact handling properly - #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] - use sp_arithmetic::per_things::Perbill; - #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] - use sp_arithmetic::per_things::Perquintill; -} +pub mod node_runtime {} From c2e7ab7b9f7b5f6d488902a88ce785cec57f2d68 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 16:36:20 +0100 Subject: [PATCH 155/216] Fix system errors and fmt --- examples/polkadot_balance_transfer.rs | 4 +++- src/metadata.rs | 6 ++++-- tests/integration/frame/balances.rs | 14 ++++---------- tests/integration/frame/system.rs | 12 +++++++++--- tests/integration/frame/utility.rs | 1 + 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/examples/polkadot_balance_transfer.rs b/examples/polkadot_balance_transfer.rs index f4bb0d6a43..c75049b3c1 100644 --- a/examples/polkadot_balance_transfer.rs +++ b/examples/polkadot_balance_transfer.rs @@ -34,7 +34,9 @@ async fn main() -> Result<(), Box> { .build() .await? .to_runtime_api::>(); - let hash = api.tx().transfer(&dest, 10_000) + let hash = api + .tx() + .transfer(&dest, 10_000) .sign_and_submit(&signer) .await?; diff --git a/src/metadata.rs b/src/metadata.rs index da0dabb1df..84deef0130 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -279,8 +279,10 @@ impl TryFrom for Metadata { .collect() }); - let constants = pallet.constants.iter().map(|constant| - (constant.name.clone(), constant.clone())) + let constants = pallet + .constants + .iter() + .map(|constant| (constant.name.clone(), constant.clone())) .collect(); let pallet_metadata = PalletMetadata { diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index f8f0ebeee5..d1622b288d 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -222,14 +222,8 @@ async fn transfer_subscription() { #[async_std::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(); + 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, 10_000_000_000); -} \ No newline at end of file +} diff --git a/tests/integration/frame/system.rs b/tests/integration/frame/system.rs index f6a0077ce9..5f0205e598 100644 --- a/tests/integration/frame/system.rs +++ b/tests/integration/frame/system.rs @@ -15,12 +15,18 @@ // along with subxt. If not, see . use crate::{ - node_runtime::system, - test_context, TestRuntime, + node_runtime::{ + system, + DefaultConfig, + }, + test_context, }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::extrinsic::{PairSigner, Signer}; +use subxt::extrinsic::{ + PairSigner, + Signer, +}; #[async_std::test] async fn storage_account() { diff --git a/tests/integration/frame/utility.rs b/tests/integration/frame/utility.rs index e69de29bb2..8b13789179 100644 --- a/tests/integration/frame/utility.rs +++ b/tests/integration/frame/utility.rs @@ -0,0 +1 @@ + From 8108f00bb2f8474f7269803ef5e816dafb11abc4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 18 Oct 2021 17:24:40 +0100 Subject: [PATCH 156/216] Add subxt-cli crate --- Cargo.toml | 2 +- cli/Cargo.toml | 23 ++++++++++++ cli/src/main.rs | 99 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 cli/Cargo.toml create mode 100644 cli/src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 3dadaf521d..a5e7609351 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [".", "codegen", "macro"] +members = [".", "cli", "codegen", "macro"] [package] name = "subxt" diff --git a/cli/Cargo.toml b/cli/Cargo.toml new file mode 100644 index 0000000000..ea0ba482d6 --- /dev/null +++ b/cli/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "subxt-cli" +version = "0.1.0" +edition = "2018" + +[dependencies] +subxt-codegen = { version = "0.1.0", path = "../codegen" } +# parse command line args +argh = "0.1.6" +# make the request to a substrate node to get the metadata +ureq = { version = "2.2.0", features = ["json"] } +# colourful error reports +color-eyre = "0.5.11" +# for serializing the metadata +serde = { version = "1.0.130", features = ["derive"] } +# for serializing as json +serde_json = "1.0.68" +# hex encoded metadata to bytes +hex = "0.4.3" +# actual metadata types +frame-metadata = { version = "14.0.0", features = ["v14", "std"] } +# for decoding bytes into the metadata types +scale = { package = "parity-scale-codec", version = "2.3.0", default-features = false } \ No newline at end of file diff --git a/cli/src/main.rs b/cli/src/main.rs new file mode 100644 index 0000000000..7e775e9b15 --- /dev/null +++ b/cli/src/main.rs @@ -0,0 +1,99 @@ +// Copyright 2019-2021 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 argh::FromArgs; +use color_eyre::eyre::{self, WrapErr}; +use frame_metadata::{ + RuntimeMetadata, RuntimeMetadataPrefixed, +}; +use std::io::{self, Write}; + +#[derive(FromArgs)] +/// Utilities for working with substrate metadata for subxt. +struct SubXt { + /// the url of the substrate node to query for metadata + #[argh(option, default = "String::from(\"http://localhost:9933\")")] + url: String, + /// the name of a pallet to display metadata for, otherwise displays all + #[argh(option, short = 'p')] + pallet: Option, + /// the format of the metadata to display: `json`, `hex` or `bytes` + #[argh(option, short = 'f', default = "\"json\".to_string()")] + format: String, +} + +fn main() -> color_eyre::Result<()> { + color_eyre::install()?; + let args: SubXt = argh::from_env(); + + let json = fetch_metadata(&args.url)?; + let hex_data = json["result"] + .as_str() + .ok_or(eyre::eyre!("metadata result field should be a string"))?; + let bytes = hex::decode(hex_data.trim_start_matches("0x"))?; + + match args.format.as_str() { + "json" => { + let metadata = scale::Decode::decode(&mut &bytes[..])?; + display_metadata_json(metadata, &args) + } + "hex" => { + println!("{}", hex_data); + Ok(()) + } + "bytes" => Ok(io::stdout().write_all(&bytes)?), + _ => Err(eyre::eyre!( + "Unsupported format `{}`, expected `json`, `hex` or `bytes`", + args.format + )), + } +} + +fn fetch_metadata(url: &str) -> color_eyre::Result { + let resp = ureq::post(url) + .set("Content-Type", "application/json") + .send_json(ureq::json!({ + "jsonrpc": "2.0", + "method": "state_getMetadata", + "id": 1 + })) + .context("error fetching metadata from the substrate node")?; + + Ok(resp.into_json()?) +} + +fn display_metadata_json( + metadata: RuntimeMetadataPrefixed, + args: &SubXt, +) -> color_eyre::Result<()> { + let serialized = if let Some(ref pallet) = args.pallet { + match metadata.1 { + RuntimeMetadata::V14(v14) => { + let pallet = v14 + .pallets + .iter() + .find(|m| &m.name == pallet) + .ok_or_else(|| eyre::eyre!("pallet not found in metadata"))?; + serde_json::to_string_pretty(&pallet)? + } + _ => return Err(eyre::eyre!("Unsupported metadata version")), + } + } else { + serde_json::to_string_pretty(&metadata)? + }; + println!("{}", serialized); + Ok(()) +} From fd18fcd01bf44fc551920f365811aec13672e849 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 19 Oct 2021 11:16:30 +0100 Subject: [PATCH 157/216] Add metadata and codegen subcommands --- cli/src/main.rs | 95 +++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 7e775e9b15..922c04bffd 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -21,44 +21,70 @@ use frame_metadata::{ }; use std::io::{self, Write}; -#[derive(FromArgs)] +#[derive(FromArgs, PartialEq, Debug)] /// Utilities for working with substrate metadata for subxt. struct SubXt { + #[argh(subcommand)] + command: Command, +} + +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand)] +enum Command { + Metadata(MetadataCommand), + Codegen(CodegenCommand), +} + +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand, name = "metadata")] +/// Download metadata from a substrate node, for use with `subxt` codegen. +struct MetadataCommand { /// the url of the substrate node to query for metadata #[argh(option, default = "String::from(\"http://localhost:9933\")")] url: String, - /// the name of a pallet to display metadata for, otherwise displays all - #[argh(option, short = 'p')] - pallet: Option, /// the format of the metadata to display: `json`, `hex` or `bytes` #[argh(option, short = 'f', default = "\"json\".to_string()")] format: String, } +#[derive(FromArgs, PartialEq, Debug)] +#[argh(subcommand, name = "codegen")] +/// Invoke subxt codegen from metadata. +struct CodegenCommand { + // todo: from file or download directly from node +} + fn main() -> color_eyre::Result<()> { color_eyre::install()?; let args: SubXt = argh::from_env(); - let json = fetch_metadata(&args.url)?; - let hex_data = json["result"] - .as_str() - .ok_or(eyre::eyre!("metadata result field should be a string"))?; - let bytes = hex::decode(hex_data.trim_start_matches("0x"))?; + match args.command { + Command::Metadata(args) => { + let json = fetch_metadata(&args.url)?; + let hex_data = json["result"] + .as_str() + .ok_or(eyre::eyre!("metadata result field should be a string"))?; + let bytes = hex::decode(hex_data.trim_start_matches("0x"))?; - match args.format.as_str() { - "json" => { - let metadata = scale::Decode::decode(&mut &bytes[..])?; - display_metadata_json(metadata, &args) - } - "hex" => { - println!("{}", hex_data); - Ok(()) - } - "bytes" => Ok(io::stdout().write_all(&bytes)?), - _ => Err(eyre::eyre!( - "Unsupported format `{}`, expected `json`, `hex` or `bytes`", - args.format - )), + match args.format.as_str() { + "json" => { + let metadata = scale::Decode::decode(&mut &bytes[..])?; + let json = serde_json::to_string_pretty(&metadata)?; + println!("{}", json); + Ok(()) + } + "hex" => { + println!("{}", hex_data); + Ok(()) + } + "bytes" => Ok(io::stdout().write_all(&bytes)?), + _ => Err(eyre::eyre!( + "Unsupported format `{}`, expected `json`, `hex` or `bytes`", + args.format + )), + } + }, + Command::Codegen(_codegen) => todo!() } } @@ -74,26 +100,3 @@ fn fetch_metadata(url: &str) -> color_eyre::Result { Ok(resp.into_json()?) } - -fn display_metadata_json( - metadata: RuntimeMetadataPrefixed, - args: &SubXt, -) -> color_eyre::Result<()> { - let serialized = if let Some(ref pallet) = args.pallet { - match metadata.1 { - RuntimeMetadata::V14(v14) => { - let pallet = v14 - .pallets - .iter() - .find(|m| &m.name == pallet) - .ok_or_else(|| eyre::eyre!("pallet not found in metadata"))?; - serde_json::to_string_pretty(&pallet)? - } - _ => return Err(eyre::eyre!("Unsupported metadata version")), - } - } else { - serde_json::to_string_pretty(&metadata)? - }; - println!("{}", serialized); - Ok(()) -} From 643c8f89c944d1fa63eb724570bdead7c0a79840 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 19 Oct 2021 13:50:08 +0100 Subject: [PATCH 158/216] Make subxt-cli codegen command work --- cli/Cargo.toml | 15 +++-- cli/src/main.rs | 135 +++++++++++++++++++++++++++-------------- codegen/src/api/mod.rs | 2 +- codegen/src/lib.rs | 5 +- macro/src/lib.rs | 2 +- 5 files changed, 106 insertions(+), 53 deletions(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index ea0ba482d6..c3699e0350 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -4,20 +4,25 @@ version = "0.1.0" edition = "2018" [dependencies] +# perform subxt codegen subxt-codegen = { version = "0.1.0", path = "../codegen" } # parse command line args -argh = "0.1.6" +structopt = "0.3.25" # make the request to a substrate node to get the metadata ureq = { version = "2.2.0", features = ["json"] } # colourful error reports color-eyre = "0.5.11" -# for serializing the metadata +# serialize the metadata serde = { version = "1.0.130", features = ["derive"] } -# for serializing as json +# serialize as json serde_json = "1.0.68" # hex encoded metadata to bytes hex = "0.4.3" # actual metadata types frame-metadata = { version = "14.0.0", features = ["v14", "std"] } -# for decoding bytes into the metadata types -scale = { package = "parity-scale-codec", version = "2.3.0", default-features = false } \ No newline at end of file +# decode bytes into the metadata types +scale = { package = "parity-scale-codec", version = "2.3.0", default-features = false } +# handle urls to communicate with substrate nodes +url = { version = "2.2.2", features = ["serde"] } +# generate the item mod for codegen +syn = "1.0.80" \ No newline at end of file diff --git a/cli/src/main.rs b/cli/src/main.rs index 922c04bffd..8ef5fee93d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -14,61 +14,73 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use argh::FromArgs; use color_eyre::eyre::{self, WrapErr}; use frame_metadata::{ - RuntimeMetadata, RuntimeMetadataPrefixed, + RuntimeMetadataPrefixed, }; -use std::io::{self, Write}; +use scale::{Decode, Input}; +use std::{ + io::{self, Write}, + fs, + path::PathBuf, +}; +use structopt::StructOpt; +use std::io::Read; -#[derive(FromArgs, PartialEq, Debug)] /// Utilities for working with substrate metadata for subxt. -struct SubXt { - #[argh(subcommand)] +#[derive(Debug, StructOpt)] +struct Opts { + #[structopt(subcommand)] command: Command, } -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand)] +#[derive(Debug, StructOpt)] enum Command { - Metadata(MetadataCommand), - Codegen(CodegenCommand), -} - -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "metadata")] -/// Download metadata from a substrate node, for use with `subxt` codegen. -struct MetadataCommand { - /// the url of the substrate node to query for metadata - #[argh(option, default = "String::from(\"http://localhost:9933\")")] - url: String, - /// the format of the metadata to display: `json`, `hex` or `bytes` - #[argh(option, short = 'f', default = "\"json\".to_string()")] - format: String, -} - -#[derive(FromArgs, PartialEq, Debug)] -#[argh(subcommand, name = "codegen")] -/// Invoke subxt codegen from metadata. -struct CodegenCommand { - // todo: from file or download directly from node + /// Download metadata from a substrate node, for use with `subxt` codegen. + #[structopt(name = "metadata")] + Metadata { + /// the url of the substrate node to query for metadata + #[structopt( + name = "url", + long, + parse(try_from_str), + default_value = "http://localhost:9933" + )] + url: url::Url, + /// the format of the metadata to display: `json`, `hex` or `bytes` + #[structopt(long, short, default_value = "json")] + format: String, + }, + /// Generate runtime API code from metadata. + /// + /// # Example (with code formatting) + /// + /// `subxt-cli codegen | rustfmt --edition=2018 --emit=stdout` + Codegen { + /// the url of the substrate node to query for metadata for codegen. + #[structopt( + name = "url", + long, + parse(try_from_str), + )] + url: Option, + /// the path to the encoded metadata file. + #[structopt(short, long, parse(from_os_str))] + file: Option, + }, } fn main() -> color_eyre::Result<()> { color_eyre::install()?; - let args: SubXt = argh::from_env(); + let args = Opts::from_args(); match args.command { - Command::Metadata(args) => { - let json = fetch_metadata(&args.url)?; - let hex_data = json["result"] - .as_str() - .ok_or(eyre::eyre!("metadata result field should be a string"))?; - let bytes = hex::decode(hex_data.trim_start_matches("0x"))?; + Command::Metadata { url, format} => { + let (hex_data, bytes) = fetch_metadata(&url)?; - match args.format.as_str() { + match format.as_str() { "json" => { - let metadata = scale::Decode::decode(&mut &bytes[..])?; + let metadata = ::decode(&mut &bytes[..])?; let json = serde_json::to_string_pretty(&metadata)?; println!("{}", json); Ok(()) @@ -79,17 +91,34 @@ fn main() -> color_eyre::Result<()> { } "bytes" => Ok(io::stdout().write_all(&bytes)?), _ => Err(eyre::eyre!( - "Unsupported format `{}`, expected `json`, `hex` or `bytes`", - args.format - )), + "Unsupported format `{}`, expected `json`, `hex` or `bytes`", + format + )), } }, - Command::Codegen(_codegen) => todo!() + Command::Codegen { url, file } => { + if let Some(file) = file.as_ref() { + if url.is_some() { + eyre::bail!("specify one of `--url` or `--file` but not both") + }; + + let mut file = fs::File::open(file)?; + let mut bytes = Vec::new(); + file.read_to_end(&mut bytes)?; + codegen(&mut &bytes[..])?; + return Ok(()) + } + + let url = url.unwrap_or_else(|| url::Url::parse("http://localhost:9933").expect("default url is valid")); + let (_, bytes) = fetch_metadata(&url)?; + codegen(&mut &bytes[..])?; + return Ok(()) + } } } -fn fetch_metadata(url: &str) -> color_eyre::Result { - let resp = ureq::post(url) +fn fetch_metadata(url: &url::Url) -> color_eyre::Result<(String, Vec)> { + let resp = ureq::post(url.as_str()) .set("Content-Type", "application/json") .send_json(ureq::json!({ "jsonrpc": "2.0", @@ -97,6 +126,22 @@ fn fetch_metadata(url: &str) -> color_eyre::Result { "id": 1 })) .context("error fetching metadata from the substrate node")?; + let json: serde_json::Value = resp.into_json()?; + + let hex_data = json["result"] + .as_str() + .map(ToString::to_string) + .ok_or(eyre::eyre!("metadata result field should be a string"))?; + let bytes = hex::decode(hex_data.trim_start_matches("0x"))?; + + Ok((hex_data, bytes)) +} - Ok(resp.into_json()?) +fn codegen(encoded: &mut I) -> color_eyre::Result<()> { + let metadata = ::decode(encoded)?; + let generator = subxt_codegen::RuntimeGenerator::new(metadata); + let item_mod = syn::parse_quote!( pub mod api {} ); + let runtime_api = generator.generate_runtime(item_mod); + println!("{}", runtime_api); + Ok(()) } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 4cc148a727..9e5e340c0b 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -45,7 +45,7 @@ use std::{ }; use syn::parse_quote; -pub fn generate_runtime_types

(item_mod: syn::ItemMod, path: P) -> TokenStream2 +pub fn generate_runtime_api

(item_mod: syn::ItemMod, path: P) -> TokenStream2 where P: AsRef, { diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 90d08420a5..88cb18c787 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -21,4 +21,7 @@ mod ir; mod struct_def; mod types; -pub use self::api::generate_runtime_types; +pub use self::api::{ + generate_runtime_api, + RuntimeGenerator, +}; diff --git a/macro/src/lib.rs b/macro/src/lib.rs index cb354fb3b3..bff0b7ba3d 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -41,5 +41,5 @@ pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { let root_path = std::path::Path::new(&root); let path = root_path.join(args.runtime_metadata_path); - subxt_codegen::generate_runtime_types(item_mod, &path).into() + subxt_codegen::generate_runtime_api(item_mod, &path).into() } From 77ae552df475c1c917c4c004f1d34a6c5cfddf2f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 19 Oct 2021 13:50:25 +0100 Subject: [PATCH 159/216] Fmt --- cli/src/main.rs | 50 +++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 8ef5fee93d..9c91434a63 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -14,18 +14,25 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use color_eyre::eyre::{self, WrapErr}; -use frame_metadata::{ - RuntimeMetadataPrefixed, +use color_eyre::eyre::{ + self, + WrapErr, +}; +use frame_metadata::RuntimeMetadataPrefixed; +use scale::{ + Decode, + Input, }; -use scale::{Decode, Input}; use std::{ - io::{self, Write}, fs, + io::{ + self, + Read, + Write, + }, path::PathBuf, }; use structopt::StructOpt; -use std::io::Read; /// Utilities for working with substrate metadata for subxt. #[derive(Debug, StructOpt)] @@ -58,11 +65,7 @@ enum Command { /// `subxt-cli codegen | rustfmt --edition=2018 --emit=stdout` Codegen { /// the url of the substrate node to query for metadata for codegen. - #[structopt( - name = "url", - long, - parse(try_from_str), - )] + #[structopt(name = "url", long, parse(try_from_str))] url: Option, /// the path to the encoded metadata file. #[structopt(short, long, parse(from_os_str))] @@ -75,12 +78,13 @@ fn main() -> color_eyre::Result<()> { let args = Opts::from_args(); match args.command { - Command::Metadata { url, format} => { + Command::Metadata { url, format } => { let (hex_data, bytes) = fetch_metadata(&url)?; match format.as_str() { "json" => { - let metadata = ::decode(&mut &bytes[..])?; + let metadata = + ::decode(&mut &bytes[..])?; let json = serde_json::to_string_pretty(&metadata)?; println!("{}", json); Ok(()) @@ -90,12 +94,14 @@ fn main() -> color_eyre::Result<()> { Ok(()) } "bytes" => Ok(io::stdout().write_all(&bytes)?), - _ => Err(eyre::eyre!( - "Unsupported format `{}`, expected `json`, `hex` or `bytes`", - format - )), + _ => { + Err(eyre::eyre!( + "Unsupported format `{}`, expected `json`, `hex` or `bytes`", + format + )) + } } - }, + } Command::Codegen { url, file } => { if let Some(file) = file.as_ref() { if url.is_some() { @@ -109,7 +115,9 @@ fn main() -> color_eyre::Result<()> { return Ok(()) } - let url = url.unwrap_or_else(|| url::Url::parse("http://localhost:9933").expect("default url is valid")); + let url = url.unwrap_or_else(|| { + url::Url::parse("http://localhost:9933").expect("default url is valid") + }); let (_, bytes) = fetch_metadata(&url)?; codegen(&mut &bytes[..])?; return Ok(()) @@ -140,7 +148,9 @@ fn fetch_metadata(url: &url::Url) -> color_eyre::Result<(String, Vec)> { fn codegen(encoded: &mut I) -> color_eyre::Result<()> { let metadata = ::decode(encoded)?; let generator = subxt_codegen::RuntimeGenerator::new(metadata); - let item_mod = syn::parse_quote!( pub mod api {} ); + let item_mod = syn::parse_quote!( + pub mod api {} + ); let runtime_api = generator.generate_runtime(item_mod); println!("{}", runtime_api); Ok(()) From a0447ffa212dd7671ff6a6080c0c1de83197385a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 19 Oct 2021 17:22:49 +0100 Subject: [PATCH 160/216] Add polkadot codegen test --- tests/integration/codegen/mod.rs | 21 + tests/integration/codegen/polkadot.rs | 17687 ++++++++++++++++++++++++ tests/integration/main.rs | 1 + 3 files changed, 17709 insertions(+) create mode 100644 tests/integration/codegen/mod.rs create mode 100644 tests/integration/codegen/polkadot.rs diff --git a/tests/integration/codegen/mod.rs b/tests/integration/codegen/mod.rs new file mode 100644 index 0000000000..c79e02bfd9 --- /dev/null +++ b/tests/integration/codegen/mod.rs @@ -0,0 +1,21 @@ +// Copyright 2019-2021 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 . + +/// generate by: +/// +/// - run `polkadot --dev --tmp` node locally +/// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs` +mod polkadot; \ No newline at end of file diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs new file mode 100644 index 0000000000..ad4dda628e --- /dev/null +++ b/tests/integration/codegen/polkadot.rs @@ -0,0 +1,17687 @@ +#[allow(dead_code, unused_imports, non_camel_case_types)] +pub mod api { + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Event { + #[codec(index = 0)] + System(system::Event), + #[codec(index = 1)] + Scheduler(scheduler::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 = 35)] + Tips(tips::Event), + #[codec(index = 36)] + ElectionProviderMultiPhase(election_provider_multi_phase::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 = 70)] + Registrar(registrar::Event), + #[codec(index = 71)] + Slots(slots::Event), + #[codec(index = 72)] + Auctions(auctions::Event), + #[codec(index = 73)] + Crowdloan(crowdloan::Event), + } + pub mod system { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct FillBlock { + pub ratio: ::subxt::sp_arithmetic::per_things::Perbill, + } + impl ::subxt::Call for FillBlock { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "fill_block"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Remark { + pub remark: Vec, + } + impl ::subxt::Call for Remark { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "remark"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHeapPages { + pub pages: u64, + } + impl ::subxt::Call for SetHeapPages { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_heap_pages"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetCode { + pub code: Vec, + } + impl ::subxt::Call for SetCode { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_code"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetCodeWithoutChecks { + pub code: Vec, + } + impl ::subxt::Call for SetCodeWithoutChecks { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_code_without_checks"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetChangesTrieConfig { + pub changes_trie_config: Option< + runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, + >, + } + impl ::subxt::Call for SetChangesTrieConfig { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_changes_trie_config"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetStorage { + pub items: Vec<(Vec, Vec)>, + } + impl ::subxt::Call for SetStorage { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_storage"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct KillStorage { + pub keys: Vec>, + } + impl ::subxt::Call for KillStorage { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "kill_storage"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct KillPrefix { + pub prefix: Vec, + pub subkeys: u32, + } + impl ::subxt::Call for KillPrefix { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "kill_prefix"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemarkWithEvent { + pub remark: Vec, + } + impl ::subxt::Call for RemarkWithEvent { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "remark_with_event"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn fill_block( + &self, + ratio: ::subxt::sp_arithmetic::per_things::Perbill, + ) -> ::subxt::SubmittableExtrinsic { + let call = FillBlock { ratio }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remark( + &self, + remark: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Remark { remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_heap_pages( + &self, + pages: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetHeapPages { pages }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_code( + &self, + code: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetCode { code }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_code_without_checks( + &self, + code: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetCodeWithoutChecks { code }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_changes_trie_config( + &self, + changes_trie_config: Option< + runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetChangesTrieConfig { + changes_trie_config, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_storage( + &self, + items: Vec<(Vec, Vec)>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetStorage { items }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_storage( + &self, + keys: Vec>, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillStorage { keys }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_prefix( + &self, + prefix: Vec, + subkeys: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillPrefix { prefix, subkeys }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remark_with_event( + &self, + remark: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemarkWithEvent { remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::frame_system::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ExtrinsicSuccess( + pub runtime_types::frame_support::weights::DispatchInfo, + ); + impl ::subxt::Event for ExtrinsicSuccess { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicSuccess"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ExtrinsicFailed( + pub runtime_types::sp_runtime::DispatchError, + pub runtime_types::frame_support::weights::DispatchInfo, + ); + impl ::subxt::Event for ExtrinsicFailed { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicFailed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CodeUpdated {} + impl ::subxt::Event for CodeUpdated { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "CodeUpdated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewAccount(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for NewAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "NewAccount"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct KilledAccount(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for KilledAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "KilledAccount"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Remarked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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(pub ::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< + u32, + runtime_types::pallet_balances::AccountData, + >; + 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 = 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; + 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct BlockHash(pub 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(pub u32); + impl ::subxt::StorageEntry for ExtrinsicData { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExtrinsicData"; + type Value = Vec; + 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 = 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< + ::subxt::sp_core::H256, + >; + 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 = 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EventTopics(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for EventTopics { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "EventTopics"; + type Value = Vec<(u32, 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 = 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 = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ExecutionPhase; + impl ::subxt::StorageEntry for ExecutionPhase { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExecutionPhase"; + type Value = runtime_types::frame_system::Phase; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn account( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_system::AccountInfo< + u32, + runtime_types::pallet_balances::AccountData, + >, + ::subxt::Error, + > { + let entry = Account(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn extrinsic_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = ExtrinsicCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn block_weight( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::weights::PerDispatchClass, + ::subxt::Error, + > { + let entry = BlockWeight; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn all_extrinsics_len( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = AllExtrinsicsLen; + self.client.storage().fetch(&entry, hash).await + } + pub async fn block_hash( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = BlockHash(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn extrinsic_data( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> { + let entry = ExtrinsicData(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn number( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Number; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn parent_hash( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = ParentHash; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn digest( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_runtime::generic::digest::Digest< + ::subxt::sp_core::H256, + >, + ::subxt::Error, + > { + let entry = Digest; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn events( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::frame_system::EventRecord< + runtime_types::polkadot_runtime::Event, + ::subxt::sp_core::H256, + >, + >, + ::subxt::Error, + > { + let entry = Events; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn event_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = EventCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn event_topics( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = EventTopics(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn last_runtime_upgrade( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_system::LastRuntimeUpgradeInfo, + >, + ::subxt::Error, + > { + let entry = LastRuntimeUpgrade; + self.client.storage().fetch(&entry, hash).await + } + pub async fn upgraded_to_u32_ref_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = UpgradedToU32RefCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn upgraded_to_triple_ref_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = UpgradedToTripleRefCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn execution_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ExecutionPhase; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod scheduler { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Schedule { + pub when: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for Schedule { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Cancel { + pub when: u32, + pub index: u32, + } + impl ::subxt::Call for Cancel { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ScheduleNamed { + pub id: Vec, + pub when: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelNamed { + pub id: Vec, + } + impl ::subxt::Call for CancelNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel_named"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ScheduleAfter { + pub after: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_after"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ScheduleNamedAfter { + pub id: Vec, + pub after: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named_after"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn schedule( + &self, + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Schedule { + when, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel( + &self, + when: u32, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Cancel { when, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named( + &self, + id: Vec, + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_named( + &self, + id: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelNamed { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_after( + &self, + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ScheduleAfter { + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named_after( + &self, + id: Vec, + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Scheduled(pub u32, pub u32); + impl ::subxt::Event for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Canceled(pub u32, pub u32); + impl ::subxt::Event for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Dispatched( + pub (u32, u32), + pub Option>, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Agenda(pub u32); + impl ::subxt::StorageEntry for Agenda { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Agenda"; + type Value = Vec< + Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::polkadot_runtime::Call, + 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(pub Vec); + impl ::subxt::StorageEntry for Lookup { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Lookup"; + type Value = (u32, u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_scheduler::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 agenda( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::polkadot_runtime::Call, + u32, + runtime_types::polkadot_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >, + ::subxt::Error, + > { + let entry = Agenda(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lookup( + &self, + _0: Vec, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<(u32, u32)>, + ::subxt::Error, + > { + let entry = Lookup(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_scheduler::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod babe { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReportEquivocation { + pub equivocation_proof: + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header< + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header< + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn report_equivocation( + &self, + equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocation { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn report_equivocation_unsigned( + &self, + equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocationUnsigned { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn plan_config_change( + &self, + config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, + ) -> ::subxt::SubmittableExtrinsic { + let call = PlanConfigChange { config }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 = 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 , 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 = [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 = [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 , 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UnderConstruction(pub 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< + [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 = Option<[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 = Option<[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 = (u32, 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EpochConfig; + impl ::subxt::StorageEntry for EpochConfig { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "EpochConfig"; + type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextEpochConfig; + impl ::subxt::StorageEntry for NextEpochConfig { + const PALLET: &'static str = "Babe"; + const STORAGE: &'static str = "NextEpochConfig"; + type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn epoch_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = EpochIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn authorities (& self , 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 , u64 ,) > , :: subxt :: Error >{ + let entry = Authorities; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn genesis_slot( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_consensus_slots::Slot, + ::subxt::Error, + > { + let entry = GenesisSlot; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_slot( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_consensus_slots::Slot, + ::subxt::Error, + > { + let entry = CurrentSlot; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn randomness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<[u8; 32usize], ::subxt::Error> + { + let entry = Randomness; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn pending_epoch_config_change( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + >, + ::subxt::Error, + > { + let entry = PendingEpochConfigChange; + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_randomness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<[u8; 32usize], ::subxt::Error> + { + let entry = NextRandomness; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn next_authorities (& self , 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 , u64 ,) > , :: subxt :: Error >{ + let entry = NextAuthorities; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn segment_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = SegmentIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn under_construction( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + [u8; 32usize], + >, + ::subxt::Error, + > { + let entry = UnderConstruction(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn initialized( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option>, + ::subxt::Error, + > { + let entry = Initialized; + self.client.storage().fetch(&entry, hash).await + } + pub async fn author_vrf_randomness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = AuthorVrfRandomness; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn epoch_start( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<(u32, u32), ::subxt::Error> { + let entry = EpochStart; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lateness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Lateness; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn epoch_config( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::Error, + > { + let entry = EpochConfig; + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_epoch_config( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::Error, + > { + let entry = NextEpochConfig; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod timestamp { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Set { + #[codec(compact)] + pub now: u64, + } + impl ::subxt::Call for Set { + const PALLET: &'static str = "Timestamp"; + const FUNCTION: &'static str = "set"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set(&self, now: u64) -> ::subxt::SubmittableExtrinsic { + let call = Set { now }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 = 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 = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn now( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Now; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn did_update( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = DidUpdate; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod indices { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Claim { + pub index: u32, + } + impl ::subxt::Call for Claim { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "claim"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Transfer { + pub new: ::subxt::sp_core::crypto::AccountId32, + pub index: u32, + } + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Free { + pub index: u32, + } + impl ::subxt::Call for Free { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "free"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceTransfer { + pub new: ::subxt::sp_core::crypto::AccountId32, + pub index: u32, + pub freeze: bool, + } + impl ::subxt::Call for ForceTransfer { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "force_transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Freeze { + pub index: u32, + } + impl ::subxt::Call for Freeze { + const PALLET: &'static str = "Indices"; + const FUNCTION: &'static str = "freeze"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn claim( + &self, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Claim { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { new, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn free(&self, index: u32) -> ::subxt::SubmittableExtrinsic { + let call = Free { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_transfer( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + index: u32, + freeze: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceTransfer { new, index, freeze }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze( + &self, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Freeze { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_indices::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IndexAssigned(pub ::subxt::sp_core::crypto::AccountId32, pub u32); + impl ::subxt::Event for IndexAssigned { + const PALLET: &'static str = "Indices"; + const EVENT: &'static str = "IndexAssigned"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IndexFreed(pub u32); + impl ::subxt::Event for IndexFreed { + const PALLET: &'static str = "Indices"; + const EVENT: &'static str = "IndexFreed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IndexFrozen(pub u32, pub ::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(pub u32); + impl ::subxt::StorageEntry for Accounts { + const PALLET: &'static str = "Indices"; + const STORAGE: &'static str = "Accounts"; + type Value = (::subxt::sp_core::crypto::AccountId32, u128, bool); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn accounts( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + u128, + bool, + )>, + ::subxt::Error, + > { + let entry = Accounts(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod balances { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Transfer { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: u128, + } + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetBalance { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub new_free: u128, + #[codec(compact)] + pub new_reserved: u128, + } + impl ::subxt::Call for SetBalance { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "set_balance"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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: u128, + } + impl ::subxt::Call for ForceTransfer { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "force_transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TransferKeepAlive { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: u128, + } + impl ::subxt::Call for TransferKeepAlive { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "transfer_keep_alive"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TransferAll { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub keep_alive: bool, + } + impl ::subxt::Call for TransferAll { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "transfer_all"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceUnreserve { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub amount: u128, + } + impl ::subxt::Call for ForceUnreserve { + const PALLET: &'static str = "Balances"; + const FUNCTION: &'static str = "force_unreserve"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn transfer( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { dest, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_balance( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + new_free: u128, + new_reserved: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetBalance { + who, + new_free, + new_reserved, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceTransfer { + source, + dest, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_keep_alive( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferKeepAlive { dest, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_all( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + keep_alive: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferAll { dest, keep_alive }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_unreserve( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + amount: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceUnreserve { who, amount }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_balances::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Endowed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Endowed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Endowed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct DustLost(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for DustLost { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "DustLost"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Transfer( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for Transfer { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BalanceSet( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + pub u128, + ); + impl ::subxt::Event for BalanceSet { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "BalanceSet"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Deposit(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Deposit"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Reserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Reserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Reserved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Unreserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Unreserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Unreserved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReserveRepatriated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + pub runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + ); + impl ::subxt::Event for ReserveRepatriated { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "ReserveRepatriated"; + } + } + 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 = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Account(pub ::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; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Locks(pub ::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 < u128 > > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Reserves(pub ::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<[u8; 8usize], u128>, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Balances"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_balances::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn total_issuance( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = TotalIssuance; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn account( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_balances::AccountData, + ::subxt::Error, + > { + let entry = Account(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < u128 > > , :: subxt :: Error >{ + let entry = Locks(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn reserves( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData<[u8; 8usize], u128>, + >, + ::subxt::Error, + > { + let entry = Reserves(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_balances::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod transaction_payment { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct NextFeeMultiplier; + impl ::subxt::StorageEntry for NextFeeMultiplier { + const PALLET: &'static str = "TransactionPayment"; + const STORAGE: &'static str = "NextFeeMultiplier"; + type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "TransactionPayment"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_transaction_payment::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn next_fee_multiplier( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::fixed_point::FixedU128, + ::subxt::Error, + > { + let entry = NextFeeMultiplier; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_transaction_payment::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod authorship { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetUncles { + pub new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_uncles( + &self, + new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetUncles { new_uncles }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 = Vec< + runtime_types::pallet_authorship::UncleEntryItem< + 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 = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn uncles( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_authorship::UncleEntryItem< + u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Uncles; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn author( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Author; + self.client.storage().fetch(&entry, hash).await + } + pub async fn did_set_uncles( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = DidSetUncles; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod staking { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Bond { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BondExtra { + #[codec(compact)] + pub max_additional: u128, + } + impl ::subxt::Call for BondExtra { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "bond_extra"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Unbond { + #[codec(compact)] + pub value: u128, + } + impl ::subxt::Call for Unbond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "unbond"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct WithdrawUnbonded { + pub num_slashing_spans: u32, + } + impl ::subxt::Call for WithdrawUnbonded { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "withdraw_unbonded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Nominate { + pub targets: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Chill {} + impl ::subxt::Call for Chill { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetValidatorCount { + #[codec(compact)] + pub new: u32, + } + impl ::subxt::Call for SetValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_validator_count"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IncreaseValidatorCount { + #[codec(compact)] + pub additional: u32, + } + impl ::subxt::Call for IncreaseValidatorCount { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "increase_validator_count"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceNoEras {} + impl ::subxt::Call for ForceNoEras { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_no_eras"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceNewEra {} + impl ::subxt::Call for ForceNewEra { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_new_era"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetInvulnerables { + pub invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for SetInvulnerables { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_invulnerables"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceUnstake { + pub stash: ::subxt::sp_core::crypto::AccountId32, + pub num_slashing_spans: u32, + } + impl ::subxt::Call for ForceUnstake { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_unstake"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceNewEraAlways {} + impl ::subxt::Call for ForceNewEraAlways { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_new_era_always"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelDeferredSlash { + pub era: u32, + pub slash_indices: Vec, + } + impl ::subxt::Call for CancelDeferredSlash { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "cancel_deferred_slash"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PayoutStakers { + pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + pub era: u32, + } + impl ::subxt::Call for PayoutStakers { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "payout_stakers"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Rebond { + #[codec(compact)] + pub value: u128, + } + impl ::subxt::Call for Rebond { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "rebond"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHistoryDepth { + #[codec(compact)] + pub new_history_depth: u32, + #[codec(compact)] + pub era_items_deleted: u32, + } + impl ::subxt::Call for SetHistoryDepth { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_history_depth"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReapStash { + pub stash: ::subxt::sp_core::crypto::AccountId32, + pub num_slashing_spans: u32, + } + impl ::subxt::Call for ReapStash { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "reap_stash"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Kick { + pub who: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetStakingLimits { + pub min_nominator_bond: u128, + pub min_validator_bond: u128, + pub max_nominator_count: Option, + pub max_validator_count: Option, + pub threshold: Option, + } + impl ::subxt::Call for SetStakingLimits { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_staking_limits"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ChillOther { + pub controller: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ChillOther { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill_other"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn bond( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + value: u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Bond { + controller, + value, + payee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn bond_extra( + &self, + max_additional: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = BondExtra { max_additional }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unbond( + &self, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unbond { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn withdraw_unbonded( + &self, + num_slashing_spans: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = WithdrawUnbonded { num_slashing_spans }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn validate( + &self, + prefs: runtime_types::pallet_staking::ValidatorPrefs, + ) -> ::subxt::SubmittableExtrinsic { + let call = Validate { prefs }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn nominate( + &self, + targets: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Nominate { targets }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn chill(&self) -> ::subxt::SubmittableExtrinsic { + let call = Chill {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_payee( + &self, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetPayee { payee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_controller( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetController { controller }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_validator_count( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetValidatorCount { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn increase_validator_count( + &self, + additional: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = IncreaseValidatorCount { additional }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn scale_validator_count( + &self, + factor: runtime_types::sp_arithmetic::per_things::Percent, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ScaleValidatorCount { factor }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_no_eras( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNoEras {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_new_era( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNewEra {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_invulnerables( + &self, + invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetInvulnerables { invulnerables }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_unstake( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceUnstake { + stash, + num_slashing_spans, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_new_era_always( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNewEraAlways {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_deferred_slash( + &self, + era: u32, + slash_indices: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = CancelDeferredSlash { era, slash_indices }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn payout_stakers( + &self, + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = PayoutStakers { + validator_stash, + era, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rebond( + &self, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Rebond { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_history_depth( + &self, + new_history_depth: u32, + era_items_deleted: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetHistoryDepth { + new_history_depth, + era_items_deleted, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reap_stash( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReapStash { + stash, + num_slashing_spans, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kick( + &self, + who: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Kick { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_staking_limits( + &self, + min_nominator_bond: u128, + min_validator_bond: u128, + max_nominator_count: Option, + max_validator_count: Option, + threshold: Option, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetStakingLimits { + min_nominator_bond, + min_validator_bond, + max_nominator_count, + max_validator_count, + threshold, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn chill_other( + &self, + controller: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ChillOther { controller }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EraPaid(pub u32, pub u128, pub u128); + impl ::subxt::Event for EraPaid { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "EraPaid"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Slashed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OldSlashingReportDiscarded(pub u32); + impl ::subxt::Event for OldSlashingReportDiscarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "OldSlashingReportDiscarded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct StakersElected {} + impl ::subxt::Event for StakersElected { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakersElected"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Bonded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Bonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Bonded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Unbonded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Unbonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Unbonded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Withdrawn(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Withdrawn { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Withdrawn"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct StakingElectionFailed {} + impl ::subxt::Event for StakingElectionFailed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakingElectionFailed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PayoutStarted(pub 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 = 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 = 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 = 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 = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bonded(pub ::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 = 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 = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Ledger(pub ::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, + u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct Payee(pub ::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(pub ::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 = 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Nominators(pub ::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< + ::subxt::sp_core::crypto::AccountId32, + >; + 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 = 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 = 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 = 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(pub u32); + impl ::subxt::StorageEntry for ErasStartSessionIndex { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasStartSessionIndex"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasStakers(u32, ::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, + 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(u32, ::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, + 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(u32, ::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(pub u32); + impl ::subxt::StorageEntry for ErasValidatorReward { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasValidatorReward"; + type Value = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ErasRewardPoints(pub 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(pub u32); + impl ::subxt::StorageEntry for ErasTotalStake { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ErasTotalStake"; + type Value = 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 = ::subxt::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 = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UnappliedSlashes(pub u32); + impl ::subxt::StorageEntry for UnappliedSlashes { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "UnappliedSlashes"; + type Value = Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::sp_core::crypto::AccountId32, + 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 = Vec<(u32, u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ValidatorSlashInEra(u32, ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for ValidatorSlashInEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ValidatorSlashInEra"; + type Value = (::subxt::sp_arithmetic::per_things::Perbill, 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(u32, ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for NominatorSlashInEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "NominatorSlashInEra"; + type Value = 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(pub ::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(::subxt::sp_core::crypto::AccountId32, u32); + impl ::subxt::StorageEntry for SpanSlash { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "SpanSlash"; + type Value = runtime_types::pallet_staking::slashing::SpanRecord; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct EarliestUnappliedSlash; + impl ::subxt::StorageEntry for EarliestUnappliedSlash { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "EarliestUnappliedSlash"; + type Value = 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_staking::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ChillThreshold; + impl ::subxt::StorageEntry for ChillThreshold { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ChillThreshold"; + type Value = runtime_types::sp_arithmetic::per_things::Percent; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn history_depth( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = HistoryDepth; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validator_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ValidatorCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn minimum_validator_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = MinimumValidatorCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn invulnerables( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Invulnerables; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bonded( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Bonded(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn min_nominator_bond( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = MinNominatorBond; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn min_validator_bond( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = MinValidatorBond; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn ledger( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::StakingLedger< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Ledger(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn payee( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::Error, + > { + let entry = Payee(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validators( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::ValidatorPrefs, + ::subxt::Error, + > { + let entry = Validators(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn counter_for_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CounterForValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_validators_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = MaxValidatorsCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominators( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::Nominations< + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Nominators(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn counter_for_nominators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CounterForNominators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_nominators_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = MaxNominatorsCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = CurrentEra; + self.client.storage().fetch(&entry, hash).await + } + pub async fn active_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ActiveEra; + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_start_session_index( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = ErasStartSessionIndex(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_stakers( + &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + ::subxt::Error, + > { + let entry = ErasStakers(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_stakers_clipped( + &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + ::subxt::Error, + > { + let entry = ErasStakersClipped(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_validator_prefs( + &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::ValidatorPrefs, + ::subxt::Error, + > { + let entry = ErasValidatorPrefs(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_validator_reward( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = ErasValidatorReward(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_reward_points( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::Error, + > { + let entry = ErasRewardPoints(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_total_stake( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ErasTotalStake(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn force_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Forcing, + ::subxt::Error, + > { + let entry = ForceEra; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn slash_reward_fraction( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::sp_arithmetic::per_things::Perbill, + ::subxt::Error, + > { + let entry = SlashRewardFraction; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn canceled_slash_payout( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CanceledSlashPayout; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn unapplied_slashes( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = UnappliedSlashes(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bonded_eras( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = BondedEras; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validator_slash_in_era( + &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_arithmetic::per_things::Perbill, + u128, + )>, + ::subxt::Error, + > { + let entry = ValidatorSlashInEra(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominator_slash_in_era( + &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = NominatorSlashInEra(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn slashing_spans( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + ::subxt::Error, + > { + let entry = SlashingSpans(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn span_slash( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::slashing::SpanRecord, + ::subxt::Error, + > { + let entry = SpanSlash(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn earliest_unapplied_slash( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = EarliestUnappliedSlash; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_planned_session( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CurrentPlannedSession; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn chill_threshold( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ::subxt::Error, + > { + let entry = ChillThreshold; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod offences { + use super::runtime_types; + pub type Event = runtime_types::pallet_offences::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Offence(pub [u8; 16usize], pub Vec); + 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(pub ::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, + u128, + >, + ), + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ConcurrentReportsIndex([u8; 16usize], Vec); + impl ::subxt::StorageEntry for ConcurrentReportsIndex { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ConcurrentReportsIndex"; + type Value = 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(pub [u8; 16usize]); + impl ::subxt::StorageEntry for ReportsByKindIndex { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ReportsByKindIndex"; + type Value = 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 } + } + pub async fn reports( + &self, + _0: ::subxt::sp_core::H256, + 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, + u128, + >, + ), + >, + >, + ::subxt::Error, + > { + let entry = Reports(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn concurrent_reports_index( + &self, + _0: [u8; 16usize], + _1: Vec, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = ConcurrentReportsIndex(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn reports_by_kind_index( + &self, + _0: [u8; 16usize], + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> { + let entry = ReportsByKindIndex(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod historical { + use super::runtime_types; + } + pub mod session { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetKeys { + pub keys: runtime_types::polkadot_runtime::SessionKeys, + pub proof: Vec, + } + impl ::subxt::Call for SetKeys { + const PALLET: &'static str = "Session"; + const FUNCTION: &'static str = "set_keys"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_keys( + &self, + keys: runtime_types::polkadot_runtime::SessionKeys, + proof: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetKeys { keys, proof }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn purge_keys(&self) -> ::subxt::SubmittableExtrinsic { + let call = PurgeKeys {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_session::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewSession(pub 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 = 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 = 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 = 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 = 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 = Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextKeys(pub ::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(runtime_types::sp_core::crypto::KeyTypeId, Vec); + 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, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Validators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CurrentIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queued_changed( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = QueuedChanged; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queued_keys( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::SessionKeys, + )>, + ::subxt::Error, + > { + let entry = QueuedKeys; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn disabled_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> { + let entry = DisabledValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_keys( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = NextKeys(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn key_owner( + &self, + _0: runtime_types::sp_core::crypto::KeyTypeId, + _1: Vec, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = KeyOwner(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod grandpa { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReportEquivocation { + pub equivocation_proof: + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NoteStalled { + pub delay: u32, + pub best_finalized_block_number: u32, + } + impl ::subxt::Call for NoteStalled { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "note_stalled"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn report_equivocation( + &self, + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocation { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn report_equivocation_unsigned( + &self, + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocationUnsigned { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_stalled( + &self, + delay: u32, + best_finalized_block_number: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = NoteStalled { + delay, + best_finalized_block_number, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_grandpa::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewAuthorities( + pub Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, + ); + impl ::subxt::Event for NewAuthorities { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "NewAuthorities"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Paused {} + impl ::subxt::Event for Paused { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "Paused"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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; + 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; + 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 = 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 = (u32, 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 = u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SetIdSession(pub u64); + impl ::subxt::StorageEntry for SetIdSession { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "SetIdSession"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn state( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_grandpa::StoredState, + ::subxt::Error, + > { + let entry = State; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn pending_change( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_grandpa::StoredPendingChange, + >, + ::subxt::Error, + > { + let entry = PendingChange; + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_forced( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = NextForced; + self.client.storage().fetch(&entry, hash).await + } + pub async fn stalled( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<(u32, u32)>, + ::subxt::Error, + > { + let entry = Stalled; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_set_id( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CurrentSetId; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn set_id_session( + &self, + _0: u64, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = SetIdSession(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod im_online { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Heartbeat { + pub heartbeat: runtime_types::pallet_im_online::Heartbeat, + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn heartbeat( + &self, + heartbeat: runtime_types::pallet_im_online::Heartbeat, + signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, + ) -> ::subxt::SubmittableExtrinsic { + let call = Heartbeat { + heartbeat, + signature, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_im_online::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct HeartbeatReceived( + pub 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AllGood {} + impl ::subxt::Event for AllGood { + const PALLET: &'static str = "ImOnline"; + const EVENT: &'static str = "AllGood"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SomeOffline( + pub Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + 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 = 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(u32, 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(u32, ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for AuthoredBlocks { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "AuthoredBlocks"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn heartbeat_after( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = HeartbeatAfter; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn keys (& self , 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 :: Error >{ + let entry = Keys; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn received_heartbeats( + &self, + _0: u32, + _1: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, + >, + ::subxt::Error, + > { + let entry = ReceivedHeartbeats(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn authored_blocks( + &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = AuthoredBlocks(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod authority_discovery { + use super::runtime_types; + } + pub mod democracy { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Propose { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub value: u128, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "propose"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Second { + #[codec(compact)] + pub proposal: u32, + #[codec(compact)] + pub seconds_upper_bound: u32, + } + impl ::subxt::Call for Second { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "second"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Vote { + #[codec(compact)] + pub ref_index: u32, + pub vote: runtime_types::pallet_democracy::vote::AccountVote, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "vote"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EmergencyCancel { + pub ref_index: u32, + } + impl ::subxt::Call for EmergencyCancel { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "emergency_cancel"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct FastTrack { + pub proposal_hash: ::subxt::sp_core::H256, + pub voting_period: u32, + pub delay: u32, + } + impl ::subxt::Call for FastTrack { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "fast_track"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelReferendum { + #[codec(compact)] + pub ref_index: u32, + } + impl ::subxt::Call for CancelReferendum { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_referendum"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelQueued { + pub which: u32, + } + impl ::subxt::Call for CancelQueued { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_queued"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Delegate { + pub to: ::subxt::sp_core::crypto::AccountId32, + pub conviction: runtime_types::pallet_democracy::conviction::Conviction, + pub balance: u128, + } + impl ::subxt::Call for Delegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "delegate"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Undelegate {} + impl ::subxt::Call for Undelegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "undelegate"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ClearPublicProposals {} + impl ::subxt::Call for ClearPublicProposals { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "clear_public_proposals"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NotePreimage { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NotePreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NotePreimageOperational { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NotePreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage_operational"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NoteImminentPreimage { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NoteImminentPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NoteImminentPreimageOperational { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NoteImminentPreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage_operational"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReapPreimage { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub proposal_len_upper_bound: u32, + } + impl ::subxt::Call for ReapPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "reap_preimage"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemoveVote { + pub index: u32, + } + impl ::subxt::Call for RemoveVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_vote"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemoveOtherVote { + pub target: ::subxt::sp_core::crypto::AccountId32, + pub index: u32, + } + impl ::subxt::Call for RemoveOtherVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_other_vote"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EnactProposal { + pub proposal_hash: ::subxt::sp_core::H256, + pub index: u32, + } + impl ::subxt::Call for EnactProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "enact_proposal"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Blacklist { + pub proposal_hash: ::subxt::sp_core::H256, + pub maybe_ref_index: Option, + } + impl ::subxt::Call for Blacklist { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "blacklist"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelProposal { + #[codec(compact)] + pub prop_index: u32, + } + impl ::subxt::Call for CancelProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_proposal"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + proposal_hash, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn second( + &self, + proposal: u32, + seconds_upper_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Second { + proposal, + seconds_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + ref_index: u32, + vote: runtime_types::pallet_democracy::vote::AccountVote, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { ref_index, vote }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn emergency_cancel( + &self, + ref_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = EmergencyCancel { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = ExternalPropose { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose_majority( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExternalProposeMajority { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose_default( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExternalProposeDefault { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn fast_track( + &self, + proposal_hash: ::subxt::sp_core::H256, + voting_period: u32, + delay: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FastTrack { + proposal_hash, + voting_period, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn veto_external( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = VetoExternal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_referendum( + &self, + ref_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelReferendum { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_queued( + &self, + which: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelQueued { which }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn delegate( + &self, + to: ::subxt::sp_core::crypto::AccountId32, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + balance: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Delegate { + to, + conviction, + balance, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn undelegate(&self) -> ::subxt::SubmittableExtrinsic { + let call = Undelegate {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_public_proposals( + &self, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ClearPublicProposals {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_preimage( + &self, + encoded_proposal: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = NotePreimage { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_preimage_operational( + &self, + encoded_proposal: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = NotePreimageOperational { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_imminent_preimage( + &self, + encoded_proposal: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = NoteImminentPreimage { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_imminent_preimage_operational( + &self, + encoded_proposal: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = NoteImminentPreimageOperational { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reap_preimage( + &self, + proposal_hash: ::subxt::sp_core::H256, + proposal_len_upper_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReapPreimage { + proposal_hash, + proposal_len_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unlock( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unlock { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_vote( + &self, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveVote { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_other_vote( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveOtherVote { target, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn enact_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = EnactProposal { + proposal_hash, + index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn blacklist( + &self, + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: Option, + ) -> ::subxt::SubmittableExtrinsic { + let call = Blacklist { + proposal_hash, + maybe_ref_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_proposal( + &self, + prop_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelProposal { prop_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_democracy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Proposed(pub u32, pub u128); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Proposed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Tabled( + pub u32, + pub u128, + pub Vec<::subxt::sp_core::crypto::AccountId32>, + ); + impl ::subxt::Event for Tabled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Tabled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ExternalTabled {} + impl ::subxt::Event for ExternalTabled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "ExternalTabled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Started( + pub u32, + pub runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ); + impl ::subxt::Event for Started { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Started"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Passed(pub u32); + impl ::subxt::Event for Passed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Passed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NotPassed(pub u32); + impl ::subxt::Event for NotPassed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "NotPassed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Cancelled(pub u32); + impl ::subxt::Event for Cancelled { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Cancelled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Executed( + pub u32, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Executed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Executed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Delegated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Delegated { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Delegated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Undelegated(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Undelegated { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Undelegated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Vetoed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub u32, + ); + impl ::subxt::Event for Vetoed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Vetoed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PreimageNoted( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for PreimageNoted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageNoted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PreimageUsed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for PreimageUsed { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageUsed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PreimageInvalid(pub ::subxt::sp_core::H256, pub u32); + impl ::subxt::Event for PreimageInvalid { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageInvalid"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PreimageMissing(pub ::subxt::sp_core::H256, pub u32); + impl ::subxt::Event for PreimageMissing { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageMissing"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PreimageReaped( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for PreimageReaped { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "PreimageReaped"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Blacklisted(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Blacklisted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Blacklisted"; + } + } + 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 = 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 = Vec<( + u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DepositOf(pub u32); + impl ::subxt::StorageEntry for DepositOf { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "DepositOf"; + type Value = (Vec<::subxt::sp_core::crypto::AccountId32>, u128); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Preimages(pub ::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, + u128, + 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 = 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ReferendumInfoOf(pub u32); + impl ::subxt::StorageEntry for ReferendumInfoOf { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "ReferendumInfoOf"; + type Value = runtime_types::pallet_democracy::types::ReferendumInfo< + u32, + ::subxt::sp_core::H256, + u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct VotingOf(pub ::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< + u128, + ::subxt::sp_core::crypto::AccountId32, + u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Locks(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Locks { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Locks"; + type Value = 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 = 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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Blacklist { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Blacklist"; + type Value = (u32, 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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Cancellations { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Cancellations"; + type Value = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_democracy::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn public_prop_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = PublicPropCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn public_props( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<( + u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>, + ::subxt::Error, + > { + let entry = PublicProps; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn deposit_of( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + Vec<::subxt::sp_core::crypto::AccountId32>, + u128, + )>, + ::subxt::Error, + > { + let entry = DepositOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn preimages( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_democracy::PreimageStatus< + ::subxt::sp_core::crypto::AccountId32, + u128, + u32, + >, + >, + ::subxt::Error, + > { + let entry = Preimages(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn referendum_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ReferendumCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lowest_unbaked( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = LowestUnbaked; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn referendum_info_of( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_democracy::types::ReferendumInfo< + u32, + ::subxt::sp_core::H256, + u128, + >, + >, + ::subxt::Error, + > { + let entry = ReferendumInfoOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_democracy::vote::Voting< + u128, + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ::subxt::Error, + > { + let entry = VotingOf(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn locks( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = Locks(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn last_tabled_was_external( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = LastTabledWasExternal; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_external( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + )>, + ::subxt::Error, + > { + let entry = NextExternal; + self.client.storage().fetch(&entry, hash).await + } + pub async fn blacklist( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + u32, + Vec<::subxt::sp_core::crypto::AccountId32>, + )>, + ::subxt::Error, + > { + let entry = Blacklist(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn cancellations( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Cancellations(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod council { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMembers { + pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + pub prime: Option<::subxt::sp_core::crypto::AccountId32>, + pub old_count: u32, + } + impl ::subxt::Call for SetMembers { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "set_members"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Execute { + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: u32, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "execute"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Propose { + #[codec(compact)] + pub threshold: u32, + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: u32, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "propose"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Vote { + pub proposal: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: u32, + pub approve: bool, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "vote"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Close { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: u32, + #[codec(compact)] + pub proposal_weight_bound: u64, + #[codec(compact)] + pub length_bound: u32, + } + impl ::subxt::Call for Close { + const PALLET: &'static str = "Council"; + const FUNCTION: &'static str = "close"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_members( + &self, + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: Option<::subxt::sp_core::crypto::AccountId32>, + old_count: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMembers { + new_members, + prime, + old_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn execute( + &self, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Execute { + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose( + &self, + threshold: u32, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + threshold, + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: u32, + approve: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { + proposal, + index, + approve, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: u32, + proposal_weight_bound: u64, + length_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = DisapproveProposal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Proposed( + pub ::subxt::sp_core::crypto::AccountId32, + pub u32, + pub ::subxt::sp_core::H256, + pub u32, + ); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Proposed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Voted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub bool, + pub u32, + pub u32, + ); + impl ::subxt::Event for Voted { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Voted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Approved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Approved { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Approved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Disapproved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Disapproved { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Disapproved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Executed( + pub ::subxt::sp_core::H256, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Executed { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "Executed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MemberExecuted( + pub ::subxt::sp_core::H256, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for MemberExecuted { + const PALLET: &'static str = "Council"; + const EVENT: &'static str = "MemberExecuted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Closed(pub ::subxt::sp_core::H256, pub u32, pub 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(pub ::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(pub ::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, + 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 = 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 = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn proposals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >, + ::subxt::Error, + > { + let entry = Proposals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposal_of( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ProposalOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, + ::subxt::Error, + > { + let entry = Voting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod technical_committee { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMembers { + pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + pub prime: Option<::subxt::sp_core::crypto::AccountId32>, + pub old_count: u32, + } + impl ::subxt::Call for SetMembers { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "set_members"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Execute { + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: u32, + } + impl ::subxt::Call for Execute { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "execute"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Propose { + #[codec(compact)] + pub threshold: u32, + pub proposal: runtime_types::polkadot_runtime::Call, + #[codec(compact)] + pub length_bound: u32, + } + impl ::subxt::Call for Propose { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "propose"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Vote { + pub proposal: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: u32, + pub approve: bool, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "vote"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Close { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub index: u32, + #[codec(compact)] + pub proposal_weight_bound: u64, + #[codec(compact)] + pub length_bound: u32, + } + impl ::subxt::Call for Close { + const PALLET: &'static str = "TechnicalCommittee"; + const FUNCTION: &'static str = "close"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_members( + &self, + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: Option<::subxt::sp_core::crypto::AccountId32>, + old_count: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMembers { + new_members, + prime, + old_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn execute( + &self, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Execute { + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose( + &self, + threshold: u32, + proposal: runtime_types::polkadot_runtime::Call, + length_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + threshold, + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: u32, + approve: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { + proposal, + index, + approve, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: u32, + proposal_weight_bound: u64, + length_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = DisapproveProposal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Proposed( + pub ::subxt::sp_core::crypto::AccountId32, + pub u32, + pub ::subxt::sp_core::H256, + pub u32, + ); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Proposed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Voted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub bool, + pub u32, + pub u32, + ); + impl ::subxt::Event for Voted { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Voted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Approved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Approved { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Approved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Disapproved(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Disapproved { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Disapproved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Executed( + pub ::subxt::sp_core::H256, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Executed { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "Executed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MemberExecuted( + pub ::subxt::sp_core::H256, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for MemberExecuted { + const PALLET: &'static str = "TechnicalCommittee"; + const EVENT: &'static str = "MemberExecuted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Closed(pub ::subxt::sp_core::H256, pub u32, pub 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(pub ::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(pub ::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, + 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 = 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 = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn proposals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >, + ::subxt::Error, + > { + let entry = Proposals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposal_of( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ProposalOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, + ::subxt::Error, + > { + let entry = Voting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod phragmen_election { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Vote { + pub votes: Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + pub value: u128, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "vote"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemoveVoter {} + impl ::subxt::Call for RemoveVoter { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "remove_voter"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SubmitCandidacy { + #[codec(compact)] + pub candidate_count: u32, + } + impl ::subxt::Call for SubmitCandidacy { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "submit_candidacy"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemoveMember { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub has_replacement: bool, + } + impl ::subxt::Call for RemoveMember { + const PALLET: &'static str = "PhragmenElection"; + const FUNCTION: &'static str = "remove_member"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CleanDefunctVoters { + pub num_voters: u32, + pub num_defunct: 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn vote( + &self, + votes: Vec<::subxt::sp_core::crypto::AccountId32>, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { votes, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_voter( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveVoter {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit_candidacy( + &self, + candidate_count: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SubmitCandidacy { candidate_count }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn renounce_candidacy( + &self, + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + ) -> ::subxt::SubmittableExtrinsic { + let call = RenounceCandidacy { renouncing }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_member( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + has_replacement: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveMember { + who, + has_replacement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clean_defunct_voters( + &self, + num_voters: u32, + num_defunct: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = CleanDefunctVoters { + num_voters, + num_defunct, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewTerm(pub Vec<(::subxt::sp_core::crypto::AccountId32, u128)>); + impl ::subxt::Event for NewTerm { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "NewTerm"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EmptyTerm {} + impl ::subxt::Event for EmptyTerm { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "EmptyTerm"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ElectionError {} + impl ::subxt::Event for ElectionError { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "ElectionError"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MemberKicked(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for MemberKicked { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "MemberKicked"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Renounced(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Renounced { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "Renounced"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CandidateSlashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for CandidateSlashed { + const PALLET: &'static str = "PhragmenElection"; + const EVENT: &'static str = "CandidateSlashed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SeatHolderSlashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub 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 = Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + 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 = Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + 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 = Vec<(::subxt::sp_core::crypto::AccountId32, 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Voting(pub ::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, + u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn runners_up( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = RunnersUp; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn candidates( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::subxt::sp_core::crypto::AccountId32, u128)>, + ::subxt::Error, + > { + let entry = Candidates; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn election_rounds( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ElectionRounds; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_elections_phragmen::Voter< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + ::subxt::Error, + > { + let entry = Voting(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod technical_membership { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ResetMembers { + pub members: Vec<::subxt::sp_core::crypto::AccountId32>, + } + impl ::subxt::Call for ResetMembers { + const PALLET: &'static str = "TechnicalMembership"; + const FUNCTION: &'static str = "reset_members"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn add_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddMember { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveMember { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn swap_member( + &self, + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SwapMember { remove, add }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reset_members( + &self, + members: Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = ResetMembers { members }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn change_key( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ChangeKey { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_prime( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetPrime { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_prime( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearPrime {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_membership::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MemberAdded {} + impl ::subxt::Event for MemberAdded { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MemberAdded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MemberRemoved {} + impl ::subxt::Event for MemberRemoved { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MemberRemoved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MembersSwapped {} + impl ::subxt::Event for MembersSwapped { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MembersSwapped"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MembersReset {} + impl ::subxt::Event for MembersReset { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "MembersReset"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct KeyChanged {} + impl ::subxt::Event for KeyChanged { + const PALLET: &'static str = "TechnicalMembership"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 = 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 } + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod treasury { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProposeSpend { + #[codec(compact)] + pub value: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RejectProposal { + #[codec(compact)] + pub proposal_id: u32, + } + impl ::subxt::Call for RejectProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "reject_proposal"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ApproveProposal { + #[codec(compact)] + pub proposal_id: u32, + } + impl ::subxt::Call for ApproveProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "approve_proposal"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn propose_spend( + &self, + value: u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeSpend { value, beneficiary }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reject_proposal( + &self, + proposal_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RejectProposal { proposal_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_proposal( + &self, + proposal_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveProposal { proposal_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Proposed(pub u32); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Proposed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Spending(pub u128); + impl ::subxt::Event for Spending { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Spending"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Awarded( + pub u32, + pub u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Awarded { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Awarded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Rejected(pub u32, pub u128); + impl ::subxt::Event for Rejected { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rejected"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Burnt(pub u128); + impl ::subxt::Event for Burnt { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Burnt"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Rollover(pub u128); + impl ::subxt::Event for Rollover { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rollover"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Deposit(pub 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Proposals(pub 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, + 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; + 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 proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposals( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_treasury::Proposal< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Proposals(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn approvals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + ::subxt::Error, + > { + let entry = Approvals; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod claims { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MintClaim { + pub who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub value: u128, + pub vesting_schedule: Option<(u128, u128, u32)>, + pub statement: + Option, + } + impl ::subxt::Call for MintClaim { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "mint_claim"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ClaimAttest { + pub dest: ::subxt::sp_core::crypto::AccountId32, + pub ethereum_signature: + runtime_types::polkadot_runtime_common::claims::EcdsaSignature, + pub statement: Vec, + } + impl ::subxt::Call for ClaimAttest { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "claim_attest"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Attest { + pub statement: Vec, + } + impl ::subxt::Call for Attest { + const PALLET: &'static str = "Claims"; + const FUNCTION: &'static str = "attest"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MoveClaim { + pub old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub maybe_preclaim: 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn claim( + &self, + dest: ::subxt::sp_core::crypto::AccountId32, + ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, + ) -> ::subxt::SubmittableExtrinsic { + let call = Claim { + dest, + ethereum_signature, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn mint_claim( + &self, + who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + value: u128, + vesting_schedule: Option<(u128, u128, u32)>, + statement: Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = MintClaim { + who, + value, + vesting_schedule, + statement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn claim_attest( + &self, + dest: ::subxt::sp_core::crypto::AccountId32, + ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, + statement: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClaimAttest { + dest, + ethereum_signature, + statement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn attest( + &self, + statement: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Attest { statement }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn move_claim( + &self, + old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + maybe_preclaim: Option<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = MoveClaim { + old, + new, + maybe_preclaim, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Claimed( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + pub 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( + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Claims { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Claims"; + type Value = 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 = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Vesting( + pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + ); + impl ::subxt::StorageEntry for Vesting { + const PALLET: &'static str = "Claims"; + const STORAGE: &'static str = "Vesting"; + type Value = (u128, u128, u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Signing( + pub 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(pub ::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, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = Claims(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn total( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Total; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn vesting( + &self, + _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<(u128, u128, u32)>, + ::subxt::Error, + > { + let entry = Vesting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn signing( + &self, + _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::StatementKind, + >, + ::subxt::Error, + > { + let entry = Signing(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn preclaims( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_common::claims::EthereumAddress, + >, + ::subxt::Error, + > { + let entry = Preclaims(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod vesting { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Vest {} + impl ::subxt::Call for Vest { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct VestedTransfer { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo, + } + impl ::subxt::Call for VestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vested_transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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, + } + impl ::subxt::Call for ForceVestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "force_vested_transfer"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MergeSchedules { + pub schedule1_index: u32, + pub schedule2_index: u32, + } + impl ::subxt::Call for MergeSchedules { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "merge_schedules"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn vest(&self) -> ::subxt::SubmittableExtrinsic { + let call = Vest {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vest_other( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = VestOther { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vested_transfer( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = VestedTransfer { target, schedule }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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< + u128, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceVestedTransfer { + source, + target, + schedule, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn merge_schedules( + &self, + schedule1_index: u32, + schedule2_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = MergeSchedules { + schedule1_index, + schedule2_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct VestingUpdated( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for VestingUpdated { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingUpdated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct VestingCompleted(pub ::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(pub ::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< + u128, + u32, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Vesting"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_vesting::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn vesting( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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< + u128, + u32, + >, + >, + >, + ::subxt::Error, + > { + let entry = Vesting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_vesting::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod utility { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Batch { + pub calls: Vec, + } + impl ::subxt::Call for Batch { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AsDerivative { + pub index: u16, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for AsDerivative { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "as_derivative"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BatchAll { + pub calls: Vec, + } + impl ::subxt::Call for BatchAll { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch_all"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn batch( + &self, + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Batch { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn as_derivative( + &self, + index: u16, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsDerivative { index, call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn batch_all( + &self, + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = BatchAll { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_utility::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BatchInterrupted( + pub u32, + pub runtime_types::sp_runtime::DispatchError, + ); + impl ::subxt::Event for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BatchCompleted {} + impl ::subxt::Event for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ItemCompleted {} + impl ::subxt::Event for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; + } + } + } + pub mod identity { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetIdentity { + pub info: runtime_types::pallet_identity::types::IdentityInfo, + } + impl ::subxt::Call for SetIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_identity"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetSubs { + pub subs: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ClearIdentity {} + impl ::subxt::Call for ClearIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "clear_identity"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RequestJudgement { + #[codec(compact)] + pub reg_index: u32, + #[codec(compact)] + pub max_fee: u128, + } + impl ::subxt::Call for RequestJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "request_judgement"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelRequest { + pub reg_index: u32, + } + impl ::subxt::Call for CancelRequest { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "cancel_request"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetFee { + #[codec(compact)] + pub index: u32, + #[codec(compact)] + pub fee: u128, + } + impl ::subxt::Call for SetFee { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fee"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetAccountId { + #[codec(compact)] + pub index: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetFields { + #[codec(compact)] + pub index: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + pub judgement: runtime_types::pallet_identity::types::Judgement, + } + impl ::subxt::Call for ProvideJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "provide_judgement"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn add_registrar( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddRegistrar { account }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_identity( + &self, + info: runtime_types::pallet_identity::types::IdentityInfo, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetIdentity { info }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_subs( + &self, + subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetSubs { subs }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_identity( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearIdentity {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn request_judgement( + &self, + reg_index: u32, + max_fee: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = RequestJudgement { reg_index, max_fee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_request( + &self, + reg_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelRequest { reg_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_fee( + &self, + index: u32, + fee: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetFee { index, fee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_account_id( + &self, + index: u32, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetAccountId { index, new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_fields( + &self, + index: u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetFields { index, fields }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn provide_judgement( + &self, + reg_index: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProvideJudgement { + reg_index, + target, + judgement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_identity( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillIdentity { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rename_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic { + let call = RenameSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveSub { sub }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn quit_sub(&self) -> ::subxt::SubmittableExtrinsic { + let call = QuitSub {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_identity::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IdentitySet(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for IdentitySet { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentitySet"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IdentityCleared( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for IdentityCleared { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityCleared"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IdentityKilled( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for IdentityKilled { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityKilled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct JudgementRequested( + pub ::subxt::sp_core::crypto::AccountId32, + pub u32, + ); + impl ::subxt::Event for JudgementRequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementRequested"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct JudgementUnrequested( + pub ::subxt::sp_core::crypto::AccountId32, + pub u32, + ); + impl ::subxt::Event for JudgementUnrequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementUnrequested"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct JudgementGiven(pub ::subxt::sp_core::crypto::AccountId32, pub u32); + impl ::subxt::Event for JudgementGiven { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementGiven"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RegistrarAdded(pub u32); + impl ::subxt::Event for RegistrarAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "RegistrarAdded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SubIdentityAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for SubIdentityAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityAdded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SubIdentityRemoved( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for SubIdentityRemoved { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRemoved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SubIdentityRevoked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub 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(pub ::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; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct SuperOf(pub ::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(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SubsOf { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SubsOf"; + type Value = ( + 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< + Option< + runtime_types::pallet_identity::types::RegistrarInfo< + 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 } + } + pub async fn identity_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_identity::types::Registration, + >, + ::subxt::Error, + > { + let entry = IdentityOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn super_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ::subxt::Error, + > { + let entry = SuperOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn subs_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ( + u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + ::subxt::Error, + > { + let entry = SubsOf(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn registrars( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + Option< + runtime_types::pallet_identity::types::RegistrarInfo< + u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >, + ::subxt::Error, + > { + let entry = Registrars; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod proxy { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Proxy { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: Option, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for Proxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AddProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: u32, + } + impl ::subxt::Call for AddProxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "add_proxy"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemoveProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: u32, + } + impl ::subxt::Call for RemoveProxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxy"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RemoveProxies {} + impl ::subxt::Call for RemoveProxies { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxies"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Anonymous { + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: u32, + pub index: u16, + } + impl ::subxt::Call for Anonymous { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "anonymous"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct KillAnonymous { + pub spawner: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub index: u16, + #[codec(compact)] + pub height: u32, + #[codec(compact)] + pub ext_index: u32, + } + impl ::subxt::Call for KillAnonymous { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "kill_anonymous"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProxyAnnounced { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: Option, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for ProxyAnnounced { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy_announced"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn proxy( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: Option, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Proxy { + real, + force_proxy_type, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddProxy { + delegate, + proxy_type, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveProxy { + delegate, + proxy_type, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_proxies( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveProxies {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn anonymous( + &self, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: u32, + index: u16, + ) -> ::subxt::SubmittableExtrinsic { + let call = Anonymous { + proxy_type, + delay, + index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_anonymous( + &self, + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + index: u16, + height: u32, + ext_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillAnonymous { + spawner, + proxy_type, + index, + height, + ext_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn announce( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = Announce { real, call_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_announcement( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = RemoveAnnouncement { real, call_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reject_announcement( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = RejectAnnouncement { + delegate, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn proxy_announced( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: Option, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProxyAnnounced { + delegate, + real, + force_proxy_type, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProxyExecuted( + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for ProxyExecuted { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyExecuted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AnonymousCreated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_runtime::ProxyType, + pub u16, + ); + impl ::subxt::Event for AnonymousCreated { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "AnonymousCreated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Announced( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + ); + impl ::subxt::Event for Announced { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "Announced"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProxyAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_runtime::ProxyType, + pub u32, + ); + impl ::subxt::Event for ProxyAdded { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyAdded"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proxies(pub ::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, + u32, + >, + >, + u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Announcements(pub ::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, + u32, + >, + >, + u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn proxies( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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, + u32, + >, + >, + u128, + ), + ::subxt::Error, + > { + let entry = Proxies(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn announcements( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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, + u32, + >, + >, + u128, + ), + ::subxt::Error, + > { + let entry = Announcements(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod multisig { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AsMultiThreshold1 { + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub call: runtime_types::polkadot_runtime::Call, + } + impl ::subxt::Call for AsMultiThreshold1 { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi_threshold1"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AsMulti { + pub threshold: u16, + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub maybe_timepoint: + Option>, + pub call: Vec, + pub store_call: bool, + pub max_weight: u64, + } + impl ::subxt::Call for AsMulti { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ApproveAsMulti { + pub threshold: u16, + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub maybe_timepoint: + Option>, + pub call_hash: [u8; 32usize], + pub max_weight: u64, + } + impl ::subxt::Call for ApproveAsMulti { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "approve_as_multi"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CancelAsMulti { + pub threshold: u16, + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub timepoint: runtime_types::pallet_multisig::Timepoint, + pub call_hash: [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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn as_multi_threshold1( + &self, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + call: runtime_types::polkadot_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsMultiThreshold1 { + other_signatories, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn as_multi( + &self, + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: Option< + runtime_types::pallet_multisig::Timepoint, + >, + call: Vec, + store_call: bool, + max_weight: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call, + store_call, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_as_multi( + &self, + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: Option< + runtime_types::pallet_multisig::Timepoint, + >, + call_hash: [u8; 32usize], + max_weight: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_as_multi( + &self, + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint, + call_hash: [u8; 32usize], + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewMultisig( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + ); + impl ::subxt::Event for NewMultisig { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "NewMultisig"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MultisigApproval( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + ); + impl ::subxt::Event for MultisigApproval { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigApproval"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MultisigExecuted( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for MultisigExecuted { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigExecuted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MultisigCancelled( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint, + pub ::subxt::sp_core::crypto::AccountId32, + pub [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(::subxt::sp_core::crypto::AccountId32, [u8; 32usize]); + impl ::subxt::StorageEntry for Multisigs { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Multisigs"; + type Value = runtime_types::pallet_multisig::Multisig< + u32, + 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(pub [u8; 32usize]); + impl ::subxt::StorageEntry for Calls { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Calls"; + type Value = (Vec, ::subxt::sp_core::crypto::AccountId32, u128); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn multisigs( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: [u8; 32usize], + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_multisig::Multisig< + u32, + u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Multisigs(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn calls( + &self, + _0: [u8; 32usize], + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + Vec, + ::subxt::sp_core::crypto::AccountId32, + u128, + )>, + ::subxt::Error, + > { + let entry = Calls(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod bounties { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProposeBounty { + #[codec(compact)] + pub value: u128, + pub description: Vec, + } + impl ::subxt::Call for ProposeBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_bounty"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ApproveBounty { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for ApproveBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "approve_bounty"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub fee: u128, + } + impl ::subxt::Call for ProposeCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_curator"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct UnassignCurator { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for UnassignCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "unassign_curator"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AcceptCurator { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for AcceptCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "accept_curator"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ClaimBounty { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for ClaimBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "claim_bounty"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CloseBounty { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for CloseBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "close_bounty"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: u32, + pub remark: Vec, + } + impl ::subxt::Call for ExtendBountyExpiry { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "extend_bounty_expiry"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn propose_bounty( + &self, + value: u128, + description: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeBounty { value, description }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_bounty( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose_curator( + &self, + bounty_id: u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + fee: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeCurator { + bounty_id, + curator, + fee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unassign_curator( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = UnassignCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn accept_curator( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AcceptCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn award_bounty( + &self, + bounty_id: u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = AwardBounty { + bounty_id, + beneficiary, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn claim_bounty( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClaimBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_bounty( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn extend_bounty_expiry( + &self, + bounty_id: u32, + remark: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExtendBountyExpiry { bounty_id, remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_bounties::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyProposed(pub u32); + impl ::subxt::Event for BountyProposed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyProposed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyRejected(pub u32, pub u128); + impl ::subxt::Event for BountyRejected { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyRejected"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyBecameActive(pub u32); + impl ::subxt::Event for BountyBecameActive { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyBecameActive"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyAwarded(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for BountyAwarded { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyAwarded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyClaimed( + pub u32, + pub u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for BountyClaimed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyClaimed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyCanceled(pub u32); + impl ::subxt::Event for BountyCanceled { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyCanceled"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BountyExtended(pub 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bounties(pub 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, + u128, + u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct BountyDescriptions(pub u32); + impl ::subxt::StorageEntry for BountyDescriptions { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyDescriptions"; + type Value = Vec; + 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 = Vec; + 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 bounty_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = BountyCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bounties( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_bounties::Bounty< + ::subxt::sp_core::crypto::AccountId32, + u128, + u32, + >, + >, + ::subxt::Error, + > { + let entry = Bounties(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bounty_descriptions( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> + { + let entry = BountyDescriptions(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bounty_approvals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> { + let entry = BountyApprovals; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod tips { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReportAwesome { + pub reason: Vec, + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ReportAwesome { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "report_awesome"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TipNew { + pub reason: Vec, + pub who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + pub tip_value: u128, + } + impl ::subxt::Call for TipNew { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip_new"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Tip { + pub hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub tip_value: u128, + } + impl ::subxt::Call for Tip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn report_awesome( + &self, + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReportAwesome { reason, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn retract_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = RetractTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip_new( + &self, + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + tip_value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = TipNew { + reason, + who, + tip_value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip( + &self, + hash: ::subxt::sp_core::H256, + tip_value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Tip { hash, tip_value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn slash_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = SlashTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_tips::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewTip(pub ::subxt::sp_core::H256); + impl ::subxt::Event for NewTip { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "NewTip"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TipClosing(pub ::subxt::sp_core::H256); + impl ::subxt::Event for TipClosing { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosing"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TipClosed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for TipClosed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TipRetracted(pub ::subxt::sp_core::H256); + impl ::subxt::Event for TipRetracted { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipRetracted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct TipSlashed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub 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(pub ::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, + u128, + 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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reasons { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Reasons"; + type Value = Vec; + 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 tips( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + u128, + u32, + ::subxt::sp_core::H256, + >, + >, + ::subxt::Error, + > { + let entry = Tips(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn reasons( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> + { + let entry = Reasons(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod election_provider_multi_phase { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SubmitUnsigned { pub raw_solution : 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: Option<[u128; 3usize]>, + } + impl ::subxt::Call for SetMinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_minimum_untrusted_score"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetEmergencyElectionResult { + pub supports: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Submit { + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::polkadot_runtime::NposCompactSolution16, + >, + pub num_signed_submissions: u32, + } + impl ::subxt::Call for Submit { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + 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, + ) -> ::subxt::SubmittableExtrinsic { + let call = SubmitUnsigned { + raw_solution, + witness, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: Option<[u128; 3usize]>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMinimumUntrustedScore { maybe_next_score }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_emergency_election_result( + &self, + supports: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetEmergencyElectionResult { supports }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + num_signed_submissions: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Submit { + raw_solution, + num_signed_submissions, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = + runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SolutionStored( + pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub bool, + ); + impl ::subxt::Event for SolutionStored { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SolutionStored"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ElectionFinalized( + pub 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Slashed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SignedPhaseStarted(pub u32); + impl ::subxt::Event for SignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SignedPhaseStarted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct UnsignedPhaseStarted(pub 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 = 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; + 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< + ::subxt::sp_core::crypto::AccountId32, + >; + 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 = 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 = 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 < [u128 ; 3usize] , u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionsMap(pub 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 , 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 = [u128; 3usize]; + 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 round( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Round; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_election_provider_multi_phase::Phase, + ::subxt::Error, + > { + let entry = CurrentPhase; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn queued_solution (& self , 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 :: Error >{ + let entry = QueuedSolution; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: Error >{ + let entry = Snapshot; + self.client.storage().fetch(&entry, hash).await + } + pub async fn desired_targets( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = DesiredTargets; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: Error >{ + let entry = SnapshotMetadata; + self.client.storage().fetch(&entry, hash).await + } + pub async fn signed_submission_next_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = SignedSubmissionNextIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [u128 ; 3usize] , u32 > , :: subxt :: Error >{ + let entry = SignedSubmissionIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submissions_map (& self , _0 : u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > , :: subxt :: Error >{ + let entry = SignedSubmissionsMap(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn minimum_untrusted_score( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<[u128; 3usize]>, + ::subxt::Error, + > { + let entry = MinimumUntrustedScore; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod parachains_origin { + use super::runtime_types; + } + pub mod configuration { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetValidationUpgradeFrequency { + pub new: u32, + } + impl ::subxt::Call for SetValidationUpgradeFrequency { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_validation_upgrade_frequency"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetValidationUpgradeDelay { + pub new: u32, + } + impl ::subxt::Call for SetValidationUpgradeDelay { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_validation_upgrade_delay"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetCodeRetentionPeriod { + pub new: u32, + } + impl ::subxt::Call for SetCodeRetentionPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_code_retention_period"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxCodeSize { + pub new: u32, + } + impl ::subxt::Call for SetMaxCodeSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_code_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxPovSize { + pub new: u32, + } + impl ::subxt::Call for SetMaxPovSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_pov_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxHeadDataSize { + pub new: u32, + } + impl ::subxt::Call for SetMaxHeadDataSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_head_data_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetParathreadCores { + pub new: u32, + } + impl ::subxt::Call for SetParathreadCores { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_parathread_cores"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetParathreadRetries { + pub new: u32, + } + impl ::subxt::Call for SetParathreadRetries { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_parathread_retries"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetGroupRotationFrequency { + pub new: u32, + } + impl ::subxt::Call for SetGroupRotationFrequency { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_group_rotation_frequency"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetChainAvailabilityPeriod { + pub new: u32, + } + impl ::subxt::Call for SetChainAvailabilityPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_chain_availability_period"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetThreadAvailabilityPeriod { + pub new: u32, + } + impl ::subxt::Call for SetThreadAvailabilityPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_thread_availability_period"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetSchedulingLookahead { + pub new: u32, + } + impl ::subxt::Call for SetSchedulingLookahead { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_scheduling_lookahead"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxValidatorsPerCore { + pub new: Option, + } + impl ::subxt::Call for SetMaxValidatorsPerCore { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_validators_per_core"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxValidators { + pub new: Option, + } + impl ::subxt::Call for SetMaxValidators { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_validators"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetDisputePeriod { + pub new: u32, + } + impl ::subxt::Call for SetDisputePeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_dispute_period"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetDisputePostConclusionAcceptancePeriod { + pub new: u32, + } + impl ::subxt::Call for SetDisputePostConclusionAcceptancePeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = + "set_dispute_post_conclusion_acceptance_period"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetDisputeMaxSpamSlots { + pub new: u32, + } + impl ::subxt::Call for SetDisputeMaxSpamSlots { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_dispute_max_spam_slots"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetDisputeConclusionByTimeOutPeriod { + pub new: u32, + } + impl ::subxt::Call for SetDisputeConclusionByTimeOutPeriod { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = + "set_dispute_conclusion_by_time_out_period"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetNoShowSlots { + pub new: u32, + } + impl ::subxt::Call for SetNoShowSlots { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_no_show_slots"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetNDelayTranches { + pub new: u32, + } + impl ::subxt::Call for SetNDelayTranches { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_n_delay_tranches"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetZerothDelayTrancheWidth { + pub new: u32, + } + impl ::subxt::Call for SetZerothDelayTrancheWidth { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetNeededApprovals { + pub new: u32, + } + impl ::subxt::Call for SetNeededApprovals { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_needed_approvals"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetRelayVrfModuloSamples { + pub new: u32, + } + impl ::subxt::Call for SetRelayVrfModuloSamples { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxUpwardQueueCount { + pub new: u32, + } + impl ::subxt::Call for SetMaxUpwardQueueCount { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_queue_count"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxUpwardQueueSize { + pub new: u32, + } + impl ::subxt::Call for SetMaxUpwardQueueSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_queue_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxDownwardMessageSize { + pub new: u32, + } + impl ::subxt::Call for SetMaxDownwardMessageSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_downward_message_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetUmpServiceTotalWeight { + pub new: u64, + } + impl ::subxt::Call for SetUmpServiceTotalWeight { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_ump_service_total_weight"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxUpwardMessageSize { + pub new: u32, + } + impl ::subxt::Call for SetMaxUpwardMessageSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_message_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetMaxUpwardMessageNumPerCandidate { + pub new: u32, + } + impl ::subxt::Call for SetMaxUpwardMessageNumPerCandidate { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_max_upward_message_num_per_candidate"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpOpenRequestTtl { + pub new: u32, + } + impl ::subxt::Call for SetHrmpOpenRequestTtl { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_open_request_ttl"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpSenderDeposit { + pub new: u128, + } + impl ::subxt::Call for SetHrmpSenderDeposit { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_sender_deposit"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpRecipientDeposit { + pub new: u128, + } + impl ::subxt::Call for SetHrmpRecipientDeposit { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_recipient_deposit"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpChannelMaxCapacity { + pub new: u32, + } + impl ::subxt::Call for SetHrmpChannelMaxCapacity { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_channel_max_capacity"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpChannelMaxTotalSize { + pub new: u32, + } + impl ::subxt::Call for SetHrmpChannelMaxTotalSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_channel_max_total_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpMaxParachainInboundChannels { + pub new: u32, + } + impl ::subxt::Call for SetHrmpMaxParachainInboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpMaxParathreadInboundChannels { + pub new: u32, + } + impl ::subxt::Call for SetHrmpMaxParathreadInboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpChannelMaxMessageSize { + pub new: u32, + } + impl ::subxt::Call for SetHrmpChannelMaxMessageSize { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpMaxParachainOutboundChannels { + pub new: u32, + } + impl ::subxt::Call for SetHrmpMaxParachainOutboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpMaxParathreadOutboundChannels { + pub new: u32, + } + impl ::subxt::Call for SetHrmpMaxParathreadOutboundChannels { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = + "set_hrmp_max_parathread_outbound_channels"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetHrmpMaxMessageNumPerCandidate { + pub new: u32, + } + impl ::subxt::Call for SetHrmpMaxMessageNumPerCandidate { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SetUmpMaxIndividualWeight { + pub new: u64, + } + impl ::subxt::Call for SetUmpMaxIndividualWeight { + const PALLET: &'static str = "Configuration"; + const FUNCTION: &'static str = "set_ump_max_individual_weight"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_validation_upgrade_frequency( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetValidationUpgradeFrequency { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_validation_upgrade_delay( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetValidationUpgradeDelay { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_code_retention_period( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetCodeRetentionPeriod { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_code_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMaxCodeSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_pov_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMaxPovSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_head_data_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxHeadDataSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_parathread_cores( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetParathreadCores { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_parathread_retries( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetParathreadRetries { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_group_rotation_frequency( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetGroupRotationFrequency { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_chain_availability_period( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetChainAvailabilityPeriod { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_thread_availability_period( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetThreadAvailabilityPeriod { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_scheduling_lookahead( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetSchedulingLookahead { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_validators_per_core( + &self, + new: Option, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxValidatorsPerCore { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_validators( + &self, + new: Option, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMaxValidators { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_dispute_period( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetDisputePeriod { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_dispute_post_conclusion_acceptance_period( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic< + T, + SetDisputePostConclusionAcceptancePeriod, + > { + let call = SetDisputePostConclusionAcceptancePeriod { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_dispute_max_spam_slots( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetDisputeMaxSpamSlots { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_dispute_conclusion_by_time_out_period( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetDisputeConclusionByTimeOutPeriod { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_no_show_slots( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetNoShowSlots { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_n_delay_tranches( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetNDelayTranches { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_zeroth_delay_tranche_width( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetZerothDelayTrancheWidth { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_needed_approvals( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetNeededApprovals { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_relay_vrf_modulo_samples( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetRelayVrfModuloSamples { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_upward_queue_count( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxUpwardQueueCount { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_upward_queue_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxUpwardQueueSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_downward_message_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxDownwardMessageSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_ump_service_total_weight( + &self, + new: u64, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetUmpServiceTotalWeight { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_upward_message_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxUpwardMessageSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_upward_message_num_per_candidate( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMaxUpwardMessageNumPerCandidate { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_open_request_ttl( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpOpenRequestTtl { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_sender_deposit( + &self, + new: u128, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpSenderDeposit { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_recipient_deposit( + &self, + new: u128, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpRecipientDeposit { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_channel_max_capacity( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpChannelMaxCapacity { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_channel_max_total_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpChannelMaxTotalSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_max_parachain_inbound_channels( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpMaxParachainInboundChannels { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_max_parathread_inbound_channels( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpMaxParathreadInboundChannels { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_channel_max_message_size( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpChannelMaxMessageSize { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_max_parachain_outbound_channels( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpMaxParachainOutboundChannels { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_max_parathread_outbound_channels( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpMaxParathreadOutboundChannels { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_hrmp_max_message_num_per_candidate( + &self, + new: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetHrmpMaxMessageNumPerCandidate { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_ump_max_individual_weight( + &self, + new: u64, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetUmpMaxIndividualWeight { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 < u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct PendingConfig(pub u32); + impl ::subxt::StorageEntry for PendingConfig { + const PALLET: &'static str = "Configuration"; + const STORAGE: &'static str = "PendingConfig"; + type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } pub async fn active_config (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < u32 > , :: subxt :: Error >{ + let entry = ActiveConfig; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn pending_config (& self , _0 : u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < u32 > > , :: subxt :: Error >{ + let entry = PendingConfig(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod paras_shared { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + } + } + 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 = 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 = Vec; + 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 = + Vec; + 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 current_session_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CurrentSessionIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn active_validator_indices( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = ActiveValidatorIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn active_validator_keys( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = ActiveValidatorKeys; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod para_inclusion { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + } + } + pub type Event = + runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CandidateBacked( + pub runtime_types::polkadot_primitives::v1::CandidateReceipt< + ::subxt::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v1::CoreIndex, + pub runtime_types::polkadot_primitives::v1::GroupIndex, + ); + impl ::subxt::Event for CandidateBacked { + const PALLET: &'static str = "ParaInclusion"; + const EVENT: &'static str = "CandidateBacked"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CandidateIncluded( + pub runtime_types::polkadot_primitives::v1::CandidateReceipt< + ::subxt::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v1::CoreIndex, + pub runtime_types::polkadot_primitives::v1::GroupIndex, + ); + impl ::subxt::Event for CandidateIncluded { + const PALLET: &'static str = "ParaInclusion"; + const EVENT: &'static str = "CandidateIncluded"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CandidateTimedOut( + pub runtime_types::polkadot_primitives::v1::CandidateReceipt< + ::subxt::sp_core::H256, + >, + pub runtime_types::polkadot_parachain::primitives::HeadData, + pub runtime_types::polkadot_primitives::v1::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( + pub runtime_types::polkadot_primitives::v0::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 < u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PendingAvailability( + pub 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 , u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PendingAvailabilityCommitments( + pub 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::v1::CandidateCommitments; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } pub async fn availability_bitfields (& self , _0 : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < u32 > > , :: subxt :: Error >{ + let entry = AvailabilityBitfields(_0); + self.client.storage().fetch(&entry, hash).await + } pub async fn pending_availability (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , u32 > > , :: subxt :: Error >{ + let entry = PendingAvailability(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn pending_availability_commitments( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v1::CandidateCommitments, + >, + ::subxt::Error, + > { + let entry = PendingAvailabilityCommitments(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod para_inherent { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Enter { + pub data: runtime_types::polkadot_primitives::v1::InherentData< + runtime_types::sp_runtime::generic::header::Header< + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn enter( + &self, + data: runtime_types::polkadot_primitives::v1::InherentData< + runtime_types::sp_runtime::generic::header::Header< + u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Enter { data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 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 included( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + { + let entry = Included; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod para_scheduler { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct ValidatorGroups; + impl ::subxt::StorageEntry for ValidatorGroups { + const PALLET: &'static str = "ParaScheduler"; + const STORAGE: &'static str = "ValidatorGroups"; + type Value = + Vec>; + 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 = + Vec>; + 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 = 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 = 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 = Vec< + runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn validator_groups( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec>, + ::subxt::Error, + > { + let entry = ValidatorGroups; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn parathread_queue (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue , :: subxt :: Error >{ + let entry = ParathreadQueue; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn availability_cores( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec>, + ::subxt::Error, + > { + let entry = AvailabilityCores; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn parathread_claim_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = ParathreadClaimIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn session_start_block( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = SessionStartBlock; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn scheduled (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > , :: subxt :: Error >{ + let entry = Scheduled; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod paras { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceScheduleCodeUpgrade { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + pub relay_parent_number: u32, + } + impl ::subxt::Call for ForceScheduleCodeUpgrade { + const PALLET: &'static str = "Paras"; + const FUNCTION: &'static str = "force_schedule_code_upgrade"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn force_set_current_code( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceSetCurrentCode { para, new_code }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_set_current_head( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_head: runtime_types::polkadot_parachain::primitives::HeadData, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceSetCurrentHead { para, new_head }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceScheduleCodeUpgrade { + para, + new_code, + relay_parent_number, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_note_new_head( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_head: runtime_types::polkadot_parachain::primitives::HeadData, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNoteNewHead { para, new_head }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_queue_action( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceQueueAction { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ActionQueued( + pub runtime_types::polkadot_parachain::primitives::Id, + pub u32, + ); + impl ::subxt::Event for ActionQueued { + const PALLET: &'static str = "Paras"; + const EVENT: &'static str = "ActionQueued"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Parachains; + impl ::subxt::StorageEntry for Parachains { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "Parachains"; + type Value = Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParaLifecycles( + pub 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(pub 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( + pub 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( + runtime_types::polkadot_parachain::primitives::Id, + 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, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct PastCodeMeta( + pub 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< + 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 = + Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct FutureCodeUpgrades( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for FutureCodeUpgrades { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "FutureCodeUpgrades"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct FutureCodeHash( + pub 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( + pub 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::v1::UpgradeGoAhead; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct UpgradeRestrictionSignal( + pub 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::v1::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 = + Vec<(runtime_types::polkadot_parachain::primitives::Id, 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 = + Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ActionsQueue(pub u32); + impl ::subxt::StorageEntry for ActionsQueue { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "ActionsQueue"; + type Value = Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct UpcomingParasGenesis( + pub 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( + pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + ); + impl ::subxt::StorageEntry for CodeByHashRefs { + const PALLET: &'static str = "Paras"; + const STORAGE: &'static str = "CodeByHashRefs"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct CodeByHash( + pub 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 } + } + pub async fn parachains( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = Parachains; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn para_lifecycles( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, + >, + ::subxt::Error, + > { + let entry = ParaLifecycles(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn heads( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::HeadData, + >, + ::subxt::Error, + > { + let entry = Heads(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_code_hash( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ::subxt::Error, + > { + let entry = CurrentCodeHash(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn past_code_hash( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + _1: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ::subxt::Error, + > { + let entry = PastCodeHash(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn past_code_meta( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< + u32, + >, + ::subxt::Error, + > { + let entry = PastCodeMeta(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn past_code_pruning( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>, + ::subxt::Error, + > { + let entry = PastCodePruning; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn future_code_upgrades( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = FutureCodeUpgrades(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn future_code_hash( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + >, + ::subxt::Error, + > { + let entry = FutureCodeHash(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn upgrade_go_ahead_signal( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v1::UpgradeGoAhead, + >, + ::subxt::Error, + > { + let entry = UpgradeGoAheadSignal(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn upgrade_restriction_signal( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v1::UpgradeRestriction, + >, + ::subxt::Error, + > { + let entry = UpgradeRestrictionSignal(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn upgrade_cooldowns( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>, + ::subxt::Error, + > { + let entry = UpgradeCooldowns; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn upcoming_upgrades( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>, + ::subxt::Error, + > { + let entry = UpcomingUpgrades; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn actions_queue( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = ActionsQueue(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn upcoming_paras_genesis (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: Error >{ + let entry = UpcomingParasGenesis(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn code_by_hash_refs( + &self, + _0: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CodeByHashRefs(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn code_by_hash( + &self, + _0: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::ValidationCode, + >, + ::subxt::Error, + > { + let entry = CodeByHash(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod initializer { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceApprove { + pub up_to: u32, + } + impl ::subxt::Call for ForceApprove { + const PALLET: &'static str = "Initializer"; + const FUNCTION: &'static str = "force_approve"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn force_approve( + &self, + up_to: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceApprove { up_to }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 = Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn has_initialized( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + { + let entry = HasInitialized; + self.client.storage().fetch(&entry, hash).await + } pub async fn buffered_session_changes (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: Error >{ + let entry = BufferedSessionChanges; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod dmp { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + } + } + pub mod storage { + use super::runtime_types; + pub struct DownwardMessageQueues( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for DownwardMessageQueues { + const PALLET: &'static str = "Dmp"; + const STORAGE: &'static str = "DownwardMessageQueues"; + type Value = Vec< + runtime_types::polkadot_core_primitives::InboundDownwardMessage, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct DownwardMessageQueueHeads( + pub 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 } + } + pub async fn downward_message_queues( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::polkadot_core_primitives::InboundDownwardMessage< + u32, + >, + >, + ::subxt::Error, + > { + let entry = DownwardMessageQueues(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn downward_message_queue_heads( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = DownwardMessageQueueHeads(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod ump { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ServiceOverweight { + pub index: u64, + pub weight_limit: u64, + } + impl ::subxt::Call for ServiceOverweight { + const PALLET: &'static str = "Ump"; + const FUNCTION: &'static str = "service_overweight"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn service_overweight( + &self, + index: u64, + weight_limit: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ServiceOverweight { + index, + weight_limit, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct InvalidFormat(pub [u8; 32usize]); + impl ::subxt::Event for InvalidFormat { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "InvalidFormat"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct UnsupportedVersion(pub [u8; 32usize]); + impl ::subxt::Event for UnsupportedVersion { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "UnsupportedVersion"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ExecutedUpward( + pub [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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct WeightExhausted(pub [u8; 32usize], pub u64, pub u64); + impl ::subxt::Event for WeightExhausted { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "WeightExhausted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct UpwardMessagesReceived( + pub runtime_types::polkadot_parachain::primitives::Id, + pub u32, + pub u32, + ); + impl ::subxt::Event for UpwardMessagesReceived { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "UpwardMessagesReceived"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OverweightEnqueued( + pub runtime_types::polkadot_parachain::primitives::Id, + pub [u8; 32usize], + pub u64, + pub u64, + ); + impl ::subxt::Event for OverweightEnqueued { + const PALLET: &'static str = "Ump"; + const EVENT: &'static str = "OverweightEnqueued"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OverweightServiced(pub u64, pub 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( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for RelayDispatchQueues { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "RelayDispatchQueues"; + type Value = Vec>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct RelayDispatchQueueSize( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for RelayDispatchQueueSize { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "RelayDispatchQueueSize"; + type Value = (u32, 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 = 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(pub u64); + impl ::subxt::StorageEntry for Overweight { + const PALLET: &'static str = "Ump"; + const STORAGE: &'static str = "Overweight"; + type Value = (runtime_types::polkadot_parachain::primitives::Id, Vec); + 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 = u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn relay_dispatch_queues( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result>, ::subxt::Error> + { + let entry = RelayDispatchQueues(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn relay_dispatch_queue_size( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<(u32, u32), ::subxt::Error> { + let entry = RelayDispatchQueueSize(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn needs_dispatch( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = NeedsDispatch; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_dispatch_round_start_with( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::Id, + >, + ::subxt::Error, + > { + let entry = NextDispatchRoundStartWith; + self.client.storage().fetch(&entry, hash).await + } + pub async fn overweight( + &self, + _0: u64, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + runtime_types::polkadot_parachain::primitives::Id, + Vec, + )>, + ::subxt::Error, + > { + let entry = Overweight(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn overweight_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = OverweightCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod hrmp { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct HrmpInitOpenChannel { + pub recipient: runtime_types::polkadot_parachain::primitives::Id, + pub proposed_max_capacity: u32, + pub proposed_max_message_size: u32, + } + impl ::subxt::Call for HrmpInitOpenChannel { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "hrmp_init_open_channel"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceCleanHrmp { + pub para: runtime_types::polkadot_parachain::primitives::Id, + } + impl ::subxt::Call for ForceCleanHrmp { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "force_clean_hrmp"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceProcessHrmpOpen {} + impl ::subxt::Call for ForceProcessHrmpOpen { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "force_process_hrmp_open"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceProcessHrmpClose {} + impl ::subxt::Call for ForceProcessHrmpClose { + const PALLET: &'static str = "Hrmp"; + const FUNCTION: &'static str = "force_process_hrmp_close"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct HrmpCancelOpenRequest { + pub channel_id: + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + } + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn hrmp_init_open_channel( + &self, + recipient: runtime_types::polkadot_parachain::primitives::Id, + proposed_max_capacity: u32, + proposed_max_message_size: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = HrmpInitOpenChannel { + recipient, + proposed_max_capacity, + proposed_max_message_size, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn hrmp_accept_open_channel( + &self, + sender: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic + { + let call = HrmpAcceptOpenChannel { sender }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn hrmp_close_channel( + &self, + channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, + ) -> ::subxt::SubmittableExtrinsic { + let call = HrmpCloseChannel { channel_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_clean_hrmp( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceCleanHrmp { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_process_hrmp_open( + &self, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceProcessHrmpOpen {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_process_hrmp_close( + &self, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceProcessHrmpClose {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn hrmp_cancel_open_request( + &self, + channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, + ) -> ::subxt::SubmittableExtrinsic + { + let call = HrmpCancelOpenRequest { channel_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OpenChannelRequested( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::Id, + pub u32, + pub u32, + ); + impl ::subxt::Event for OpenChannelRequested { + const PALLET: &'static str = "Hrmp"; + const EVENT: &'static str = "OpenChannelRequested"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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( + pub 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 = + Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct HrmpOpenChannelRequestCount( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpOpenChannelRequestCount { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpOpenChannelRequestCount"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpAcceptedChannelRequestCount( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpAcceptedChannelRequestCount { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpAcceptedChannelRequestCount"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpCloseChannelRequests( + pub 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 = + Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct HrmpWatermarks( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpWatermarks { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpWatermarks"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpChannels( + pub 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( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpIngressChannelsIndex { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpIngressChannelsIndex"; + type Value = Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpEgressChannelsIndex( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpEgressChannelsIndex { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpEgressChannelsIndex"; + type Value = Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpChannelContents( + pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ); + impl ::subxt::StorageEntry for HrmpChannelContents { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpChannelContents"; + type Value = + Vec>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct HrmpChannelDigests( + pub runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for HrmpChannelDigests { + const PALLET: &'static str = "Hrmp"; + const STORAGE: &'static str = "HrmpChannelDigests"; + type Value = + Vec<(u32, 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 } + } pub async fn hrmp_open_channel_requests (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: Error >{ + let entry = HrmpOpenChannelRequests(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_open_channel_requests_list( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = HrmpOpenChannelRequestsList; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_open_channel_request_count( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = HrmpOpenChannelRequestCount(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_accepted_channel_request_count( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = HrmpAcceptedChannelRequestCount(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_close_channel_requests( + &self, + _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + { + let entry = HrmpCloseChannelRequests(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_close_channel_requests_list( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = HrmpCloseChannelRequestsList; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_watermarks( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = HrmpWatermarks(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_channels( + &self, + _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, + >, + ::subxt::Error, + > { + let entry = HrmpChannels(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_ingress_channels_index( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = HrmpIngressChannelsIndex(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_egress_channels_index( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = HrmpEgressChannelsIndex(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_channel_contents( + &self, + _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec>, + ::subxt::Error, + > { + let entry = HrmpChannelContents(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_channel_digests( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(u32, Vec)>, + ::subxt::Error, + > { + let entry = HrmpChannelDigests(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod para_session_info { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct AssignmentKeysUnsafe; + impl ::subxt::StorageEntry for AssignmentKeysUnsafe { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "AssignmentKeysUnsafe"; + type Value = + Vec; + 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Sessions(pub u32); + impl ::subxt::StorageEntry for Sessions { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "Sessions"; + type Value = runtime_types::polkadot_primitives::v1::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 } + } + pub async fn assignment_keys_unsafe( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = AssignmentKeysUnsafe; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn earliest_stored_session( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = EarliestStoredSession; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn sessions( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_primitives::v1::SessionInfo, + >, + ::subxt::Error, + > { + let entry = Sessions(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod registrar { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceRegister { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub deposit: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + 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, + ) -> ::subxt::SubmittableExtrinsic { + let call = Register { + id, + genesis_head, + validation_code, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_register( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + deposit: u128, + id: runtime_types::polkadot_parachain::primitives::Id, + genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, + validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceRegister { + who, + deposit, + id, + genesis_head, + validation_code, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn deregister( + &self, + id: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = Deregister { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn swap( + &self, + id: runtime_types::polkadot_parachain::primitives::Id, + other: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = Swap { id, other }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_remove_lock( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceRemoveLock { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reserve(&self) -> ::subxt::SubmittableExtrinsic { + let call = Reserve {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = + runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(pub 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(pub 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, + u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct NextFreeParaId; + impl ::subxt::StorageEntry for NextFreeParaId { + const PALLET: &'static str = "Registrar"; + const STORAGE: &'static str = "NextFreeParaId"; + type Value = runtime_types::polkadot_parachain::primitives::Id; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn pending_swap( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_parachain::primitives::Id, + >, + ::subxt::Error, + > { + let entry = PendingSwap(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn paras( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Paras(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_free_para_id( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::Error, + > { + let entry = NextFreeParaId; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod slots { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ForceLease { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub leaser: ::subxt::sp_core::crypto::AccountId32, + pub amount: u128, + pub period_begin: u32, + pub period_count: u32, + } + impl ::subxt::Call for ForceLease { + const PALLET: &'static str = "Slots"; + const FUNCTION: &'static str = "force_lease"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn force_lease( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + leaser: ::subxt::sp_core::crypto::AccountId32, + amount: u128, + period_begin: u32, + period_count: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceLease { + para, + leaser, + amount, + period_begin, + period_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_all_leases( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearAllLeases { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn trigger_onboard( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = TriggerOnboard { para }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewLeasePeriod(pub u32); + impl ::subxt::Event for NewLeasePeriod { + const PALLET: &'static str = "Slots"; + const EVENT: &'static str = "NewLeasePeriod"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Leased( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::subxt::sp_core::crypto::AccountId32, + pub u32, + pub u32, + pub u128, + pub 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(pub runtime_types::polkadot_parachain::primitives::Id); + impl ::subxt::StorageEntry for Leases { + const PALLET: &'static str = "Slots"; + const STORAGE: &'static str = "Leases"; + type Value = 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 } + } + pub async fn leases( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec>, + ::subxt::Error, + > { + let entry = Leases(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod auctions { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NewAuction { + #[codec(compact)] + pub duration: u32, + #[codec(compact)] + pub lease_period_index: u32, + } + impl ::subxt::Call for NewAuction { + const PALLET: &'static str = "Auctions"; + const FUNCTION: &'static str = "new_auction"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Bid { + #[codec(compact)] + pub para: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub auction_index: u32, + #[codec(compact)] + pub first_slot: u32, + #[codec(compact)] + pub last_slot: u32, + #[codec(compact)] + pub amount: u128, + } + impl ::subxt::Call for Bid { + const PALLET: &'static str = "Auctions"; + const FUNCTION: &'static str = "bid"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn new_auction( + &self, + duration: u32, + lease_period_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = NewAuction { + duration, + lease_period_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn bid( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + auction_index: u32, + first_slot: u32, + last_slot: u32, + amount: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Bid { + para, + auction_index, + first_slot, + last_slot, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_auction( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelAuction {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AuctionStarted(pub u32, pub u32, pub u32); + impl ::subxt::Event for AuctionStarted { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "AuctionStarted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AuctionClosed(pub u32); + impl ::subxt::Event for AuctionClosed { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "AuctionClosed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Reserved( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + pub u128, + ); + impl ::subxt::Event for Reserved { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "Reserved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Unreserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Unreserved { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "Unreserved"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReserveConfiscated( + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for ReserveConfiscated { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "ReserveConfiscated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BidAccepted( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_parachain::primitives::Id, + pub u128, + pub u32, + pub u32, + ); + impl ::subxt::Event for BidAccepted { + const PALLET: &'static str = "Auctions"; + const EVENT: &'static str = "BidAccepted"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct WinningOffset(pub u32, pub 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 = 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 = (u32, u32); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ReservedAmounts( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + ); + impl ::subxt::StorageEntry for ReservedAmounts { + const PALLET: &'static str = "Auctions"; + const STORAGE: &'static str = "ReservedAmounts"; + type Value = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Winning(pub u32); + impl ::subxt::StorageEntry for Winning { + const PALLET: &'static str = "Auctions"; + const STORAGE: &'static str = "Winning"; + type Value = [Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + u128, + )>; 36usize]; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn auction_counter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = AuctionCounter; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn auction_info( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<(u32, u32)>, + ::subxt::Error, + > { + let entry = AuctionInfo; + self.client.storage().fetch(&entry, hash).await + } + pub async fn reserved_amounts( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = ReservedAmounts(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn winning( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + [Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + u128, + )>; 36usize], + >, + ::subxt::Error, + > { + let entry = Winning(_0); + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod crowdloan { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Create { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub cap: u128, + #[codec(compact)] + pub first_period: u32, + #[codec(compact)] + pub last_period: u32, + #[codec(compact)] + pub end: u32, + pub verifier: Option, + } + impl ::subxt::Call for Create { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "create"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Contribute { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub value: u128, + pub signature: Option, + } + impl ::subxt::Call for Contribute { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "contribute"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Edit { + #[codec(compact)] + pub index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + pub cap: u128, + #[codec(compact)] + pub first_period: u32, + #[codec(compact)] + pub last_period: u32, + #[codec(compact)] + pub end: u32, + pub verifier: Option, + } + impl ::subxt::Call for Edit { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "edit"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AddMemo { + pub index: runtime_types::polkadot_parachain::primitives::Id, + pub memo: Vec, + } + impl ::subxt::Call for AddMemo { + const PALLET: &'static str = "Crowdloan"; + const FUNCTION: &'static str = "add_memo"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn create( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + cap: u128, + first_period: u32, + last_period: u32, + end: u32, + verifier: Option, + ) -> ::subxt::SubmittableExtrinsic { + let call = Create { + index, + cap, + first_period, + last_period, + end, + verifier, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn contribute( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + value: u128, + signature: Option, + ) -> ::subxt::SubmittableExtrinsic { + let call = Contribute { + index, + value, + signature, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn withdraw( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = Withdraw { who, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn refund( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = Refund { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn dissolve( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = Dissolve { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn edit( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + cap: u128, + first_period: u32, + last_period: u32, + end: u32, + verifier: Option, + ) -> ::subxt::SubmittableExtrinsic { + let call = Edit { + index, + cap, + first_period, + last_period, + end, + verifier, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_memo( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + memo: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddMemo { index, memo }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn poke( + &self, + index: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::SubmittableExtrinsic { + let call = Poke { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Contributed( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_parachain::primitives::Id, + pub u128, + ); + impl ::subxt::Event for Contributed { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Contributed"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Withdrew( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_parachain::primitives::Id, + pub u128, + ); + impl ::subxt::Event for Withdrew { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "Withdrew"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct HandleBidResult( + pub runtime_types::polkadot_parachain::primitives::Id, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for HandleBidResult { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "HandleBidResult"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MemoUpdated( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::polkadot_parachain::primitives::Id, + pub Vec, + ); + impl ::subxt::Event for MemoUpdated { + const PALLET: &'static str = "Crowdloan"; + const EVENT: &'static str = "MemoUpdated"; + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(pub 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, + u128, + u32, + 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 = 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextTrieIndex; + impl ::subxt::StorageEntry for NextTrieIndex { + const PALLET: &'static str = "Crowdloan"; + const STORAGE: &'static str = "NextTrieIndex"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn funds( + &self, + _0: runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + ::subxt::sp_core::crypto::AccountId32, + u128, + u32, + u32, + >, + >, + ::subxt::Error, + > { + let entry = Funds(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn new_raise( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = NewRaise; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn endings_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = EndingsCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_trie_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = NextTrieIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod runtime_types { + use super::runtime_types; + pub mod bitvec { + use super::runtime_types; + pub mod order { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Lsb0 {} + } + } + pub mod finality_grandpa { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Equivocation<_0, _1, _2> { + pub round_number: u64, + pub identity: _0, + pub first: (_1, _2), + pub second: (_1, _2), + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Precommit<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Prevote<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + } + pub mod frame_support { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BoundedBTreeMap<_0, _1>( + pub std::collections::BTreeMap<_0, _1>, + ); + } + pub mod bounded_vec { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BoundedVec<_0>(pub Vec<_0>); + } + pub mod weak_bounded_vec { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct WeakBoundedVec<_0>(pub Vec<_0>); + } + } + pub mod traits { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct WrapperOpaque<_0>(u32, pub _0); + } + pub mod tokens { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum BalanceStatus { + Free, + Reserved, + } + } + } + } + pub mod weights { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum DispatchClass { + Normal, + Operational, + Mandatory, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct DispatchInfo { + pub weight: u64, + pub class: runtime_types::frame_support::weights::DispatchClass, + pub pays_fee: runtime_types::frame_support::weights::Pays, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Pays { + Yes, + No, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct PerDispatchClass<_0> { + pub normal: _0, + pub operational: _0, + pub mandatory: _0, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct RuntimeDbWeight { + pub read: u64, + pub write: u64, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct WeightToFeeCoefficient<_0> { + pub coeff_integer: _0, + pub coeff_frac: ::subxt::sp_arithmetic::per_things::Perbill, + pub negative: bool, + pub degree: u8, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct PalletId(pub [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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CheckGenesis {} + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CheckMortality( + pub runtime_types::sp_runtime::generic::era::Era, + ); + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CheckNonce(pub u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CheckSpecVersion {} + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CheckTxVersion {} + } + pub mod check_weight { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CheckWeight {} + } + } + pub mod limits { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BlockLength { + pub max: runtime_types::frame_support::weights::PerDispatchClass, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BlockWeights { + pub base_block: u64, + pub max_block: u64, + pub per_class: + runtime_types::frame_support::weights::PerDispatchClass< + runtime_types::frame_system::limits::WeightsPerClass, + >, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct WeightsPerClass { + pub base_extrinsic: u64, + pub max_extrinsic: Option, + pub max_total: Option, + pub reserved: Option, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : Vec < u8 > , } , set_heap_pages { pages : u64 , } , set_code { code : Vec < u8 > , } , set_code_without_checks { code : Vec < u8 > , } , set_changes_trie_config { changes_trie_config : Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : Vec < (Vec < u8 > , Vec < u8 > ,) > , } , kill_storage { keys : Vec < Vec < u8 > > , } , kill_prefix { prefix : Vec < u8 > , subkeys : u32 , } , remark_with_event { remark : Vec < u8 > , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidSpecName, + SpecVersionNeedsToIncrease, + FailedToExtractRuntimeVersion, + NonDefaultComposite, + NonZeroRefCount, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), + ExtrinsicFailed( + runtime_types::sp_runtime::DispatchError, + runtime_types::frame_support::weights::DispatchInfo, + ), + CodeUpdated, + NewAccount(::subxt::sp_core::crypto::AccountId32), + KilledAccount(::subxt::sp_core::crypto::AccountId32), + Remarked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AccountInfo<_0, _1> { + pub nonce: _0, + pub consumers: _0, + pub providers: _0, + pub sufficients: _0, + pub data: _1, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: Vec<_1>, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: u32, + pub spec_name: String, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Phase { + ApplyExtrinsic(u32), + Finalization, + Initialization, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum RawOrigin<_0> { + Root, + Signed(_0), + None, + } + } + pub mod pallet_authorship { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + set_uncles { + new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidUncleParent, + UnclesAlreadySet, + TooManyUncles, + GenesisUncle, + TooHighUncle, + UncleAlreadyIncluded, + OldUncle, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum UncleEntryItem<_0, _1, _2> { + InclusionHeight(_0), + Uncle(_1, Option<_2>), + } + } + pub mod pallet_babe { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + report_equivocation { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , report_equivocation_unsigned { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidEquivocationProof, + InvalidKeyOwnershipProof, + DuplicateOffenceReport, + } + } + } + pub mod pallet_balances { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + transfer { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: u128, + }, + set_balance { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + new_free: u128, + #[codec(compact)] + new_reserved: u128, + }, + 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: u128, + }, + transfer_keep_alive { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: u128, + }, + transfer_all { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + keep_alive: bool, + }, + force_unreserve { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + amount: u128, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + VestingBalance, + LiquidityRestrictions, + InsufficientBalance, + ExistentialDeposit, + KeepAlive, + ExistingVestingSchedule, + DeadAccount, + TooManyReserves, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Endowed(::subxt::sp_core::crypto::AccountId32, u128), + DustLost(::subxt::sp_core::crypto::AccountId32, u128), + Transfer( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + BalanceSet(::subxt::sp_core::crypto::AccountId32, u128, u128), + Deposit(::subxt::sp_core::crypto::AccountId32, u128), + Reserved(::subxt::sp_core::crypto::AccountId32, u128), + Unreserved(::subxt::sp_core::crypto::AccountId32, u128), + ReserveRepatriated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + ), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct AccountData<_0> { + pub free: _0, + pub reserved: _0, + pub misc_frozen: _0, + pub fee_frozen: _0, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BalanceLock<_0> { + pub id: [u8; 8usize], + pub amount: _0, + pub reasons: runtime_types::pallet_balances::Reasons, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Reasons { + Fee, + Misc, + All, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Releases { + V1_0_0, + V2_0_0, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + propose_bounty { + #[codec(compact)] + value: u128, + description: Vec, + }, + approve_bounty { + #[codec(compact)] + bounty_id: u32, + }, + propose_curator { + #[codec(compact)] + bounty_id: u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + fee: u128, + }, + unassign_curator { + #[codec(compact)] + bounty_id: u32, + }, + accept_curator { + #[codec(compact)] + bounty_id: u32, + }, + award_bounty { + #[codec(compact)] + bounty_id: u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + claim_bounty { + #[codec(compact)] + bounty_id: u32, + }, + close_bounty { + #[codec(compact)] + bounty_id: u32, + }, + extend_bounty_expiry { + #[codec(compact)] + bounty_id: u32, + remark: Vec, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InsufficientProposersBalance, + InvalidIndex, + ReasonTooBig, + UnexpectedStatus, + RequireCurator, + InvalidValue, + InvalidFee, + PendingPayout, + Premature, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + BountyProposed(u32), + BountyRejected(u32, u128), + BountyBecameActive(u32), + BountyAwarded(u32, ::subxt::sp_core::crypto::AccountId32), + BountyClaimed(u32, u128, ::subxt::sp_core::crypto::AccountId32), + BountyCanceled(u32), + BountyExtended(u32), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum BountyStatus<_0, _1> { + Proposed, + Approved, + Funded, + CuratorProposed { + curator: _0, + }, + Active { + curator: _0, + update_due: _1, + }, + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, + } + } + pub mod pallet_collective { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + set_members { + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: Option<::subxt::sp_core::crypto::AccountId32>, + old_count: u32, + }, + execute { + proposal: std::boxed::Box, + #[codec(compact)] + length_bound: u32, + }, + propose { + #[codec(compact)] + threshold: u32, + proposal: std::boxed::Box, + #[codec(compact)] + length_bound: u32, + }, + vote { + proposal: ::subxt::sp_core::H256, + #[codec(compact)] + index: u32, + approve: bool, + }, + close { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + index: u32, + #[codec(compact)] + proposal_weight_bound: u64, + #[codec(compact)] + length_bound: u32, + }, + disapprove_proposal { + proposal_hash: ::subxt::sp_core::H256, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + NotMember, + DuplicateProposal, + ProposalMissing, + WrongIndex, + DuplicateVote, + AlreadyInitialized, + TooEarly, + TooManyProposals, + WrongProposalWeight, + WrongProposalLength, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Proposed( + ::subxt::sp_core::crypto::AccountId32, + u32, + ::subxt::sp_core::H256, + u32, + ), + Voted( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + bool, + u32, + u32, + ), + Approved(::subxt::sp_core::H256), + Disapproved(::subxt::sp_core::H256), + Executed( + ::subxt::sp_core::H256, + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + MemberExecuted( + ::subxt::sp_core::H256, + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + Closed(::subxt::sp_core::H256, u32, u32), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum RawOrigin<_0> { + Members(u32, u32), + Member(_0), + _Phantom, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Votes<_0, _1> { + pub index: _1, + pub threshold: _1, + pub ayes: Vec<_0>, + pub nays: Vec<_0>, + pub end: _1, + } + } + pub mod pallet_democracy { + use super::runtime_types; + pub mod conviction { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Conviction { + None, + Locked1x, + Locked2x, + Locked3x, + Locked4x, + Locked5x, + Locked6x, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + propose { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + value: u128, + }, + second { + #[codec(compact)] + proposal: u32, + #[codec(compact)] + seconds_upper_bound: u32, + }, + vote { + #[codec(compact)] + ref_index: u32, + vote: runtime_types::pallet_democracy::vote::AccountVote, + }, + emergency_cancel { + ref_index: u32, + }, + external_propose { + proposal_hash: ::subxt::sp_core::H256, + }, + external_propose_majority { + proposal_hash: ::subxt::sp_core::H256, + }, + external_propose_default { + proposal_hash: ::subxt::sp_core::H256, + }, + fast_track { + proposal_hash: ::subxt::sp_core::H256, + voting_period: u32, + delay: u32, + }, + veto_external { + proposal_hash: ::subxt::sp_core::H256, + }, + cancel_referendum { + #[codec(compact)] + ref_index: u32, + }, + cancel_queued { + which: u32, + }, + delegate { + to: ::subxt::sp_core::crypto::AccountId32, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + balance: u128, + }, + undelegate, + clear_public_proposals, + note_preimage { + encoded_proposal: Vec, + }, + note_preimage_operational { + encoded_proposal: Vec, + }, + note_imminent_preimage { + encoded_proposal: Vec, + }, + note_imminent_preimage_operational { + encoded_proposal: Vec, + }, + reap_preimage { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + proposal_len_upper_bound: u32, + }, + unlock { + target: ::subxt::sp_core::crypto::AccountId32, + }, + remove_vote { + index: u32, + }, + remove_other_vote { + target: ::subxt::sp_core::crypto::AccountId32, + index: u32, + }, + enact_proposal { + proposal_hash: ::subxt::sp_core::H256, + index: u32, + }, + blacklist { + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: Option, + }, + cancel_proposal { + #[codec(compact)] + prop_index: u32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + ValueLow, + ProposalMissing, + AlreadyCanceled, + DuplicateProposal, + ProposalBlacklisted, + NotSimpleMajority, + InvalidHash, + NoProposal, + AlreadyVetoed, + DuplicatePreimage, + NotImminent, + TooEarly, + Imminent, + PreimageMissing, + ReferendumInvalid, + PreimageInvalid, + NoneWaiting, + NotVoter, + NoPermission, + AlreadyDelegating, + InsufficientFunds, + NotDelegating, + VotesExist, + InstantNotAllowed, + Nonsense, + WrongUpperBound, + MaxVotesReached, + TooManyProposals, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Proposed(u32, u128), + Tabled(u32, u128, Vec<::subxt::sp_core::crypto::AccountId32>), + ExternalTabled, + Started( + u32, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ), + Passed(u32), + NotPassed(u32), + Cancelled(u32), + Executed(u32, Result<(), runtime_types::sp_runtime::DispatchError>), + Delegated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + Undelegated(::subxt::sp_core::crypto::AccountId32), + Vetoed( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + u32, + ), + PreimageNoted( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + PreimageUsed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + PreimageInvalid(::subxt::sp_core::H256, u32), + PreimageMissing(::subxt::sp_core::H256, u32), + PreimageReaped( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ::subxt::sp_core::crypto::AccountId32, + ), + Blacklisted(::subxt::sp_core::H256), + } + } + pub mod types { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Delegations<_0> { + pub votes: _0, + pub capital: _0, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum ReferendumInfo<_0, _1, _2> { + Ongoing( + runtime_types::pallet_democracy::types::ReferendumStatus< + _0, + _1, + _2, + >, + ), + Finished { + approved: bool, + end: _0, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Tally<_0> { + pub ayes: _0, + pub nays: _0, + pub turnout: _0, + } + } + pub mod vote { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum AccountVote<_0> { + Standard { + vote: runtime_types::pallet_democracy::vote::Vote, + balance: _0, + }, + Split { + aye: _0, + nay: _0, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct PriorLock<_0, _1>(pub _0, pub _1); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Vote(u8); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Voting<_0, _1, _2> { + Direct { + votes: 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>, + }, + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum VoteThreshold { + SuperMajorityApprove, + SuperMajorityAgainst, + SimpleMajority, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum PreimageStatus<_0, _1, _2> { + Missing(_2), + Available { + data: Vec, + provider: _0, + deposit: _1, + since: _2, + expiry: Option<_2>, + }, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Releases { + V1, + } + } + pub mod pallet_election_provider_multi_phase { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + 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 , } , set_minimum_untrusted_score { maybe_next_score : Option < [u128 ; 3usize] > , } , set_emergency_election_result { supports : Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , num_signed_submissions : u32 , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + PreDispatchEarlySubmission, + PreDispatchWrongWinnerCount, + PreDispatchWeakSubmission, + SignedQueueFull, + SignedCannotPayDeposit, + SignedInvalidWitness, + SignedTooMuchWeight, + OcwCallWrongEra, + MissingSnapshotMetadata, + InvalidSubmissionIndex, + CallNotAllowed, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , bool ,) , ElectionFinalized (Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , SignedPhaseStarted (u32 ,) , UnsignedPhaseStarted (u32 ,) , } + } + pub mod signed { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum ElectionCompute { + OnChain, + Signed, + Unsigned, + Fallback, + Emergency, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Phase<_0> { + Off, + Signed, + Unsigned((bool, _0)), + Emergency, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RawSolution<_0> { + pub solution: _0, + pub score: [u128; 3usize], + pub round: u32, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ReadySolution<_0> { + pub supports: Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub score: [u128; 3usize], + pub compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RoundSnapshot<_0> { + pub voters: Vec<(_0, u64, Vec<_0>)>, + pub targets: Vec<_0>, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SolutionOrSnapshotSize { + #[codec(compact)] + pub voters: u32, + #[codec(compact)] + pub targets: u32, + } + } + pub mod pallet_elections_phragmen { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + vote { + votes: Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + value: u128, + }, + remove_voter, + submit_candidacy { + #[codec(compact)] + candidate_count: u32, + }, + renounce_candidacy { + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + }, + remove_member { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + has_replacement: bool, + }, + clean_defunct_voters { + num_voters: u32, + num_defunct: u32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + UnableToVote, + NoVotes, + TooManyVotes, + MaximumVotesExceeded, + LowBalance, + UnableToPayBond, + MustBeVoter, + ReportSelf, + DuplicatedCandidate, + MemberSubmit, + RunnerUpSubmit, + InsufficientCandidateFunds, + NotMember, + InvalidWitnessData, + InvalidVoteCount, + InvalidRenouncing, + InvalidReplacement, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + NewTerm(Vec<(::subxt::sp_core::crypto::AccountId32, u128)>), + EmptyTerm, + ElectionError, + MemberKicked(::subxt::sp_core::crypto::AccountId32), + Renounced(::subxt::sp_core::crypto::AccountId32), + CandidateSlashed(::subxt::sp_core::crypto::AccountId32, u128), + SeatHolderSlashed(::subxt::sp_core::crypto::AccountId32, u128), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Renouncing { + Member, + RunnerUp, + Candidate(u32), + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct SeatHolder<_0, _1> { + pub who: _0, + pub stake: _1, + pub deposit: _1, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Voter<_0, _1> { + pub votes: Vec<_0>, + pub stake: _1, + pub deposit: _1, + } + } + pub mod pallet_grandpa { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + report_equivocation { + equivocation_proof: std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + report_equivocation_unsigned { + equivocation_proof: std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + note_stalled { + delay: u32, + best_finalized_block_number: u32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + PauseFailed, + ResumeFailed, + ChangePending, + TooSoon, + InvalidKeyOwnershipProof, + InvalidEquivocationProof, + DuplicateOffenceReport, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + NewAuthorities( + Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, + ), + Paused, + Resumed, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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 , u64 ,) > , pub forced : Option < _0 > , } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum StoredState<_0> { + Live, + PendingPause { scheduled_at: _0, delay: _0 }, + Paused, + PendingResume { scheduled_at: _0, delay: _0 }, + } + } + pub mod pallet_identity { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + add_registrar { + account: ::subxt::sp_core::crypto::AccountId32, + }, + set_identity { + info: std::boxed::Box< + runtime_types::pallet_identity::types::IdentityInfo, + >, + }, + set_subs { + subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + }, + clear_identity, + request_judgement { + #[codec(compact)] + reg_index: u32, + #[codec(compact)] + max_fee: u128, + }, + cancel_request { + reg_index: u32, + }, + set_fee { + #[codec(compact)] + index: u32, + #[codec(compact)] + fee: u128, + }, + set_account_id { + #[codec(compact)] + index: u32, + new: ::subxt::sp_core::crypto::AccountId32, + }, + set_fields { + #[codec(compact)] + index: u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + }, + provide_judgement { + #[codec(compact)] + reg_index: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement, + }, + kill_identity { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + add_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + rename_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + remove_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + quit_sub, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + TooManySubAccounts, + NotFound, + NotNamed, + EmptyIndex, + FeeChanged, + NoIdentity, + StickyJudgement, + JudgementGiven, + InvalidJudgement, + InvalidIndex, + InvalidTarget, + TooManyFields, + TooManyRegistrars, + AlreadyClaimed, + NotSub, + NotOwned, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + IdentitySet(::subxt::sp_core::crypto::AccountId32), + IdentityCleared(::subxt::sp_core::crypto::AccountId32, u128), + IdentityKilled(::subxt::sp_core::crypto::AccountId32, u128), + JudgementRequested(::subxt::sp_core::crypto::AccountId32, u32), + JudgementUnrequested(::subxt::sp_core::crypto::AccountId32, u32), + JudgementGiven(::subxt::sp_core::crypto::AccountId32, u32), + RegistrarAdded(u32), + SubIdentityAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + SubIdentityRemoved( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + SubIdentityRevoked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + } + } + pub mod types { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BitFlags<_0>(pub u64, pub ::core::marker::PhantomData<_0>); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Data { + None, + Raw0([u8; 0usize]), + Raw1([u8; 1usize]), + Raw2([u8; 2usize]), + Raw3([u8; 3usize]), + Raw4([u8; 4usize]), + Raw5([u8; 5usize]), + Raw6([u8; 6usize]), + Raw7([u8; 7usize]), + Raw8([u8; 8usize]), + Raw9([u8; 9usize]), + Raw10([u8; 10usize]), + Raw11([u8; 11usize]), + Raw12([u8; 12usize]), + Raw13([u8; 13usize]), + Raw14([u8; 14usize]), + Raw15([u8; 15usize]), + Raw16([u8; 16usize]), + Raw17([u8; 17usize]), + Raw18([u8; 18usize]), + Raw19([u8; 19usize]), + Raw20([u8; 20usize]), + Raw21([u8; 21usize]), + Raw22([u8; 22usize]), + Raw23([u8; 23usize]), + Raw24([u8; 24usize]), + Raw25([u8; 25usize]), + Raw26([u8; 26usize]), + Raw27([u8; 27usize]), + Raw28([u8; 28usize]), + Raw29([u8; 29usize]), + Raw30([u8; 30usize]), + Raw31([u8; 31usize]), + Raw32([u8; 32usize]), + BlakeTwo256([u8; 32usize]), + Sha256([u8; 32usize]), + Keccak256([u8; 32usize]), + ShaThree256([u8; 32usize]), + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum IdentityField { + Display, + Legal, + Web, + Riot, + Email, + PgpFingerprint, + Image, + Twitter, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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: Option<[u8; 20usize]>, + pub image: runtime_types::pallet_identity::types::Data, + pub twitter: runtime_types::pallet_identity::types::Data, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Judgement<_0> { + Unknown, + FeePaid(_0), + Reasonable, + KnownGood, + OutOfDate, + LowQuality, + Erroneous, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Registration<_0> { + pub judgements: + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidKey, + DuplicatedHeartbeat, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + HeartbeatReceived( + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + ), + AllGood, + SomeOffline( + Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + )>, + ), + } + } + pub mod sr25519 { + use super::runtime_types; + pub mod app_sr25519 { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BoundedOpaqueNetworkState { pub peer_id : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > , pub external_addresses : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > > , } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + claim { + index: u32, + }, + transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: u32, + }, + free { + index: u32, + }, + force_transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: u32, + freeze: bool, + }, + freeze { + index: u32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + NotAssigned, + NotOwner, + InUse, + NotTransfer, + Permanent, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + IndexAssigned(::subxt::sp_core::crypto::AccountId32, u32), + IndexFreed(u32), + IndexFrozen(u32, ::subxt::sp_core::crypto::AccountId32), + } + } + } + pub mod pallet_membership { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + add_member { + who: ::subxt::sp_core::crypto::AccountId32, + }, + remove_member { + who: ::subxt::sp_core::crypto::AccountId32, + }, + swap_member { + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + }, + reset_members { + members: Vec<::subxt::sp_core::crypto::AccountId32>, + }, + change_key { + new: ::subxt::sp_core::crypto::AccountId32, + }, + set_prime { + who: ::subxt::sp_core::crypto::AccountId32, + }, + clear_prime, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + AlreadyMember, + NotMember, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + MemberAdded, + MemberRemoved, + MembersSwapped, + MembersReset, + KeyChanged, + Dummy, + } + } + } + pub mod pallet_multisig { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + as_multi_threshold_1 { + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + call: std::boxed::Box, + }, + as_multi { + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: + Option>, + call: Vec, + store_call: bool, + max_weight: u64, + }, + approve_as_multi { + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: + Option>, + call_hash: [u8; 32usize], + max_weight: u64, + }, + cancel_as_multi { + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint, + call_hash: [u8; 32usize], + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + MinimumThreshold, + AlreadyApproved, + NoApprovalsNeeded, + TooFewSignatories, + TooManySignatories, + SignatoriesOutOfOrder, + SenderInSignatories, + NotFound, + NotOwner, + NoTimepoint, + WrongTimepoint, + UnexpectedTimepoint, + MaxWeightTooLow, + AlreadyStored, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + NewMultisig( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + ), + MultisigApproval( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + ), + MultisigExecuted( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + MultisigCancelled( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + ), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Multisig<_0, _1, _2> { + pub when: runtime_types::pallet_multisig::Timepoint<_0>, + pub deposit: _1, + pub depositor: _2, + pub approvals: Vec<_2>, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Offence([u8; 16usize], Vec), + } + } + } + pub mod pallet_proxy { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + proxy { + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: + Option, + call: std::boxed::Box, + }, + add_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: u32, + }, + remove_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: u32, + }, + remove_proxies, + anonymous { + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: u32, + index: u16, + }, + kill_anonymous { + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + index: u16, + #[codec(compact)] + height: u32, + #[codec(compact)] + ext_index: u32, + }, + announce { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + remove_announcement { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + reject_announcement { + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + proxy_announced { + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: + Option, + call: std::boxed::Box, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + TooMany, + NotFound, + NotProxy, + Unproxyable, + Duplicate, + NoPermission, + Unannounced, + NoSelfProxy, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + ProxyExecuted(Result<(), runtime_types::sp_runtime::DispatchError>), + AnonymousCreated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::ProxyType, + u16, + ), + Announced( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ), + ProxyAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_runtime::ProxyType, + u32, + ), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Announcement<_0, _1, _2> { + pub real: _0, + pub call_hash: _1, + pub height: _2, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + schedule { + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + cancel { + when: u32, + index: u32, + }, + schedule_named { + id: Vec, + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + cancel_named { + id: Vec, + }, + schedule_after { + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + schedule_named_after { + id: Vec, + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + FailedToSchedule, + NotFound, + TargetBlockNumberInPast, + RescheduleNoChange, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Scheduled(u32, u32), + Canceled(u32, u32), + Dispatched( + (u32, u32), + Option>, + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Releases { + V1, + V2, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ScheduledV2<_0, _1, _2, _3> { + pub maybe_id: Option>, + pub priority: u8, + pub call: _0, + pub maybe_periodic: Option<(_1, _1)>, + pub origin: _2, + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + set_keys { + keys: runtime_types::polkadot_runtime::SessionKeys, + proof: Vec, + }, + purge_keys, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidProof, + NoAssociatedValidatorId, + DuplicatedKey, + NoKeys, + NoAccount, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + NewSession(u32), + } + } + } + pub mod pallet_staking { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + bond { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + bond_extra { + #[codec(compact)] + max_additional: u128, + }, + unbond { + #[codec(compact)] + value: u128, + }, + withdraw_unbonded { + num_slashing_spans: u32, + }, + validate { + prefs: runtime_types::pallet_staking::ValidatorPrefs, + }, + nominate { + targets: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + }, + chill, + set_payee { + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + set_controller { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + set_validator_count { + #[codec(compact)] + new: u32, + }, + increase_validator_count { + #[codec(compact)] + additional: u32, + }, + scale_validator_count { + factor: runtime_types::sp_arithmetic::per_things::Percent, + }, + force_no_eras, + force_new_era, + set_invulnerables { + invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + }, + force_unstake { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: u32, + }, + force_new_era_always, + cancel_deferred_slash { + era: u32, + slash_indices: Vec, + }, + payout_stakers { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: u32, + }, + rebond { + #[codec(compact)] + value: u128, + }, + set_history_depth { + #[codec(compact)] + new_history_depth: u32, + #[codec(compact)] + era_items_deleted: u32, + }, + reap_stash { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: u32, + }, + kick { + who: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + >, + }, + set_staking_limits { + min_nominator_bond: u128, + min_validator_bond: u128, + max_nominator_count: Option, + max_validator_count: Option, + threshold: + Option, + }, + chill_other { + controller: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + NotController, + NotStash, + AlreadyBonded, + AlreadyPaired, + EmptyTargets, + DuplicateIndex, + InvalidSlashIndex, + InsufficientBond, + NoMoreChunks, + NoUnlockChunk, + FundedTarget, + InvalidEraToReward, + InvalidNumberOfNominations, + NotSortedAndUnique, + AlreadyClaimed, + IncorrectHistoryDepth, + IncorrectSlashingSpans, + BadState, + TooManyTargets, + BadTarget, + CannotChillOther, + TooManyNominators, + TooManyValidators, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + EraPaid(u32, u128, u128), + Rewarded(::subxt::sp_core::crypto::AccountId32, u128), + Slashed(::subxt::sp_core::crypto::AccountId32, u128), + OldSlashingReportDiscarded(u32), + StakersElected, + Bonded(::subxt::sp_core::crypto::AccountId32, u128), + Unbonded(::subxt::sp_core::crypto::AccountId32, u128), + Withdrawn(::subxt::sp_core::crypto::AccountId32, u128), + Kicked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + StakingElectionFailed, + Chilled(::subxt::sp_core::crypto::AccountId32), + PayoutStarted(u32, ::subxt::sp_core::crypto::AccountId32), + } + } + } + pub mod slashing { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct SlashingSpans { + pub span_index: u32, + pub last_start: u32, + pub last_nonzero_slash: u32, + pub prior: Vec, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct SpanRecord<_0> { + pub slashed: _0, + pub paid_out: _0, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ActiveEraInfo { + pub index: u32, + pub start: Option, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EraRewardPoints<_0> { + pub total: u32, + pub individual: std::collections::BTreeMap<_0, u32>, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Exposure<_0, _1> { + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub own: _1, + pub others: + Vec>, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Forcing { + NotForcing, + ForceNew, + ForceNone, + ForceAlways, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct IndividualExposure<_0, _1> { + pub who: _0, + #[codec(compact)] + pub value: _1, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Nominations<_0> { + pub targets: Vec<_0>, + pub submitted_in: u32, + pub suppressed: bool, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Releases { + V1_0_0Ancient, + V2_0_0, + V3_0_0, + V4_0_0, + V5_0_0, + V6_0_0, + V7_0_0, + V8_0_0, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum RewardDestination<_0> { + Staked, + Stash, + Controller, + Account(_0), + None, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct StakingLedger<_0, _1> { + pub stash: _0, + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub active: _1, + pub unlocking: Vec>, + pub claimed_rewards: Vec, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct UnappliedSlash<_0, _1> { + pub validator: _0, + pub own: _1, + pub others: Vec<(_0, _1)>, + pub reporters: Vec<_0>, + pub payout: _1, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct UnlockChunk<_0> { + #[codec(compact)] + pub value: _0, + #[codec(compact)] + pub era: u32, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ValidatorPrefs { + #[codec(compact)] + pub commission: ::subxt::sp_arithmetic::per_things::Perbill, + pub blocked: bool, + } + } + pub mod pallet_timestamp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + set { + #[codec(compact)] + now: u64, + }, + } + } + } + pub mod pallet_tips { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + report_awesome { + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + }, + retract_tip { + hash: ::subxt::sp_core::H256, + }, + tip_new { + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + tip_value: u128, + }, + tip { + hash: ::subxt::sp_core::H256, + #[codec(compact)] + tip_value: u128, + }, + close_tip { + hash: ::subxt::sp_core::H256, + }, + slash_tip { + hash: ::subxt::sp_core::H256, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + ReasonTooBig, + AlreadyKnown, + UnknownTip, + NotFinder, + StillOpen, + Premature, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + NewTip(::subxt::sp_core::H256), + TipClosing(::subxt::sp_core::H256), + TipClosed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + TipRetracted(::subxt::sp_core::H256), + TipSlashed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OpenTip<_0, _1, _2, _3> { + pub reason: _3, + pub who: _0, + pub finder: _0, + pub deposit: _1, + pub closes: Option<_2>, + pub tips: Vec<(_0, _1)>, + pub finders_fee: bool, + } + } + pub mod pallet_transaction_payment { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct ChargeTransactionPayment(pub u128); + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Releases { + V1Ancient, + V2, + } + } + pub mod pallet_treasury { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + propose_spend { + #[codec(compact)] + value: u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + reject_proposal { + #[codec(compact)] + proposal_id: u32, + }, + approve_proposal { + #[codec(compact)] + proposal_id: u32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InsufficientProposersBalance, + InvalidIndex, + TooManyApprovals, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Proposed(u32), + Spending(u128), + Awarded(u32, u128, ::subxt::sp_core::crypto::AccountId32), + Rejected(u32, u128), + Burnt(u128), + Rollover(u128), + Deposit(u128), + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + batch { + calls: Vec, + }, + as_derivative { + index: u16, + call: std::boxed::Box, + }, + batch_all { + calls: Vec, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + TooManyCalls, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + BatchInterrupted(u32, runtime_types::sp_runtime::DispatchError), + BatchCompleted, + ItemCompleted, + } + } + } + pub mod pallet_vesting { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + vest, + vest_other { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + vested_transfer { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, + >, + }, + 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< + u128, + u32, + >, + }, + merge_schedules { + schedule1_index: u32, + schedule2_index: u32, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + NotVesting, + AtMaxVestingSchedules, + AmountLow, + ScheduleIndexOutOfBounds, + InvalidScheduleParams, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + VestingUpdated(::subxt::sp_core::crypto::AccountId32, u128), + VestingCompleted(::subxt::sp_core::crypto::AccountId32), + } + } + pub mod vesting_info { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct VestingInfo<_0, _1> { + pub locked: _0, + pub per_block: _0, + pub starting_block: _1, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Releases { + V0, + V1, + } + } + pub mod polkadot_core_primitives { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct CandidateHash(pub ::subxt::sp_core::H256); + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct InboundDownwardMessage<_0> { + pub sent_at: _0, + pub msg: Vec, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct InboundHrmpMessage<_0> { + pub sent_at: _0, + pub data: Vec, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OutboundHrmpMessage<_0> { + pub recipient: _0, + pub data: Vec, + } + } + pub mod polkadot_parachain { + use super::runtime_types; + pub mod primitives { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct HeadData(pub Vec); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct HrmpChannelId { + pub sender: runtime_types::polkadot_parachain::primitives::Id, + pub recipient: runtime_types::polkadot_parachain::primitives::Id, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Id(pub u32); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ValidationCode(pub Vec); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); + } + } + pub mod polkadot_primitives { + use super::runtime_types; + pub mod v0 { + use super::runtime_types; + pub mod collator_app { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + pub mod validator_app { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ValidatorIndex(pub u32); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum ValidityAttestation { + Implicit( + runtime_types::polkadot_primitives::v0::validator_app::Signature, + ), + Explicit( + runtime_types::polkadot_primitives::v0::validator_app::Signature, + ), + } + } + pub mod v1 { + use super::runtime_types; + pub mod assignment_app { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + pub mod signed { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > , } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct AvailabilityBitfield( + pub runtime_types::bitvec::vec::BitVec< + runtime_types::bitvec::order::Lsb0, + u8, + >, + ); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BackedCandidate<_0> { + pub candidate: + runtime_types::polkadot_primitives::v1::CommittedCandidateReceipt< + _0, + >, + pub validity_votes: + Vec, + pub validator_indices: runtime_types::bitvec::vec::BitVec< + runtime_types::bitvec::order::Lsb0, + u8, + >, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CandidateCommitments<_0> { + pub upward_messages: Vec>, + pub horizontal_messages: Vec< + runtime_types::polkadot_core_primitives::OutboundHrmpMessage< + runtime_types::polkadot_parachain::primitives::Id, + >, + >, + pub new_validation_code: 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CandidateDescriptor<_0> { + pub para_id: runtime_types::polkadot_parachain::primitives::Id, + pub relay_parent: _0, + pub collator: + runtime_types::polkadot_primitives::v0::collator_app::Public, + pub persisted_validation_data_hash: _0, + pub pov_hash: _0, + pub erasure_root: _0, + pub signature: + runtime_types::polkadot_primitives::v0::collator_app::Signature, + pub para_head: _0, + pub validation_code_hash: + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CandidateReceipt<_0> { + pub descriptor: + runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, + pub commitments_hash: _0, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CommittedCandidateReceipt<_0> { + pub descriptor: + runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, + pub commitments: + runtime_types::polkadot_primitives::v1::CandidateCommitments, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CoreIndex(pub u32); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum CoreOccupied { + Parathread(runtime_types::polkadot_primitives::v1::ParathreadEntry), + Parachain, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum DisputeStatement { + Valid (runtime_types :: polkadot_primitives :: v1 :: ValidDisputeStatementKind ,) , Invalid (runtime_types :: polkadot_primitives :: v1 :: InvalidDisputeStatementKind ,) , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct DisputeStatementSet { + pub candidate_hash: + runtime_types::polkadot_core_primitives::CandidateHash, + pub session: u32, + pub statements: Vec<( + runtime_types::polkadot_primitives::v1::DisputeStatement, + runtime_types::polkadot_primitives::v0::ValidatorIndex, + runtime_types::polkadot_primitives::v0::validator_app::Signature, + )>, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct GroupIndex(pub u32); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct InherentData<_0> { + pub bitfields: Vec< + runtime_types::polkadot_primitives::v1::signed::UncheckedSigned< + runtime_types::polkadot_primitives::v1::AvailabilityBitfield, + runtime_types::polkadot_primitives::v1::AvailabilityBitfield, + >, + >, + pub backed_candidates: Vec< + runtime_types::polkadot_primitives::v1::BackedCandidate< + ::subxt::sp_core::H256, + >, + >, + pub disputes: + Vec, + pub parent_header: _0, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum InvalidDisputeStatementKind { + Explicit, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ParathreadClaim( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_primitives::v0::collator_app::Public, + ); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ParathreadEntry { + pub claim: runtime_types::polkadot_primitives::v1::ParathreadClaim, + pub retries: u32, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct SessionInfo { + pub validators: Vec< + runtime_types::polkadot_primitives::v0::validator_app::Public, + >, + pub discovery_keys: + Vec, + pub assignment_keys: Vec< + runtime_types::polkadot_primitives::v1::assignment_app::Public, + >, + pub validator_groups: + Vec>, + pub n_cores: u32, + pub zeroth_delay_tranche_width: u32, + pub relay_vrf_modulo_samples: u32, + pub n_delay_tranches: u32, + pub no_show_slots: u32, + pub needed_approvals: u32, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum UpgradeGoAhead { + Abort, + GoAhead, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum UpgradeRestriction { + Present, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum ValidDisputeStatementKind { + Explicit, + BackingSeconded(::subxt::sp_core::H256), + BackingValid(::subxt::sp_core::H256), + ApprovalChecking, + } + } + } + pub mod polkadot_runtime { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Call { + System (runtime_types :: frame_system :: pallet :: Call ,) , Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , Session (runtime_types :: pallet_session :: pallet :: Call ,) , Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , Council (runtime_types :: pallet_collective :: pallet :: Call ,) , TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Event { + System (runtime_types :: frame_system :: pallet :: Event ,) , Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , Session (runtime_types :: pallet_session :: pallet :: Event ,) , Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , Council (runtime_types :: pallet_collective :: pallet :: Event ,) , TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct NposCompactSolution16 { + votes1: Vec<(u32, u16)>, + votes2: Vec<( + u32, + (u16, runtime_types::sp_arithmetic::per_things::PerU16), + u16, + )>, + votes3: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 2usize], + u16, + )>, + votes4: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 3usize], + u16, + )>, + votes5: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 4usize], + u16, + )>, + votes6: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 5usize], + u16, + )>, + votes7: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 6usize], + u16, + )>, + votes8: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 7usize], + u16, + )>, + votes9: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 8usize], + u16, + )>, + votes10: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 9usize], + u16, + )>, + votes11: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 10usize], + u16, + )>, + votes12: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 11usize], + u16, + )>, + votes13: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 12usize], + u16, + )>, + votes14: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 13usize], + u16, + )>, + votes15: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 14usize], + u16, + )>, + votes16: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 15usize], + u16, + )>, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum OriginCaller { + system( + runtime_types::frame_system::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + Council( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + TechnicalCommittee( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + ParachainsOrigin( + runtime_types::polkadot_runtime_parachains::origin::pallet::Origin, + ), + Void(runtime_types::sp_core::Void), + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum ProxyType { + Any, + NonTransfer, + Governance, + Staking, + IdentityJudgement, + CancelProxy, + Auction, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Runtime {} + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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::v0::validator_app::Public, + pub para_assignment: + runtime_types::polkadot_primitives::v1::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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + new_auction { + #[codec(compact)] + duration: u32, + #[codec(compact)] + lease_period_index: u32, + }, + bid { + #[codec(compact)] + para: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + auction_index: u32, + #[codec(compact)] + first_slot: u32, + #[codec(compact)] + last_slot: u32, + #[codec(compact)] + amount: u128, + }, + cancel_auction, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + AuctionInProgress, + LeasePeriodInPast, + ParaNotRegistered, + NotCurrentAuction, + NotAuction, + AuctionEnded, + AlreadyLeasedOut, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + AuctionStarted(u32, u32, u32), + AuctionClosed(u32), + Reserved(::subxt::sp_core::crypto::AccountId32, u128, u128), + Unreserved(::subxt::sp_core::crypto::AccountId32, u128), + ReserveConfiscated( + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + BidAccepted( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + u128, + u32, + u32, + ), + WinningOffset(u32, u32), + } + } + } + pub mod claims { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : u128 , vesting_schedule : Option < (u128 , u128 , u32 ,) > , statement : Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : Vec < u8 > , } , attest { statement : Vec < u8 > , } , move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidEthereumSignature, + SignerHasNoClaim, + SenderHasNoClaim, + PotUnderflow, + InvalidStatement, + VestedBalanceExists, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Claimed (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , u128 ,) , } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct EcdsaSignature(pub [u8; 65usize]); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct EthereumAddress(pub [u8; 20usize]); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct PrevalidateAttests {} + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum StatementKind { + Regular, + Saft, + } + } + pub mod crowdloan { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + create { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + cap: u128, + #[codec(compact)] + first_period: u32, + #[codec(compact)] + last_period: u32, + #[codec(compact)] + end: u32, + verifier: Option, + }, + contribute { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + value: u128, + signature: Option, + }, + withdraw { + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + }, + refund { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + }, + dissolve { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + }, + edit { + #[codec(compact)] + index: runtime_types::polkadot_parachain::primitives::Id, + #[codec(compact)] + cap: u128, + #[codec(compact)] + first_period: u32, + #[codec(compact)] + last_period: u32, + #[codec(compact)] + end: u32, + verifier: Option, + }, + add_memo { + index: runtime_types::polkadot_parachain::primitives::Id, + memo: Vec, + }, + poke { + index: runtime_types::polkadot_parachain::primitives::Id, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + FirstPeriodInPast, + FirstPeriodTooFarInFuture, + LastPeriodBeforeFirstPeriod, + LastPeriodTooFarInFuture, + CannotEndInPast, + EndTooFarInFuture, + Overflow, + ContributionTooSmall, + InvalidParaId, + CapExceeded, + ContributionPeriodOver, + InvalidOrigin, + NotParachain, + LeaseActive, + BidOrLeaseActive, + FundNotEnded, + NoContributions, + NotReadyToDissolve, + InvalidSignature, + MemoTooLarge, + AlreadyInNewRaise, + VrfDelayInProgress, + NoLeasePeriod, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Created(runtime_types::polkadot_parachain::primitives::Id), + Contributed( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + u128, + ), + Withdrew( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + u128, + ), + PartiallyRefunded( + runtime_types::polkadot_parachain::primitives::Id, + ), + AllRefunded(runtime_types::polkadot_parachain::primitives::Id), + Dissolved(runtime_types::polkadot_parachain::primitives::Id), + HandleBidResult( + runtime_types::polkadot_parachain::primitives::Id, + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + Edited(runtime_types::polkadot_parachain::primitives::Id), + MemoUpdated( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::polkadot_parachain::primitives::Id, + Vec, + ), + AddedToNewRaise( + runtime_types::polkadot_parachain::primitives::Id, + ), + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : 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 trie_index : _2 , pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum LastContribution<_0> { + Never, + PreEnding(_0), + Ending(_0), + } + } + pub mod paras_registrar { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , force_register { who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , reserve , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + NotRegistered, + AlreadyRegistered, + NotOwner, + CodeTooLarge, + HeadDataTooLarge, + NotParachain, + NotParathread, + CannotDeregister, + CannotDowngrade, + CannotUpgrade, + ParaLocked, + NotReserved, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + Registered( + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::sp_core::crypto::AccountId32, + ), + Deregistered(runtime_types::polkadot_parachain::primitives::Id), + Reserved( + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::sp_core::crypto::AccountId32, + ), + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ParaInfo<_0, _1> { + pub manager: _0, + pub deposit: _1, + pub locked: bool, + } + } + pub mod slots { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + force_lease { + para: runtime_types::polkadot_parachain::primitives::Id, + leaser: ::subxt::sp_core::crypto::AccountId32, + amount: u128, + period_begin: u32, + period_count: u32, + }, + clear_all_leases { + para: runtime_types::polkadot_parachain::primitives::Id, + }, + trigger_onboard { + para: runtime_types::polkadot_parachain::primitives::Id, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + ParaNotOnboarding, + LeaseError, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + NewLeasePeriod(u32), + Leased( + runtime_types::polkadot_parachain::primitives::Id, + ::subxt::sp_core::crypto::AccountId32, + u32, + u32, + u128, + u128, + ), + } + } + } + } + pub mod polkadot_runtime_parachains { + use super::runtime_types; + pub mod configuration { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + set_validation_upgrade_frequency { new: u32 }, + set_validation_upgrade_delay { new: u32 }, + set_code_retention_period { new: u32 }, + set_max_code_size { new: u32 }, + set_max_pov_size { new: u32 }, + set_max_head_data_size { new: u32 }, + set_parathread_cores { new: u32 }, + set_parathread_retries { new: u32 }, + set_group_rotation_frequency { new: u32 }, + set_chain_availability_period { new: u32 }, + set_thread_availability_period { new: u32 }, + set_scheduling_lookahead { new: u32 }, + set_max_validators_per_core { new: Option }, + set_max_validators { new: Option }, + set_dispute_period { new: u32 }, + set_dispute_post_conclusion_acceptance_period { new: u32 }, + set_dispute_max_spam_slots { new: u32 }, + set_dispute_conclusion_by_time_out_period { new: u32 }, + set_no_show_slots { new: u32 }, + set_n_delay_tranches { new: u32 }, + set_zeroth_delay_tranche_width { new: u32 }, + set_needed_approvals { new: u32 }, + set_relay_vrf_modulo_samples { new: u32 }, + set_max_upward_queue_count { new: u32 }, + set_max_upward_queue_size { new: u32 }, + set_max_downward_message_size { new: u32 }, + set_ump_service_total_weight { new: u64 }, + set_max_upward_message_size { new: u32 }, + set_max_upward_message_num_per_candidate { new: u32 }, + set_hrmp_open_request_ttl { new: u32 }, + set_hrmp_sender_deposit { new: u128 }, + set_hrmp_recipient_deposit { new: u128 }, + set_hrmp_channel_max_capacity { new: u32 }, + set_hrmp_channel_max_total_size { new: u32 }, + set_hrmp_max_parachain_inbound_channels { new: u32 }, + set_hrmp_max_parathread_inbound_channels { new: u32 }, + set_hrmp_channel_max_message_size { new: u32 }, + set_hrmp_max_parachain_outbound_channels { new: u32 }, + set_hrmp_max_parathread_outbound_channels { new: u32 }, + set_hrmp_max_message_num_per_candidate { new: u32 }, + set_ump_max_individual_weight { new: u64 }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + InvalidNewValue, + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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: u64, + pub hrmp_max_parachain_outbound_channels: _0, + pub hrmp_max_parathread_outbound_channels: _0, + pub hrmp_sender_deposit: u128, + pub hrmp_recipient_deposit: 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: Option<_0>, + pub max_validators: 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: u64, + } + } + pub mod dmp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call {} + } + } + pub mod hrmp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : u32 , proposed_max_message_size : u32 , } , hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , force_process_hrmp_open , force_process_hrmp_close , hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + OpenHrmpChannelToSelf, + OpenHrmpChannelInvalidRecipient, + OpenHrmpChannelZeroCapacity, + OpenHrmpChannelCapacityExceedsLimit, + OpenHrmpChannelZeroMessageSize, + OpenHrmpChannelMessageSizeExceedsLimit, + OpenHrmpChannelAlreadyExists, + OpenHrmpChannelAlreadyRequested, + OpenHrmpChannelLimitExceeded, + AcceptHrmpChannelDoesntExist, + AcceptHrmpChannelAlreadyConfirmed, + AcceptHrmpChannelLimitExceeded, + CloseHrmpChannelUnauthorized, + CloseHrmpChannelDoesntExist, + CloseHrmpChannelAlreadyUnderway, + CancelHrmpOpenChannelUnauthorized, + OpenHrmpChannelDoesntExist, + OpenHrmpChannelAlreadyConfirmed, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + OpenChannelRequested( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::Id, + u32, + u32, + ), + OpenChannelCanceled( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ), + OpenChannelAccepted( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::Id, + ), + ChannelClosed( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + ), + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct HrmpChannel { + pub max_capacity: u32, + pub max_total_size: u32, + pub max_message_size: u32, + pub msg_count: u32, + pub total_size: u32, + pub mqc_head: Option<::subxt::sp_core::H256>, + pub sender_deposit: u128, + pub recipient_deposit: u128, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct HrmpOpenChannelRequest { + pub confirmed: bool, + pub _age: u32, + pub sender_deposit: u128, + pub max_message_size: u32, + pub max_capacity: u32, + pub max_total_size: u32, + } + } + pub mod inclusion { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call {} + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + WrongBitfieldSize, + BitfieldDuplicateOrUnordered, + ValidatorIndexOutOfBounds, + InvalidBitfieldSignature, + UnscheduledCandidate, + CandidateScheduledBeforeParaFree, + WrongCollator, + ScheduledOutOfOrder, + HeadDataTooLarge, + PrematureCodeUpgrade, + NewCodeTooLarge, + CandidateNotInParentContext, + UnoccupiedBitInBitfield, + InvalidGroupIndex, + InsufficientBacking, + InvalidBacking, + NotCollatorSigned, + ValidationDataHashMismatch, + InternalError, + IncorrectDownwardMessageHandling, + InvalidUpwardMessages, + HrmpWatermarkMishandling, + InvalidOutboundHrmp, + InvalidValidationCodeHash, + ParaHeadMismatch, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + CandidateBacked( + runtime_types::polkadot_primitives::v1::CandidateReceipt< + ::subxt::sp_core::H256, + >, + runtime_types::polkadot_parachain::primitives::HeadData, + runtime_types::polkadot_primitives::v1::CoreIndex, + runtime_types::polkadot_primitives::v1::GroupIndex, + ), + CandidateIncluded( + runtime_types::polkadot_primitives::v1::CandidateReceipt< + ::subxt::sp_core::H256, + >, + runtime_types::polkadot_parachain::primitives::HeadData, + runtime_types::polkadot_primitives::v1::CoreIndex, + runtime_types::polkadot_primitives::v1::GroupIndex, + ), + CandidateTimedOut( + runtime_types::polkadot_primitives::v1::CandidateReceipt< + ::subxt::sp_core::H256, + >, + runtime_types::polkadot_parachain::primitives::HeadData, + runtime_types::polkadot_primitives::v1::CoreIndex, + ), + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct AvailabilityBitfieldRecord<_0> { + pub bitfield: + runtime_types::polkadot_primitives::v1::AvailabilityBitfield, + pub submitted_at: _0, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CandidatePendingAvailability<_0, _1> { + pub core: runtime_types::polkadot_primitives::v1::CoreIndex, + pub hash: runtime_types::polkadot_core_primitives::CandidateHash, + pub descriptor: + runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, + pub availability_votes: runtime_types::bitvec::vec::BitVec< + runtime_types::bitvec::order::Lsb0, + u8, + >, + pub backers: runtime_types::bitvec::vec::BitVec< + runtime_types::bitvec::order::Lsb0, + u8, + >, + pub relay_parent_number: _1, + pub backed_in_number: _1, + pub backing_group: runtime_types::polkadot_primitives::v1::GroupIndex, + } + } + pub mod initializer { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + force_approve { up_to: u32 }, + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BufferedSessionChange { + pub validators: Vec< + runtime_types::polkadot_primitives::v0::validator_app::Public, + >, + pub queued: Vec< + runtime_types::polkadot_primitives::v0::validator_app::Public, + >, + pub session_index: u32, + } + } + pub mod origin { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Origin { + Parachain(runtime_types::polkadot_parachain::primitives::Id), + } + } + } + pub mod paras { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : u32 , } , force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + NotRegistered, + CannotOnboard, + CannotOffboard, + CannotUpgrade, + CannotDowngrade, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + CurrentCodeUpdated( + runtime_types::polkadot_parachain::primitives::Id, + ), + CurrentHeadUpdated( + runtime_types::polkadot_parachain::primitives::Id, + ), + CodeUpgradeScheduled( + runtime_types::polkadot_parachain::primitives::Id, + ), + NewHeadNoted(runtime_types::polkadot_parachain::primitives::Id), + ActionQueued( + runtime_types::polkadot_parachain::primitives::Id, + u32, + ), + } + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ParaGenesisArgs { + pub genesis_head: + runtime_types::polkadot_parachain::primitives::HeadData, + pub validation_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + pub parachain: bool, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum ParaLifecycle { + Onboarding, + Parathread, + Parachain, + UpgradingParathread, + DowngradingParachain, + OffboardingParathread, + OffboardingParachain, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ParaPastCodeMeta < _0 > { pub upgrade_times : Vec < runtime_types :: polkadot_runtime_parachains :: paras :: ReplacementTimes < _0 > > , pub last_pruned : Option < _0 > , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + enter { + data: runtime_types::polkadot_primitives::v1::InherentData< + runtime_types::sp_runtime::generic::header::Header< + u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + TooManyInclusionInherents, + InvalidParentHeader, + CandidateConcludedInvalid, + } + } + } + pub mod scheduler { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum AssignmentKind { + Parachain, + Parathread( + runtime_types::polkadot_primitives::v0::collator_app::Public, + u32, + ), + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v1 :: 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 :: v1 :: GroupIndex , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ParathreadClaimQueue { pub queue : Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: QueuedParathread > , pub next_core_offset : u32 , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct QueuedParathread { + pub claim: runtime_types::polkadot_primitives::v1::ParathreadEntry, + pub core_offset: u32, + } + } + pub mod shared { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call {} + } + } + pub mod ump { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Call { + service_overweight { index: u64, weight_limit: u64 }, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + UnknownMessageIndex, + WeightOverLimit, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Event { + InvalidFormat([u8; 32usize]), + UnsupportedVersion([u8; 32usize]), + ExecutedUpward( + [u8; 32usize], + runtime_types::xcm::v2::traits::Outcome, + ), + WeightExhausted([u8; 32usize], u64, u64), + UpwardMessagesReceived( + runtime_types::polkadot_parachain::primitives::Id, + u32, + u32, + ), + OverweightEnqueued( + runtime_types::polkadot_parachain::primitives::Id, + [u8; 32usize], + u64, + u64, + ), + OverweightServiced(u64, u64), + } + } + } + } + pub mod primitive_types { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct H256(pub [u8; 32usize]); + } + pub mod sp_arithmetic { + use super::runtime_types; + pub mod fixed_point { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct FixedU128(pub u128); + } + pub mod per_things { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct PerU16(pub u16); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Perbill(pub u32); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Percent(pub u8); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Permill(pub u32); + } + } + pub mod sp_authority_discovery { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + pub mod digests { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum NextConfigDescriptor { + V1 { + c: (u64, u64), + allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + }, + } + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum AllowedSlots { + PrimarySlots, + PrimaryAndSecondaryPlainSlots, + PrimaryAndSecondaryVRFSlots, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct BabeEpochConfiguration { + pub c: (u64, u64), + pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + } + } + pub mod sp_consensus_slots { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Slot(pub u64); + } + pub mod sp_core { + use super::runtime_types; + pub mod changes_trie { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct ChangesTrieConfiguration { + pub digest_interval: u32, + pub digest_levels: u32, + } + } + pub mod crypto { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct AccountId32(pub [u8; 32usize]); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct KeyTypeId(pub [u8; 4usize]); + } + pub mod ecdsa { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub [u8; 33usize]); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub [u8; 65usize]); + } + pub mod ed25519 { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub [u8; 32usize]); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub [u8; 64usize]); + } + pub mod offchain { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct OpaqueMultiaddr(pub Vec); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct OpaqueNetworkState { + pub peer_id: runtime_types::sp_core::OpaquePeerId, + pub external_addresses: + Vec, + } + } + pub mod sr25519 { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub [u8; 32usize]); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub [u8; 64usize]); + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct OpaquePeerId(pub Vec); + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Void {} + } + pub mod sp_finality_grandpa { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::ed25519::Public); + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum Equivocation<_0, _1> { + 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, + >, + ), + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct EquivocationProof<_0, _1> { + pub set_id: u64, + pub equivocation: + runtime_types::sp_finality_grandpa::Equivocation<_0, _1>, + } + } + pub mod sp_npos_elections { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct Support<_0> { + pub total: u128, + pub voters: Vec<(_0, u128)>, + } + } + pub mod sp_runtime { + use super::runtime_types; + pub mod generic { + use super::runtime_types; + pub mod digest { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum ChangesTrieSignal { + NewConfiguration (Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > ,) , } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct Digest<_0> { + pub logs: Vec< + runtime_types::sp_runtime::generic::digest::DigestItem<_0>, + >, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum DigestItem<_0> { + ChangesTrieRoot(_0), + PreRuntime([u8; 4usize], Vec), + Consensus([u8; 4usize], Vec), + Seal([u8; 4usize], Vec), + ChangesTrieSignal( + runtime_types::sp_runtime::generic::digest::ChangesTrieSignal, + ), + Other(Vec), + RuntimeEnvironmentUpdated, + } + } + pub mod era { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Era { + Immortal, + Mortal1(u8), + Mortal2(u8), + Mortal3(u8), + Mortal4(u8), + Mortal5(u8), + Mortal6(u8), + Mortal7(u8), + Mortal8(u8), + Mortal9(u8), + Mortal10(u8), + Mortal11(u8), + Mortal12(u8), + Mortal13(u8), + Mortal14(u8), + Mortal15(u8), + Mortal16(u8), + Mortal17(u8), + Mortal18(u8), + Mortal19(u8), + Mortal20(u8), + Mortal21(u8), + Mortal22(u8), + Mortal23(u8), + Mortal24(u8), + Mortal25(u8), + Mortal26(u8), + Mortal27(u8), + Mortal28(u8), + Mortal29(u8), + Mortal30(u8), + Mortal31(u8), + Mortal32(u8), + Mortal33(u8), + Mortal34(u8), + Mortal35(u8), + Mortal36(u8), + Mortal37(u8), + Mortal38(u8), + Mortal39(u8), + Mortal40(u8), + Mortal41(u8), + Mortal42(u8), + Mortal43(u8), + Mortal44(u8), + Mortal45(u8), + Mortal46(u8), + Mortal47(u8), + Mortal48(u8), + Mortal49(u8), + Mortal50(u8), + Mortal51(u8), + Mortal52(u8), + Mortal53(u8), + Mortal54(u8), + Mortal55(u8), + Mortal56(u8), + Mortal57(u8), + Mortal58(u8), + Mortal59(u8), + Mortal60(u8), + Mortal61(u8), + Mortal62(u8), + Mortal63(u8), + Mortal64(u8), + Mortal65(u8), + Mortal66(u8), + Mortal67(u8), + Mortal68(u8), + Mortal69(u8), + Mortal70(u8), + Mortal71(u8), + Mortal72(u8), + Mortal73(u8), + Mortal74(u8), + Mortal75(u8), + Mortal76(u8), + Mortal77(u8), + Mortal78(u8), + Mortal79(u8), + Mortal80(u8), + Mortal81(u8), + Mortal82(u8), + Mortal83(u8), + Mortal84(u8), + Mortal85(u8), + Mortal86(u8), + Mortal87(u8), + Mortal88(u8), + Mortal89(u8), + Mortal90(u8), + Mortal91(u8), + Mortal92(u8), + Mortal93(u8), + Mortal94(u8), + Mortal95(u8), + Mortal96(u8), + Mortal97(u8), + Mortal98(u8), + Mortal99(u8), + Mortal100(u8), + Mortal101(u8), + Mortal102(u8), + Mortal103(u8), + Mortal104(u8), + Mortal105(u8), + Mortal106(u8), + Mortal107(u8), + Mortal108(u8), + Mortal109(u8), + Mortal110(u8), + Mortal111(u8), + Mortal112(u8), + Mortal113(u8), + Mortal114(u8), + Mortal115(u8), + Mortal116(u8), + Mortal117(u8), + Mortal118(u8), + Mortal119(u8), + Mortal120(u8), + Mortal121(u8), + Mortal122(u8), + Mortal123(u8), + Mortal124(u8), + Mortal125(u8), + Mortal126(u8), + Mortal127(u8), + Mortal128(u8), + Mortal129(u8), + Mortal130(u8), + Mortal131(u8), + Mortal132(u8), + Mortal133(u8), + Mortal134(u8), + Mortal135(u8), + Mortal136(u8), + Mortal137(u8), + Mortal138(u8), + Mortal139(u8), + Mortal140(u8), + Mortal141(u8), + Mortal142(u8), + Mortal143(u8), + Mortal144(u8), + Mortal145(u8), + Mortal146(u8), + Mortal147(u8), + Mortal148(u8), + Mortal149(u8), + Mortal150(u8), + Mortal151(u8), + Mortal152(u8), + Mortal153(u8), + Mortal154(u8), + Mortal155(u8), + Mortal156(u8), + Mortal157(u8), + Mortal158(u8), + Mortal159(u8), + Mortal160(u8), + Mortal161(u8), + Mortal162(u8), + Mortal163(u8), + Mortal164(u8), + Mortal165(u8), + Mortal166(u8), + Mortal167(u8), + Mortal168(u8), + Mortal169(u8), + Mortal170(u8), + Mortal171(u8), + Mortal172(u8), + Mortal173(u8), + Mortal174(u8), + Mortal175(u8), + Mortal176(u8), + Mortal177(u8), + Mortal178(u8), + Mortal179(u8), + Mortal180(u8), + Mortal181(u8), + Mortal182(u8), + Mortal183(u8), + Mortal184(u8), + Mortal185(u8), + Mortal186(u8), + Mortal187(u8), + Mortal188(u8), + Mortal189(u8), + Mortal190(u8), + Mortal191(u8), + Mortal192(u8), + Mortal193(u8), + Mortal194(u8), + Mortal195(u8), + Mortal196(u8), + Mortal197(u8), + Mortal198(u8), + Mortal199(u8), + Mortal200(u8), + Mortal201(u8), + Mortal202(u8), + Mortal203(u8), + Mortal204(u8), + Mortal205(u8), + Mortal206(u8), + Mortal207(u8), + Mortal208(u8), + Mortal209(u8), + Mortal210(u8), + Mortal211(u8), + Mortal212(u8), + Mortal213(u8), + Mortal214(u8), + Mortal215(u8), + Mortal216(u8), + Mortal217(u8), + Mortal218(u8), + Mortal219(u8), + Mortal220(u8), + Mortal221(u8), + Mortal222(u8), + Mortal223(u8), + Mortal224(u8), + Mortal225(u8), + Mortal226(u8), + Mortal227(u8), + Mortal228(u8), + Mortal229(u8), + Mortal230(u8), + Mortal231(u8), + Mortal232(u8), + Mortal233(u8), + Mortal234(u8), + Mortal235(u8), + Mortal236(u8), + Mortal237(u8), + Mortal238(u8), + Mortal239(u8), + Mortal240(u8), + Mortal241(u8), + Mortal242(u8), + Mortal243(u8), + Mortal244(u8), + Mortal245(u8), + Mortal246(u8), + Mortal247(u8), + Mortal248(u8), + Mortal249(u8), + Mortal250(u8), + Mortal251(u8), + Mortal252(u8), + Mortal253(u8), + Mortal254(u8), + Mortal255(u8), + } + } + pub mod header { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + 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< + ::subxt::sp_core::H256, + >, + pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, + } + } + pub mod unchecked_extrinsic { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct UncheckedExtrinsic<_0, _1, _2, _3>( + Vec, + pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, + ); + } + } + pub mod multiaddress { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum MultiAddress<_0, _1> { + Id(_0), + Index(_1), + Raw(Vec), + Address32([u8; 32usize]), + Address20([u8; 20usize]), + } + } + pub mod traits { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct BlakeTwo256 {} + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum ArithmeticError { + Underflow, + Overflow, + DivisionByZero, + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum DispatchError { + Other, + CannotLookup, + BadOrigin, + Module { index: u8, error: u8 }, + ConsumerRemaining, + NoProviders, + Token(runtime_types::sp_runtime::TokenError), + Arithmetic(runtime_types::sp_runtime::ArithmeticError), + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum MultiSignature { + Ed25519(runtime_types::sp_core::ed25519::Signature), + Sr25519(runtime_types::sp_core::sr25519::Signature), + Ecdsa(runtime_types::sp_core::ecdsa::Signature), + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum MultiSigner { + Ed25519(runtime_types::sp_core::ed25519::Public), + Sr25519(runtime_types::sp_core::sr25519::Public), + Ecdsa(runtime_types::sp_core::ecdsa::Public), + } + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub enum TokenError { + NoFunds, + WouldDie, + BelowMinimum, + CannotCreate, + UnknownAsset, + Frozen, + Unsupported, + } + } + pub mod sp_session { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct MembershipProof { + pub session: u32, + pub trie_nodes: Vec>, + pub validator_count: u32, + } + } + pub mod sp_staking { + use super::runtime_types; + pub mod offence { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub struct OffenceDetails<_0, _1> { + pub offender: _1, + pub reporters: Vec<_0>, + } + } + } + pub mod sp_version { + use super::runtime_types; + #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + pub struct RuntimeVersion { + pub spec_name: String, + pub impl_name: String, + pub authoring_version: u32, + pub spec_version: u32, + pub impl_version: u32, + pub apis: Vec<([u8; 8usize], u32)>, + pub transaction_version: u32, + } + } + pub mod xcm { + use super::runtime_types; + pub mod v2 { + use super::runtime_types; + pub mod traits { + use super::runtime_types; + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Error { + Overflow, + Unimplemented, + UntrustedReserveLocation, + UntrustedTeleportLocation, + MultiLocationFull, + MultiLocationNotInvertible, + BadOrigin, + InvalidLocation, + AssetNotFound, + FailedToTransactAsset, + NotWithdrawable, + LocationCannotHold, + ExceedsMaxMessageSize, + DestinationUnsupported, + Transport, + Unroutable, + UnknownClaim, + FailedToDecode, + TooMuchWeightRequired, + NotHoldingFees, + TooExpensive, + Trap(u64), + UnhandledXcmVersion, + WeightLimitReached(u64), + Barrier, + WeightNotComputable, + } + #[derive( + Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + )] + pub enum Outcome { + Complete(u64), + Incomplete(u64, runtime_types::xcm::v2::traits::Error), + Error(runtime_types::xcm::v2::traits::Error), + } + } + } + } + } + #[doc = r" Default configuration of common types for a target Substrate runtime."] + #[derive(Clone, Debug, Default, Eq, PartialEq)] + pub struct DefaultConfig; + impl ::subxt::Config for DefaultConfig { + type Index = u32; + type BlockNumber = u32; + type Hash = ::subxt::sp_core::H256; + type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; + type AccountId = ::subxt::sp_runtime::AccountId32; + type Address = ::subxt::sp_runtime::MultiAddress; + type Header = ::subxt::sp_runtime::generic::Header< + Self::BlockNumber, + ::subxt::sp_runtime::traits::BlakeTwo256, + >; + type Signature = ::subxt::sp_runtime::MultiSignature; + type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; + } + impl ::subxt::ExtrinsicExtraData for DefaultConfig { + type AccountData = AccountData; + type Extra = ::subxt::DefaultExtra; + } + pub type AccountData = self::system::storage::Account; + impl ::subxt::AccountData for AccountData { + fn nonce( + result: &::Value, + ) -> ::Index { + result.nonce + } + fn storage_entry( + account_id: ::AccountId, + ) -> Self { + Self(account_id) + } + } + pub struct RuntimeApi> { + pub client: ::subxt::Client, + } + impl ::core::convert::From<::subxt::Client> for RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + fn from(client: ::subxt::Client) -> Self { + Self { client } + } + } + impl<'a, T> RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn storage(&'a self) -> StorageApi<'a, T> { + StorageApi { + client: &self.client, + } + } + pub fn tx(&'a self) -> TransactionApi<'a, T> { + TransactionApi { + client: &self.client, + } + } + } + pub struct StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + client: &'a ::subxt::Client, + } + impl<'a, T> StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + 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 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 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 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 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 struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { + client: &'a ::subxt::Client, + } + impl<'a, T> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn system(&self) -> system::calls::TransactionApi<'a, T> { + system::calls::TransactionApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T> { + scheduler::calls::TransactionApi::new(self.client) + } + pub fn babe(&self) -> babe::calls::TransactionApi<'a, T> { + babe::calls::TransactionApi::new(self.client) + } + pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T> { + timestamp::calls::TransactionApi::new(self.client) + } + pub fn indices(&self) -> indices::calls::TransactionApi<'a, T> { + indices::calls::TransactionApi::new(self.client) + } + pub fn balances(&self) -> balances::calls::TransactionApi<'a, T> { + balances::calls::TransactionApi::new(self.client) + } + pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { + authorship::calls::TransactionApi::new(self.client) + } + pub fn staking(&self) -> staking::calls::TransactionApi<'a, T> { + staking::calls::TransactionApi::new(self.client) + } + pub fn session(&self) -> session::calls::TransactionApi<'a, T> { + session::calls::TransactionApi::new(self.client) + } + pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { + grandpa::calls::TransactionApi::new(self.client) + } + pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { + im_online::calls::TransactionApi::new(self.client) + } + pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T> { + democracy::calls::TransactionApi::new(self.client) + } + pub fn council(&self) -> council::calls::TransactionApi<'a, T> { + council::calls::TransactionApi::new(self.client) + } + pub fn technical_committee( + &self, + ) -> technical_committee::calls::TransactionApi<'a, T> { + technical_committee::calls::TransactionApi::new(self.client) + } + pub fn phragmen_election( + &self, + ) -> phragmen_election::calls::TransactionApi<'a, T> { + phragmen_election::calls::TransactionApi::new(self.client) + } + pub fn technical_membership( + &self, + ) -> technical_membership::calls::TransactionApi<'a, T> { + technical_membership::calls::TransactionApi::new(self.client) + } + pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T> { + treasury::calls::TransactionApi::new(self.client) + } + pub fn claims(&self) -> claims::calls::TransactionApi<'a, T> { + claims::calls::TransactionApi::new(self.client) + } + pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T> { + vesting::calls::TransactionApi::new(self.client) + } + pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { + utility::calls::TransactionApi::new(self.client) + } + pub fn identity(&self) -> identity::calls::TransactionApi<'a, T> { + identity::calls::TransactionApi::new(self.client) + } + pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T> { + proxy::calls::TransactionApi::new(self.client) + } + pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T> { + multisig::calls::TransactionApi::new(self.client) + } + pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T> { + bounties::calls::TransactionApi::new(self.client) + } + pub fn tips(&self) -> tips::calls::TransactionApi<'a, T> { + tips::calls::TransactionApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::calls::TransactionApi<'a, T> { + election_provider_multi_phase::calls::TransactionApi::new(self.client) + } + pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T> { + configuration::calls::TransactionApi::new(self.client) + } + pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T> { + paras_shared::calls::TransactionApi::new(self.client) + } + pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T> { + para_inclusion::calls::TransactionApi::new(self.client) + } + pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T> { + para_inherent::calls::TransactionApi::new(self.client) + } + pub fn paras(&self) -> paras::calls::TransactionApi<'a, T> { + paras::calls::TransactionApi::new(self.client) + } + pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T> { + initializer::calls::TransactionApi::new(self.client) + } + pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T> { + dmp::calls::TransactionApi::new(self.client) + } + pub fn ump(&self) -> ump::calls::TransactionApi<'a, T> { + ump::calls::TransactionApi::new(self.client) + } + pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T> { + hrmp::calls::TransactionApi::new(self.client) + } + pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T> { + registrar::calls::TransactionApi::new(self.client) + } + pub fn slots(&self) -> slots::calls::TransactionApi<'a, T> { + slots::calls::TransactionApi::new(self.client) + } + pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T> { + auctions::calls::TransactionApi::new(self.client) + } + pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T> { + crowdloan::calls::TransactionApi::new(self.client) + } + } +} \ No newline at end of file diff --git a/tests/integration/main.rs b/tests/integration/main.rs index 0dcdd79136..40ee6f31b7 100644 --- a/tests/integration/main.rs +++ b/tests/integration/main.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +mod codegen; mod runtime; mod utils; From 562b5932d21337f9830b179899e9097feef4f93f Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 19 Oct 2021 17:26:27 +0100 Subject: [PATCH 161/216] Comment about how to run codegen --- tests/integration/codegen/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/codegen/mod.rs b/tests/integration/codegen/mod.rs index c79e02bfd9..cc3a9039a2 100644 --- a/tests/integration/codegen/mod.rs +++ b/tests/integration/codegen/mod.rs @@ -14,7 +14,10 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -/// generate by: +/// 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 --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs` From 398c63c7b0bb4372ab49856f40c0f7957adfa90c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 21 Oct 2021 16:52:05 +0100 Subject: [PATCH 162/216] Derive AsCompact for structs with single concrete unsigned int field --- codegen/src/types.rs | 159 +++++++++++++++++++++++--- tests/integration/codegen/mod.rs | 2 +- tests/integration/codegen/polkadot.rs | 101 +++++++++++++--- 3 files changed, 229 insertions(+), 33 deletions(-) diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 9a9812aabe..e3bb416bda 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -272,8 +272,37 @@ impl<'a> quote::ToTokens for ModuleType<'a> { let type_name = type_name.expect("structs should have a name"); let (fields, _) = self.composite_fields(composite.fields(), &type_params, true); + let derive_as_compact = if composite.fields().len() == 1 { + // any single field wrapper struct with a concrete unsigned int type can derive + // CompactAs. + let field = &composite.fields()[0]; + if !self.ty.type_params() + .iter() + .any(|tp| Some(tp.name()) == field.type_name()) + { + let ty = self.type_gen.resolve_type(field.ty().id()); + if matches!( + ty.type_def(), + TypeDef::Primitive( + TypeDefPrimitive::U8 + | TypeDefPrimitive::U16 + | TypeDefPrimitive::U32 + | TypeDefPrimitive::U64 + | TypeDefPrimitive::U128 + ) + ) { + Some(quote!( , ::codec::CompactAs )) + } else { + None + } + } else { + None + } + } else { + None + }; let ty_toks = quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode #derive_as_compact)] pub struct #type_name #fields }; tokens.extend(ty_toks); @@ -410,7 +439,7 @@ impl<'a> ModuleType<'a> { if is_struct && !unused_params.is_empty() { let phantom = Self::phantom_data(&unused_params); fields_tokens.push(quote! { - pub __subxt_unused_type_params: #phantom + #[codec(skip)] pub __subxt_unused_type_params: #phantom }) } @@ -454,7 +483,7 @@ impl<'a> ModuleType<'a> { if is_struct && !unused_params.is_empty() { let phantom_data = Self::phantom_data(&unused_params); - fields_tokens.push(quote! { pub #phantom_data }) + fields_tokens.push(quote! { #[codec(skip)] pub #phantom_data }) } let fields = quote! { ( #( #fields_tokens, )* ) }; @@ -703,8 +732,7 @@ mod tests { TypeInfo, }; - const MOD_PATH: &'static [&'static str] = - &["chameleon_core", "generate_types", "tests"]; + const MOD_PATH: &'static [&'static str] = &["subxt_codegen", "types", "tests"]; fn get_mod<'a>( module: &'a Module, @@ -793,7 +821,7 @@ mod tests { #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Parent { pub a: bool, - pub b: root::chameleon_core::generate_types::tests::Child, + pub b: root::subxt_codegen::types::tests::Child, } } } @@ -829,13 +857,114 @@ mod tests { pub struct Child(pub i32,); #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] - pub struct Parent(pub bool, pub root::chameleon_core::generate_types::tests::Child,); + pub struct Parent(pub bool, pub root::subxt_codegen::types::tests::Child,); } } .to_string() ) } + #[test] + fn derive_compact_as_for_uint_wrapper_structs() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Su8 { + a: u8, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu8(u8); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su16 { + a: u16, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu16(u16); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su32 { + a: u32, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu32(u32); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su64 { + a: u64, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu64(u64); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su128 { + a: u128, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu128(u128); + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct Su128 { pub a: u128, } + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct Su16 { pub a: u16, } + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct Su32 { pub a: u32, } + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct Su64 { pub a: u64, } + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct Su8 { pub a: u8, } + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct TSu128(pub u128,); + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct TSu16(pub u16,); + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct TSu32(pub u32,); + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct TSu64(pub u64,); + + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] + pub struct TSu8(pub u8,); + } + } + .to_string() + ) + } + #[test] fn generate_enum() { #[allow(unused)] @@ -1070,8 +1199,8 @@ mod tests { use super::root; #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Bar { - pub b: root::chameleon_core::generate_types::tests::Foo, - pub c: root::chameleon_core::generate_types::tests::Foo, + pub b: root::subxt_codegen::types::tests::Foo, + pub c: root::subxt_codegen::types::tests::Foo, } #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Foo<_0> { @@ -1113,7 +1242,7 @@ mod tests { use super::root; #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Bar<_0> { - pub b: root::chameleon_core::generate_types::tests::Foo<_0, u32>, + pub b: root::subxt_codegen::types::tests::Foo<_0, u32>, } #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] @@ -1206,15 +1335,15 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] pub struct NamedFields<_0> { pub b: u32, - pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, + #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, } #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct UnnamedFields<_0, _1> ( pub (u32, u32,), - pub ::core::marker::PhantomData<(_0, _1)>, + #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)>, ); } } @@ -1271,7 +1400,7 @@ mod tests { #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Bar { - pub a: root::chameleon_core::generate_types::tests::modules::a::Foo, + pub a: root::subxt_codegen::types::tests::modules::a::Foo, } } @@ -1284,7 +1413,7 @@ mod tests { #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct Foo { - pub a: root::chameleon_core::generate_types::tests::modules::a::b::Bar, + pub a: root::subxt_codegen::types::tests::modules::a::b::Bar, } } } diff --git a/tests/integration/codegen/mod.rs b/tests/integration/codegen/mod.rs index cc3a9039a2..0d27f7d0fb 100644 --- a/tests/integration/codegen/mod.rs +++ b/tests/integration/codegen/mod.rs @@ -21,4 +21,4 @@ /// /// - run `polkadot --dev --tmp` node locally /// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs` -mod polkadot; \ No newline at end of file +mod polkadot; diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index ad4dda628e..aa8cdbb081 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -13800,7 +13800,12 @@ pub mod api { )] pub struct PriorLock<_0, _1>(pub _0, pub _1); #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct Vote(u8); #[derive( @@ -14231,9 +14236,17 @@ pub mod api { pub mod types { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] - pub struct BitFlags<_0>(pub u64, pub ::core::marker::PhantomData<_0>); + pub struct BitFlags<_0>( + pub u64, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, )] @@ -14795,6 +14808,7 @@ pub mod api { pub call: _0, pub maybe_periodic: Option<(_1, _1)>, pub origin: _2, + #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, } } @@ -15411,7 +15425,12 @@ pub mod api { pub recipient: runtime_types::polkadot_parachain::primitives::Id, } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct Id(pub u32); #[derive( @@ -15451,7 +15470,12 @@ pub mod api { pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct ValidatorIndex(pub u32); #[derive( @@ -15480,7 +15504,7 @@ pub mod api { #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, )] - pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > , } + pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > , } } #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, @@ -15559,7 +15583,12 @@ pub mod api { runtime_types::polkadot_primitives::v1::CandidateCommitments, } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct CoreIndex(pub u32); #[derive( @@ -15588,7 +15617,12 @@ pub mod api { )>, } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct GroupIndex(pub u32); #[derive( @@ -16050,7 +16084,7 @@ pub mod api { #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, )] - pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : 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 trie_index : _2 , pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > , } + pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : 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 trie_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > , } #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, )] @@ -16676,26 +16710,51 @@ pub mod api { pub mod fixed_point { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct FixedU128(pub u128); } pub mod per_things { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct PerU16(pub u16); #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct Perbill(pub u32); #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct Percent(pub u8); #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, )] pub struct Permill(pub u32); } @@ -16752,7 +16811,14 @@ pub mod api { pub first_header: _0, pub second_header: _0, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive( + Debug, + Eq, + PartialEq, + :: codec :: Encode, + :: codec :: Decode, + :: codec :: CompactAs, + )] pub struct Slot(pub u64); } pub mod sp_core { @@ -17188,6 +17254,7 @@ pub mod api { pub digest: runtime_types::sp_runtime::generic::digest::Digest< ::subxt::sp_core::H256, >, + #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, } } @@ -17198,7 +17265,7 @@ pub mod api { )] pub struct UncheckedExtrinsic<_0, _1, _2, _3>( Vec, - pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, + #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, ); } } @@ -17684,4 +17751,4 @@ pub mod api { crowdloan::calls::TransactionApi::new(self.client) } } -} \ No newline at end of file +} From 192fa39688873d9d1296ef653bc378046fd47289 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 21 Oct 2021 17:44:47 +0100 Subject: [PATCH 163/216] Fix bitvec codegen, adds as non optional dependency --- Cargo.toml | 3 ++- codegen/Cargo.toml | 2 +- codegen/src/types.rs | 12 +++--------- src/lib.rs | 1 + 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a5e7609351..e33e483177 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,10 @@ tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] [dependencies] async-trait = "0.1.49" +bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } chameleon = "0.1.0" -scale-info = "1.0.0" +scale-info = { version = "1.0.0", features = ["bit-vec"] } futures = "0.3.13" hex = "0.4.3" jsonrpsee-proc-macros = "0.3.0" diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 0e216f5eb7..4079db89a1 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -17,5 +17,5 @@ syn = "1.0.58" scale-info = "1.0.0" [dev-dependencies] -codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } +bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } pretty_assertions = "0.6.1" diff --git a/codegen/src/types.rs b/codegen/src/types.rs index e3bb416bda..4d39f5a1d7 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -644,12 +644,7 @@ impl TypePathType { let bit_order_type = &self.params[0]; let bit_store_type = &self.params[1]; - let mut type_path: syn::punctuated::Punctuated< - syn::PathSegment, - syn::Token![::], - > = syn::parse_quote! { bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; - type_path.insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); - let type_path = syn::parse_quote! { #type_path }; + let type_path = syn::parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; syn::Type::Path(type_path) } @@ -1256,7 +1251,6 @@ mod tests { ) } - #[cfg(feature = "bit-vec")] #[test] fn generate_bitvec() { use bitvec::{ @@ -1289,8 +1283,8 @@ mod tests { use super::root; #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] pub struct S { - pub lsb: root::bitvec::vec::BitVec, - pub msb: root::bitvec::vec::BitVec, + pub lsb: ::subxt::bitvec::vec::BitVec, + pub msb: ::subxt::bitvec::vec::BitVec, } } } diff --git a/src/lib.rs b/src/lib.rs index 9867292c05..15a56cab68 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -43,6 +43,7 @@ pub use frame_metadata::StorageHasher; pub use subxt_macro::subxt; +pub use bitvec; pub use sp_arithmetic; pub use sp_core; pub use sp_runtime; From adf8ebd809190c2d9ae9760dc61664d1a4c6c1b4 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 21 Oct 2021 17:46:56 +0100 Subject: [PATCH 164/216] Regenerate polkadot api with bitvec fix --- tests/integration/codegen/polkadot.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index aa8cdbb081..35c4ee01d0 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -15510,7 +15510,7 @@ pub mod api { Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, )] pub struct AvailabilityBitfield( - pub runtime_types::bitvec::vec::BitVec< + pub ::subxt::bitvec::vec::BitVec< runtime_types::bitvec::order::Lsb0, u8, >, @@ -15525,7 +15525,7 @@ pub mod api { >, pub validity_votes: Vec, - pub validator_indices: runtime_types::bitvec::vec::BitVec< + pub validator_indices: ::subxt::bitvec::vec::BitVec< runtime_types::bitvec::order::Lsb0, u8, >, @@ -16469,11 +16469,11 @@ pub mod api { pub hash: runtime_types::polkadot_core_primitives::CandidateHash, pub descriptor: runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, - pub availability_votes: runtime_types::bitvec::vec::BitVec< + pub availability_votes: ::subxt::bitvec::vec::BitVec< runtime_types::bitvec::order::Lsb0, u8, >, - pub backers: runtime_types::bitvec::vec::BitVec< + pub backers: ::subxt::bitvec::vec::BitVec< runtime_types::bitvec::order::Lsb0, u8, >, From e430d1b35b0820644d19525ea101320be2df1481 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 21 Oct 2021 17:48:46 +0100 Subject: [PATCH 165/216] Edition 2021 --- .rustfmt.toml | 2 +- Cargo.toml | 2 +- cli/Cargo.toml | 2 +- codegen/Cargo.toml | 2 +- macro/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index 60f5650170..82af150637 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -43,7 +43,7 @@ trailing_comma = "Vertical" match_block_trailing_comma = false blank_lines_upper_bound = 1 blank_lines_lower_bound = 0 -edition = "2018" # changed +edition = "2021" # changed version = "One" merge_derives = true use_try_shorthand = true # changed diff --git a/Cargo.toml b/Cargo.toml index e33e483177..d224d04199 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ members = [".", "cli", "codegen", "macro"] name = "subxt" version = "0.15.0" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" license = "GPL-3.0" readme = "README.md" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index c3699e0350..d952ff7125 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subxt-cli" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] # perform subxt codegen diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 4079db89a1..c845441bfd 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "subxt-codegen" version = "0.1.0" -edition = "2018" +edition = "2021" [dependencies] async-trait = "0.1.49" diff --git a/macro/Cargo.toml b/macro/Cargo.toml index 5e4296a175..57a18f65b6 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -2,7 +2,7 @@ name = "subxt-macro" version = "0.1.0" authors = ["Parity Technologies "] -edition = "2018" +edition = "2021" autotests = false license = "GPL-3.0" From 90312bd586a1823cbf31babc521315889ca071f6 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 11:05:12 +0100 Subject: [PATCH 166/216] Fix polkadot codegen with bitvec --- Cargo.toml | 2 +- codegen/Cargo.toml | 4 ++-- codegen/src/api/mod.rs | 8 ++++++++ tests/integration/codegen/polkadot.rs | 23 +++++++---------------- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d224d04199..26a02c73da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ tokio1 = ["jsonrpsee-http-client/tokio1", "jsonrpsee-ws-client/tokio1"] [dependencies] async-trait = "0.1.49" bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } chameleon = "0.1.0" scale-info = { version = "1.0.0", features = ["bit-vec"] } futures = "0.3.13" diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index c845441bfd..4fd6c5f084 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] async-trait = "0.1.49" -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } darling = "0.13.0" frame-metadata = "14.0" heck = "0.3.2" @@ -14,7 +14,7 @@ proc-macro-crate = "0.1.5" proc-macro-error = "1.0.4" quote = "1.0.8" syn = "1.0.58" -scale-info = "1.0.0" +scale-info = { version = "1.0.0", features = ["bit-vec"] } [dev-dependencies] bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 9e5e340c0b..3f07f01b64 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -81,6 +81,14 @@ impl RuntimeGenerator { // some hardcoded default type substitutes, can be overridden by user let mut type_substitutes = [ + ( + "bitvec::order::Lsb0", + parse_quote!(::subxt::bitvec::order::Lsb0), + ), + ( + "bitvec::order::Msb0", + parse_quote!(::subxt::bitvec::order::Msb0), + ), ( "sp_core::crypto::AccountId32", parse_quote!(::subxt::sp_core::crypto::AccountId32), diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index 35c4ee01d0..241f2a65b7 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -15510,10 +15510,7 @@ pub mod api { Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, )] pub struct AvailabilityBitfield( - pub ::subxt::bitvec::vec::BitVec< - runtime_types::bitvec::order::Lsb0, - u8, - >, + pub ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, ); #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, @@ -15525,10 +15522,8 @@ pub mod api { >, pub validity_votes: Vec, - pub validator_indices: ::subxt::bitvec::vec::BitVec< - runtime_types::bitvec::order::Lsb0, - u8, - >, + pub validator_indices: + ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, } #[derive( Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, @@ -16469,14 +16464,10 @@ pub mod api { pub hash: runtime_types::polkadot_core_primitives::CandidateHash, pub descriptor: runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, - pub availability_votes: ::subxt::bitvec::vec::BitVec< - runtime_types::bitvec::order::Lsb0, - u8, - >, - pub backers: ::subxt::bitvec::vec::BitVec< - runtime_types::bitvec::order::Lsb0, - u8, - >, + pub availability_votes: + ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, + pub backers: + ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, pub relay_parent_number: _1, pub backed_in_number: _1, pub backing_group: runtime_types::polkadot_primitives::v1::GroupIndex, From b2d04bb4061736f9294de368d1d8a99dc5d83c41 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 11:12:14 +0100 Subject: [PATCH 167/216] Polkadot balance transfer is working --- examples/polkadot_balance_transfer.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/polkadot_balance_transfer.rs b/examples/polkadot_balance_transfer.rs index c75049b3c1..ee3535173c 100644 --- a/examples/polkadot_balance_transfer.rs +++ b/examples/polkadot_balance_transfer.rs @@ -14,6 +14,14 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +//! To run this example, a local polkadot node should be running. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.11/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, @@ -36,7 +44,8 @@ async fn main() -> Result<(), Box> { .to_runtime_api::>(); let hash = api .tx() - .transfer(&dest, 10_000) + .balances() + .transfer(dest, 10_000) .sign_and_submit(&signer) .await?; From d1566e869be6c5baaf22c5c8fec15af9912578f5 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 11:28:44 +0100 Subject: [PATCH 168/216] Fix fetch remote --- examples/fetch_remote.rs | 48 +++++++--------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) diff --git a/examples/fetch_remote.rs b/examples/fetch_remote.rs index ac655a5605..63b12210e9 100644 --- a/examples/fetch_remote.rs +++ b/examples/fetch_remote.rs @@ -14,56 +14,24 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use sp_runtime::traits::BlakeTwo256; -use subxt::{ - ClientBuilder, - Config, -}; +use subxt::ClientBuilder; -#[subxt::subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] -pub mod node_runtime { - #[subxt(substitute_type = "sp_core::crypto::AccountId32")] - use sp_core::crypto::AccountId32; - #[subxt(substitute_type = "primitive_types::H256")] - use sp_core::H256; - #[subxt(substitute_type = "sp_runtime::multiaddress::MultiAddress")] - use sp_runtime::MultiAddress; - - #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] - use sp_arithmetic::per_things::Perbill; - #[subxt(substitute_type = "sp_arithmetic::per_things::Perquintill")] - use sp_arithmetic::per_things::Perquintill; -} - -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct KusamaRuntime; - -impl Config for KusamaRuntime { - type Index = u32; - type BlockNumber = u32; - type Hash = sp_core::H256; - type Hashing = BlakeTwo256; - type AccountId = sp_runtime::AccountId32; - type Address = sp_runtime::MultiAddress; - type Header = sp_runtime::generic::Header; - type Extra = subxt::extrinsic::DefaultExtra; - type Signature = sp_runtime::MultiSignature; - type Extrinsic = sp_runtime::OpaqueExtrinsic; - type AccountData = node_runtime::system::storage::Account; -} +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} #[async_std::main] async fn main() -> Result<(), Box> { env_logger::init(); - let client = ClientBuilder::::new() - .set_url("wss://kusama-rpc.polkadot.io") + let api = ClientBuilder::new() + .set_url("wss://rpc.polkadot.io") .build() - .await?; + .await? + .to_runtime_api::>(); let block_number = 1; - let block_hash = client.block_hash(Some(block_number.into())).await?; + let block_hash = api.client.rpc().block_hash(Some(block_number.into())).await?; if let Some(hash) = block_hash { println!("Block hash for block number {}: {}", block_number, hash); From 927aa006caba5d17725a2fce9e8669f71d39b416 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 11:43:34 +0100 Subject: [PATCH 169/216] Fix transfer_subscribe example --- examples/transfer_subscribe.rs | 44 +++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/examples/transfer_subscribe.rs b/examples/transfer_subscribe.rs index b0ddc599a0..087455f5b5 100644 --- a/examples/transfer_subscribe.rs +++ b/examples/transfer_subscribe.rs @@ -14,19 +14,24 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +//! To run this example, a local polkadot node should be running. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.11/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + use sp_keyring::AccountKeyring; use subxt::{ - balances::{ - TransferCallExt, - TransferEvent, - }, - sp_core::Decode, ClientBuilder, - DefaultNodeRuntime, EventSubscription, PairSigner, }; +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} + #[async_std::main] async fn main() -> Result<(), Box> { env_logger::init(); @@ -34,16 +39,27 @@ async fn main() -> Result<(), Box> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let client = ClientBuilder::::new().build().await?; - let sub = client.subscribe_events().await?; - let decoder = client.events_decoder(); - let mut sub = EventSubscription::::new(sub, decoder); - sub.filter_event::>(); - client.transfer(&signer, &dest, 10_000).await?; + let api = ClientBuilder::new() + .build() + .await? + .to_runtime_api::>(); + + let sub = api.client.rpc().subscribe_events().await?; + let decoder = api.client.events_decoder(); + let mut sub = EventSubscription::::new(sub, decoder); + sub.filter_event::(); + + api + .tx() + .balances() + .transfer(dest, 10_000) + .sign_and_submit(&signer) + .await?; + let raw = sub.next().await.unwrap().unwrap(); - let event = TransferEvent::::decode(&mut &raw.data[..]); + let event = ::decode(&mut &raw.data[..]); if let Ok(e) = event { - println!("Balance transfer success: value: {:?}", e.amount); + println!("Balance transfer success: value: {:?}", e.1); } else { println!("Failed to subscribe to Balances::Transfer Event"); } From b26cd2f33dc3112354dd413daf1adb0a1b88ace8 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 12:49:05 +0100 Subject: [PATCH 170/216] Fix submit_and_watch example --- examples/submit_and_watch.rs | 32 +++++++++++++++++++++++--------- examples/transfer_subscribe.rs | 2 +- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/examples/submit_and_watch.rs b/examples/submit_and_watch.rs index e84e6149df..8bc1d8d83a 100644 --- a/examples/submit_and_watch.rs +++ b/examples/submit_and_watch.rs @@ -14,17 +14,23 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +//! To run this example, a local polkadot node should be running. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.11/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + use sp_keyring::AccountKeyring; use subxt::{ - balances::{ - TransferCallExt, - TransferEventExt, - }, ClientBuilder, - DefaultNodeRuntime, PairSigner, }; +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} + #[async_std::main] async fn main() -> Result<(), Box> { env_logger::init(); @@ -32,11 +38,19 @@ async fn main() -> Result<(), Box> { let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); - let client = ClientBuilder::::new().build().await?; - let result = client.transfer_and_watch(&signer, &dest, 10_000).await?; + let api = ClientBuilder::new() + .build() + .await? + .to_runtime_api::>(); + let result = api + .tx() + .balances() + .transfer(dest, 10_000) + .sign_and_submit_then_watch(&signer) + .await?; - if let Some(event) = result.transfer()? { - println!("Balance transfer success: value: {:?}", event.amount); + if let Some(event) = result.find_event::()? { + println!("Balance transfer success: value: {:?}", event.2); } else { println!("Failed to find Balances::Transfer Event"); } diff --git a/examples/transfer_subscribe.rs b/examples/transfer_subscribe.rs index 087455f5b5..ac7b8581df 100644 --- a/examples/transfer_subscribe.rs +++ b/examples/transfer_subscribe.rs @@ -59,7 +59,7 @@ async fn main() -> Result<(), Box> { let raw = sub.next().await.unwrap().unwrap(); let event = ::decode(&mut &raw.data[..]); if let Ok(e) = event { - println!("Balance transfer success: value: {:?}", e.1); + println!("Balance transfer success: value: {:?}", e.2); } else { println!("Failed to subscribe to Balances::Transfer Event"); } From 091b255273af64c996860946155fccd5d52b46b5 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 12:52:27 +0100 Subject: [PATCH 171/216] Fmt --- codegen/src/types.rs | 4 +++- examples/fetch_remote.rs | 6 +++++- examples/transfer_subscribe.rs | 7 ++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 4d39f5a1d7..3c4e1fe506 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -276,7 +276,9 @@ impl<'a> quote::ToTokens for ModuleType<'a> { // any single field wrapper struct with a concrete unsigned int type can derive // CompactAs. let field = &composite.fields()[0]; - if !self.ty.type_params() + if !self + .ty + .type_params() .iter() .any(|tp| Some(tp.name()) == field.type_name()) { diff --git a/examples/fetch_remote.rs b/examples/fetch_remote.rs index 63b12210e9..a54004551d 100644 --- a/examples/fetch_remote.rs +++ b/examples/fetch_remote.rs @@ -31,7 +31,11 @@ async fn main() -> Result<(), Box> { let block_number = 1; - let block_hash = api.client.rpc().block_hash(Some(block_number.into())).await?; + let block_hash = api + .client + .rpc() + .block_hash(Some(block_number.into())) + .await?; if let Some(hash) = block_hash { println!("Block hash for block number {}: {}", block_number, hash); diff --git a/examples/transfer_subscribe.rs b/examples/transfer_subscribe.rs index ac7b8581df..9b14fbcb1d 100644 --- a/examples/transfer_subscribe.rs +++ b/examples/transfer_subscribe.rs @@ -49,15 +49,16 @@ async fn main() -> Result<(), Box> { let mut sub = EventSubscription::::new(sub, decoder); sub.filter_event::(); - api - .tx() + api.tx() .balances() .transfer(dest, 10_000) .sign_and_submit(&signer) .await?; let raw = sub.next().await.unwrap().unwrap(); - let event = ::decode(&mut &raw.data[..]); + let event = ::decode( + &mut &raw.data[..], + ); if let Ok(e) = event { println!("Balance transfer success: value: {:?}", e.2); } else { From cdb881e65fe3578700d5a7a35f4b59a6ead39cde Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 17:29:28 +0100 Subject: [PATCH 172/216] Generate storage iter method for iterating over keys --- codegen/src/api/storage.rs | 20 ++++++++++++++++++-- examples/fetch_all_accounts.rs | 31 +++++++++++++++++++++++-------- src/lib.rs | 1 + 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index a49b372d6f..87ab427c0f 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -159,6 +159,7 @@ fn generate_storage_entry_fns( let pallet_name = &pallet.name; let storage_name = &storage_entry.name; let fn_name = format_ident!("{}", storage_entry.name.to_snake_case()); + let fn_name_iter = format_ident!("{}_iter", fn_name); let storage_entry_ty = match storage_entry.ty { StorageEntryType::Plain(ref ty) => ty, StorageEntryType::Map { ref value, .. } => value, @@ -189,10 +190,23 @@ fn generate_storage_entry_fns( } }; + let client_iter_fn = if matches!(storage_entry.ty, StorageEntryType::Map { .. }) { + quote! ( + pub async fn #fn_name_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, #entry_struct_ident>, ::subxt::Error> { + self.client.storage().iter(hash).await + } + ) + } else { + quote! () + }; + let key_args = fields .iter() .map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? - let client_fn = quote! { + let client_fns = quote! { pub async fn #fn_name( &self, #( #key_args, )* @@ -201,7 +215,9 @@ fn generate_storage_entry_fns( let entry = #constructor; self.client.storage().#fetch(&entry, hash).await } + + #client_iter_fn }; - (storage_entry_type, client_fn) + (storage_entry_type, client_fns) } diff --git a/examples/fetch_all_accounts.rs b/examples/fetch_all_accounts.rs index 3f96eca9e5..5a35f801f2 100644 --- a/examples/fetch_all_accounts.rs +++ b/examples/fetch_all_accounts.rs @@ -14,20 +14,35 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use subxt::{ - system::AccountStoreExt, - ClientBuilder, - DefaultNodeRuntime, -}; +//! To run this example, a local polkadot node should be running. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.11/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +use subxt::ClientBuilder; + +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} #[async_std::main] async fn main() -> Result<(), Box> { env_logger::init(); - let client = ClientBuilder::::new().build().await?; - let mut iter = client.account_iter(None).await?; + let api = ClientBuilder::new() + .build() + .await? + .to_runtime_api::>(); + + let mut iter = api + .storage() + .system() + .account_iter(None).await?; + while let Some((key, account)) = iter.next().await? { - println!("{:?}: {}", key, account.data.free); + println!("{}: {}", hex::encode(key), account.data.free); } Ok(()) } diff --git a/src/lib.rs b/src/lib.rs index 15a56cab68..925e8917fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,6 +100,7 @@ pub use crate::{ SystemProperties, }, storage::{ + KeyIter, StorageEntry, StorageEntryKey, StorageMapKey, From da71f69c31c969632755680a3ab5cfc101808de2 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 17:29:49 +0100 Subject: [PATCH 173/216] Fmt --- codegen/src/api/storage.rs | 2 +- examples/fetch_all_accounts.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index 87ab427c0f..e4dab4dd5b 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -200,7 +200,7 @@ fn generate_storage_entry_fns( } ) } else { - quote! () + quote!() }; let key_args = fields diff --git a/examples/fetch_all_accounts.rs b/examples/fetch_all_accounts.rs index 5a35f801f2..d01cfb483c 100644 --- a/examples/fetch_all_accounts.rs +++ b/examples/fetch_all_accounts.rs @@ -36,10 +36,7 @@ async fn main() -> Result<(), Box> { .await? .to_runtime_api::>(); - let mut iter = api - .storage() - .system() - .account_iter(None).await?; + let mut iter = api.storage().system().account_iter(None).await?; while let Some((key, account)) = iter.next().await? { println!("{}: {}", hex::encode(key), account.data.free); From 23be116904ab2184074c2419b37891184e94e7ff Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Fri, 22 Oct 2021 17:48:15 +0100 Subject: [PATCH 174/216] Fix existential deposit test --- tests/integration/frame/balances.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/frame/balances.rs b/tests/integration/frame/balances.rs index d1622b288d..e130a4bece 100644 --- a/tests/integration/frame/balances.rs +++ b/tests/integration/frame/balances.rs @@ -225,5 +225,5 @@ async fn constant_existential_deposit() { 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, 10_000_000_000); + assert_eq!(existential_deposit, 100_000_000_000_000); } From 9d8c9a1939ed132c9fd696814e295bd9d0a6bf14 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Mon, 25 Oct 2021 16:18:37 +0100 Subject: [PATCH 175/216] Fix staking tests --- tests/integration/frame/staking.rs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/tests/integration/frame/staking.rs b/tests/integration/frame/staking.rs index 25ea69359e..24071a0043 100644 --- a/tests/integration/frame/staking.rs +++ b/tests/integration/frame/staking.rs @@ -21,6 +21,7 @@ use crate::{ ValidatorPrefs, }, staking, + system, DefaultConfig, }, test_context, @@ -37,7 +38,6 @@ use subxt::{ Signer, }, Error, - ExtrinsicSuccess, RuntimeError, }; @@ -58,17 +58,16 @@ fn default_validator_prefs() -> ValidatorPrefs { async fn validate_with_controller_account() -> Result<(), Error> { let alice = PairSigner::::new(AccountKeyring::Alice.pair()); let cxt = test_context().await; - let announce_validator = cxt + let result = cxt .api .tx() .staking() .validate(default_validator_prefs()) .sign_and_submit_then_watch(&alice) - .await; - assert_matches!(announce_validator, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { - // TOOD: this is unsatisfying – can we do better? - assert_eq!(events.len(), 2); - }); + .await?; + + let success = result.find_event::()?; + assert!(success.is_some()); Ok(()) } @@ -97,17 +96,17 @@ async fn nominate_with_controller_account() -> Result<(), Error> { let bob = PairSigner::::new(AccountKeyring::Bob.pair()); let cxt = test_context().await; - let nomination = cxt + let result = cxt .api .tx() .staking() .nominate(vec![bob.account_id().clone().into()]) .sign_and_submit_then_watch(&alice) - .await; - assert_matches!(nomination, Ok(ExtrinsicSuccess {block: _, extrinsic: _, events}) => { - // TOOD: this is unsatisfying – can we do better? - assert_eq!(events.len(), 2); - }); + .await?; + + let success = result.find_event::()?; + assert!(success.is_some()); + Ok(()) } From b500ac42b7f2a5601ac74d725bc978f743bb0355 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 28 Oct 2021 11:09:57 +0200 Subject: [PATCH 176/216] Add option for custom generated type derives --- cli/src/main.rs | 2 +- codegen/src/api/mod.rs | 21 +- codegen/src/derives.rs | 52 + codegen/src/lib.rs | 10 +- codegen/src/struct_def.rs | 10 +- codegen/src/types.rs | 89 +- examples/custom_type_derives.rs | 30 + macro/src/lib.rs | 16 +- src/lib.rs | 1 + tests/integration/codegen/polkadot.rs | 20729 +++++++++++++----------- 10 files changed, 11108 insertions(+), 9852 deletions(-) create mode 100644 codegen/src/derives.rs create mode 100644 examples/custom_type_derives.rs diff --git a/cli/src/main.rs b/cli/src/main.rs index 9c91434a63..35f21aa533 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -151,7 +151,7 @@ fn codegen(encoded: &mut I) -> color_eyre::Result<()> { let item_mod = syn::parse_quote!( pub mod api {} ); - let runtime_api = generator.generate_runtime(item_mod); + let runtime_api = generator.generate_runtime(item_mod, Default::default()); println!("{}", runtime_api); Ok(()) } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 3f07f01b64..001282ab22 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -43,9 +43,13 @@ use std::{ path, string::ToString, }; -use syn::parse_quote; +use syn::{ + parse_quote, + punctuated::Punctuated, +}; +use super::GeneratedTypeDerives; -pub fn generate_runtime_api

(item_mod: syn::ItemMod, path: P) -> TokenStream2 +pub fn generate_runtime_api

(item_mod: syn::ItemMod, path: P, generated_type_derives: Option>) -> TokenStream2 where P: AsRef, { @@ -60,8 +64,13 @@ where let metadata = frame_metadata::RuntimeMetadataPrefixed::decode(&mut &bytes[..]) .unwrap_or_else(|e| abort_call_site!("Failed to decode metadata: {}", e)); + let mut derives = GeneratedTypeDerives::default(); + if let Some(user_derives) = generated_type_derives { + derives.append(user_derives.iter().cloned()) + } + let generator = RuntimeGenerator::new(metadata); - generator.generate_runtime(item_mod) + generator.generate_runtime(item_mod, derives) } pub struct RuntimeGenerator { @@ -76,7 +85,7 @@ impl RuntimeGenerator { } } - pub fn generate_runtime(&self, item_mod: syn::ItemMod) -> TokenStream2 { + pub fn generate_runtime(&self, item_mod: syn::ItemMod, derives: GeneratedTypeDerives) -> TokenStream2 { let item_mod_ir = ir::ItemMod::from(item_mod); // some hardcoded default type substitutes, can be overridden by user @@ -122,7 +131,7 @@ impl RuntimeGenerator { } let type_gen = - TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes); + TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes, derives.clone()); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); let pallets_with_mod_names = self @@ -179,7 +188,7 @@ impl RuntimeGenerator { }); let outer_event = quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #derives pub enum Event { #( #outer_event_variants )* } diff --git a/codegen/src/derives.rs b/codegen/src/derives.rs new file mode 100644 index 0000000000..5468315f55 --- /dev/null +++ b/codegen/src/derives.rs @@ -0,0 +1,52 @@ +// Copyright 2019-2021 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 syn::punctuated::Punctuated; + +#[derive(Debug, Clone)] +pub struct GeneratedTypeDerives { + derives: Punctuated +} + +impl GeneratedTypeDerives { + pub fn new(derives: Punctuated) -> Self { + Self { derives } + } + + pub fn append(&mut self, derives: impl Iterator) { + for derive in derives { + self.derives.push(derive) + } + } +} + +impl Default for GeneratedTypeDerives { + fn default() -> Self { + let mut derives = Punctuated::new(); + derives.push(syn::parse_quote!( ::subxt::codec::Encode )); + derives.push(syn::parse_quote!( ::subxt::codec::Decode )); + Self::new(derives) + } +} + +impl quote::ToTokens for GeneratedTypeDerives { + fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { + let derives = &self.derives; + tokens.extend(quote::quote! { + #[derive(#derives)] + }) + } +} \ No newline at end of file diff --git a/codegen/src/lib.rs b/codegen/src/lib.rs index 88cb18c787..7c65ecdf5a 100644 --- a/codegen/src/lib.rs +++ b/codegen/src/lib.rs @@ -17,11 +17,15 @@ //! Library to generate an API for a Substrate runtime from its metadata. mod api; +mod derives; mod ir; mod struct_def; mod types; -pub use self::api::{ - generate_runtime_api, - RuntimeGenerator, +pub use self::{ + api::{ + generate_runtime_api, + RuntimeGenerator, + }, + derives::GeneratedTypeDerives, }; diff --git a/codegen/src/struct_def.rs b/codegen/src/struct_def.rs index b48927dcd9..146badcef8 100644 --- a/codegen/src/struct_def.rs +++ b/codegen/src/struct_def.rs @@ -26,12 +26,14 @@ use quote::{ quote, }; use scale_info::form::PortableForm; +use super::GeneratedTypeDerives; #[derive(Debug)] pub struct StructDef { pub name: syn::Ident, pub fields: StructDefFields, pub field_visibility: Option, + pub derives: GeneratedTypeDerives, } #[derive(Debug)] @@ -83,10 +85,13 @@ impl StructDef { ) }; + let derives = type_gen.derives().clone(); + Self { name, fields, field_visibility, + derives, } } @@ -102,6 +107,7 @@ impl StructDef { impl quote::ToTokens for StructDef { fn to_tokens(&self, tokens: &mut TokenStream2) { let visibility = &self.field_visibility; + let derives = &self.derives; tokens.extend(match self.fields { StructDefFields::Named(ref named_fields) => { let fields = named_fields.iter().map(|(name, ty)| { @@ -111,7 +117,7 @@ impl quote::ToTokens for StructDef { }); let name = &self.name; quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #derives pub struct #name { #( #fields ),* } @@ -125,7 +131,7 @@ impl quote::ToTokens for StructDef { }); let name = &self.name; quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #derives pub struct #name ( #( #fields ),* ); diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 3c4e1fe506..0a8b622e0e 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -38,12 +38,14 @@ use std::collections::{ HashMap, HashSet, }; +use super::GeneratedTypeDerives; #[derive(Debug)] pub struct TypeGenerator<'a> { root_mod_ident: Ident, type_registry: &'a PortableRegistry, type_substitutes: HashMap, + derives: GeneratedTypeDerives, } impl<'a> TypeGenerator<'a> { @@ -52,12 +54,14 @@ impl<'a> TypeGenerator<'a> { type_registry: &'a PortableRegistry, root_mod: &'static str, type_substitutes: HashMap, + derives: GeneratedTypeDerives, ) -> Self { let root_mod_ident = Ident::new(root_mod, Span::call_site()); Self { root_mod_ident, type_registry, type_substitutes, + derives, } } @@ -185,6 +189,11 @@ impl<'a> TypeGenerator<'a> { }) } } + + /// Returns the derives with which all generated type will be decorated. + pub fn derives(&self) -> &GeneratedTypeDerives { + &self.derives + } } #[derive(Debug)] @@ -267,6 +276,8 @@ impl<'a> quote::ToTokens for ModuleType<'a> { syn::Type::Path(path) }); + let derives = self.type_gen.derives(); + match self.ty.type_def() { TypeDef::Composite(composite) => { let type_name = type_name.expect("structs should have a name"); @@ -293,7 +304,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { | TypeDefPrimitive::U128 ) ) { - Some(quote!( , ::codec::CompactAs )) + Some(quote!( #[derive(::codec::CompactAs)] )) } else { None } @@ -303,8 +314,10 @@ impl<'a> quote::ToTokens for ModuleType<'a> { } else { None }; + let ty_toks = quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode #derive_as_compact)] + #derive_as_compact + #derives pub struct #type_name #fields }; tokens.extend(ty_toks); @@ -344,7 +357,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { } let ty_toks = quote! { - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #derives pub enum #type_name { #( #variants, )* } @@ -759,7 +772,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -769,7 +782,7 @@ mod tests { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct S { pub a: bool, pub b: u32, @@ -800,7 +813,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -810,12 +823,12 @@ mod tests { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Child { pub a: i32, } - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Parent { pub a: bool, pub b: root::subxt_codegen::types::tests::Child, @@ -840,7 +853,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -850,10 +863,10 @@ mod tests { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Child(pub i32,); - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Parent(pub bool, pub root::subxt_codegen::types::tests::Child,); } } @@ -917,7 +930,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -976,7 +989,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -985,7 +998,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub enum E { A, B (bool,), @@ -1009,7 +1022,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1018,7 +1031,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct S { pub a: [u8; 32usize], } @@ -1041,7 +1054,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1050,7 +1063,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct S { pub a: Option, pub b: Option, @@ -1078,7 +1091,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1087,7 +1100,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct S { pub a: std::boxed::Box, pub b: std::boxed::Box, @@ -1113,7 +1126,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1122,7 +1135,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub enum E { A(std::boxed::Box,), B { a: std::boxed::Box, }, @@ -1146,7 +1159,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1155,7 +1168,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct S { pub a: ::core::ops::Range, pub b: ::core::ops::RangeInclusive, @@ -1185,7 +1198,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1194,12 +1207,12 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Bar { pub b: root::subxt_codegen::types::tests::Foo, pub c: root::subxt_codegen::types::tests::Foo, } - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Foo<_0> { pub a: _0, } @@ -1228,7 +1241,7 @@ mod tests { registry.register_type(&meta_type::>()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1237,12 +1250,12 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Bar<_0> { pub b: root::subxt_codegen::types::tests::Foo<_0, u32>, } - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Foo<_0, _1> { pub a: _0, pub b: Option<(_0, _1,)>, @@ -1274,7 +1287,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1283,7 +1296,7 @@ mod tests { quote! { pub mod tests { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct S { pub lsb: ::subxt::bitvec::vec::BitVec, pub msb: ::subxt::bitvec::vec::BitVec, @@ -1322,7 +1335,7 @@ mod tests { registry.register_type(&meta_type::>()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1336,7 +1349,7 @@ mod tests { pub b: u32, #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, } - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct UnnamedFields<_0, _1> ( pub (u32, u32,), #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)>, @@ -1377,7 +1390,7 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default()); + let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1394,20 +1407,20 @@ mod tests { pub mod b { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Bar { pub a: root::subxt_codegen::types::tests::modules::a::Foo, } } - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Foo {} } pub mod c { use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode)] + #[derive(::codec::Encode, ::codec::Decode)] pub struct Foo { pub a: root::subxt_codegen::types::tests::modules::a::b::Bar, } diff --git a/examples/custom_type_derives.rs b/examples/custom_type_derives.rs new file mode 100644 index 0000000000..8555703165 --- /dev/null +++ b/examples/custom_type_derives.rs @@ -0,0 +1,30 @@ +// Copyright 2019-2021 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 . + +#[subxt::subxt( + runtime_metadata_path = "examples/polkadot_metadata.scale", + generated_type_derives = "Clone, Debug", +)] +pub mod polkadot {} + +use polkadot::runtime_types::frame_support::PalletId; + +#[async_std::main] +async fn main() -> Result<(), Box> { + let pallet_id = PalletId([1u8; 8]); + let _ = ::clone(&pallet_id); + Ok(()) +} diff --git a/macro/src/lib.rs b/macro/src/lib.rs index bff0b7ba3d..36c723e684 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -19,13 +19,23 @@ extern crate proc_macro; use darling::FromMeta; use proc_macro::TokenStream; use proc_macro_error::proc_macro_error; -use syn::parse_macro_input; +use syn::{ + parse_macro_input, + punctuated::Punctuated +}; #[derive(Debug, FromMeta)] struct RuntimeMetadataArgs { runtime_metadata_path: String, + #[darling(default)] + generated_type_derives: Option, } +#[derive(Debug, FromMeta)] +struct GeneratedTypeDerives ( + Punctuated, +); + #[proc_macro_attribute] #[proc_macro_error] pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { @@ -41,5 +51,7 @@ pub fn subxt(args: TokenStream, input: TokenStream) -> TokenStream { let root_path = std::path::Path::new(&root); let path = root_path.join(args.runtime_metadata_path); - subxt_codegen::generate_runtime_api(item_mod, &path).into() + let generated_type_derives = args.generated_type_derives.map(|derives| derives.0); + + subxt_codegen::generate_runtime_api(item_mod, &path, generated_type_derives).into() } diff --git a/src/lib.rs b/src/lib.rs index 925e8917fe..e55c0bcbb0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -44,6 +44,7 @@ pub use frame_metadata::StorageHasher; pub use subxt_macro::subxt; pub use bitvec; +pub use codec; pub use sp_arithmetic; pub use sp_core; pub use sp_runtime; diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index 241f2a65b7..1bcd054774 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -1,77 +1,79 @@ #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod api { - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { #[codec(index = 0)] System(system::Event), #[codec(index = 1)] - Scheduler(scheduler::Event), - #[codec(index = 4)] - Indices(indices::Event), + Utility(utility::Event), #[codec(index = 5)] + Indices(indices::Event), + #[codec(index = 6)] Balances(balances::Event), - #[codec(index = 7)] - Staking(staking::Event), #[codec(index = 8)] - Offences(offences::Event), + ElectionProviderMultiPhase(election_provider_multi_phase::Event), #[codec(index = 9)] + Staking(staking::Event), + #[codec(index = 10)] Session(session::Event), #[codec(index = 11)] - Grandpa(grandpa::Event), + Democracy(democracy::Event), #[codec(index = 12)] - ImOnline(im_online::Event), + Council(council::Event), + #[codec(index = 13)] + TechnicalCommittee(technical_committee::Event), #[codec(index = 14)] - Democracy(democracy::Event), + Elections(elections::Event), #[codec(index = 15)] - Council(council::Event), + TechnicalMembership(technical_membership::Event), #[codec(index = 16)] - TechnicalCommittee(technical_committee::Event), + Grandpa(grandpa::Event), #[codec(index = 17)] - PhragmenElection(phragmen_election::Event), + Treasury(treasury::Event), #[codec(index = 18)] - TechnicalMembership(technical_membership::Event), + Contracts(contracts::Event), #[codec(index = 19)] - Treasury(treasury::Event), - #[codec(index = 24)] - Claims(claims::Event), + Sudo(sudo::Event), + #[codec(index = 20)] + ImOnline(im_online::Event), + #[codec(index = 22)] + Offences(offences::Event), #[codec(index = 25)] - Vesting(vesting::Event), + Identity(identity::Event), #[codec(index = 26)] - Utility(utility::Event), + Society(society::Event), + #[codec(index = 27)] + Recovery(recovery::Event), #[codec(index = 28)] - Identity(identity::Event), + Vesting(vesting::Event), #[codec(index = 29)] - Proxy(proxy::Event), + Scheduler(scheduler::Event), #[codec(index = 30)] + Proxy(proxy::Event), + #[codec(index = 31)] Multisig(multisig::Event), - #[codec(index = 34)] + #[codec(index = 32)] Bounties(bounties::Event), - #[codec(index = 35)] + #[codec(index = 33)] Tips(tips::Event), + #[codec(index = 34)] + Assets(assets::Event), #[codec(index = 36)] - ElectionProviderMultiPhase(election_provider_multi_phase::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 = 70)] - Registrar(registrar::Event), - #[codec(index = 71)] - Slots(slots::Event), - #[codec(index = 72)] - Auctions(auctions::Event), - #[codec(index = 73)] - Crowdloan(crowdloan::Event), + Lottery(lottery::Event), + #[codec(index = 37)] + Gilt(gilt::Event), + #[codec(index = 38)] + Uniques(uniques::Event), + #[codec(index = 39)] + TransactionStorage(transaction_storage::Event), + #[codec(index = 40)] + BagsList(bags_list::Event), } pub mod system { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct FillBlock { pub ratio: ::subxt::sp_arithmetic::per_things::Perbill, } @@ -79,7 +81,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "fill_block"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Remark { pub remark: Vec, } @@ -87,7 +89,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "remark"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetHeapPages { pub pages: u64, } @@ -95,7 +97,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_heap_pages"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetCode { pub code: Vec, } @@ -103,7 +105,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_code"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetCodeWithoutChecks { pub code: Vec, } @@ -111,7 +113,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_code_without_checks"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetChangesTrieConfig { pub changes_trie_config: Option< runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, @@ -121,7 +123,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_changes_trie_config"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetStorage { pub items: Vec<(Vec, Vec)>, } @@ -129,7 +131,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "set_storage"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KillStorage { pub keys: Vec>, } @@ -137,7 +139,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "kill_storage"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KillPrefix { pub prefix: Vec, pub subkeys: u32, @@ -146,7 +148,7 @@ pub mod api { const PALLET: &'static str = "System"; const FUNCTION: &'static str = "kill_prefix"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RemarkWithEvent { pub remark: Vec, } @@ -249,7 +251,7 @@ pub mod api { pub type Event = runtime_types::frame_system::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ExtrinsicSuccess( pub runtime_types::frame_support::weights::DispatchInfo, ); @@ -257,7 +259,7 @@ pub mod api { const PALLET: &'static str = "System"; const EVENT: &'static str = "ExtrinsicSuccess"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ExtrinsicFailed( pub runtime_types::sp_runtime::DispatchError, pub runtime_types::frame_support::weights::DispatchInfo, @@ -266,25 +268,25 @@ pub mod api { const PALLET: &'static str = "System"; const EVENT: &'static str = "ExtrinsicFailed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CodeUpdated {} impl ::subxt::Event for CodeUpdated { const PALLET: &'static str = "System"; const EVENT: &'static str = "CodeUpdated"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NewAccount(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for NewAccount { const PALLET: &'static str = "System"; const EVENT: &'static str = "NewAccount"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KilledAccount(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for KilledAccount { const PALLET: &'static str = "System"; const EVENT: &'static str = "KilledAccount"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Remarked( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::H256, @@ -397,7 +399,7 @@ pub mod api { const STORAGE: &'static str = "Events"; type Value = Vec< runtime_types::frame_system::EventRecord< - runtime_types::polkadot_runtime::Event, + runtime_types::node_runtime::Event, ::subxt::sp_core::H256, >, >; @@ -483,6 +485,15 @@ pub mod api { let entry = Account(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn account_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn extrinsic_count( &self, hash: ::core::option::Option, @@ -518,6 +529,15 @@ pub mod api { let entry = BlockHash(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn block_hash_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, BlockHash>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn extrinsic_data( &self, _0: u32, @@ -526,6 +546,15 @@ pub mod api { let entry = ExtrinsicData(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn extrinsic_data_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ExtrinsicData>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn number( &self, hash: ::core::option::Option, @@ -559,7 +588,7 @@ pub mod api { ) -> ::core::result::Result< Vec< runtime_types::frame_system::EventRecord< - runtime_types::polkadot_runtime::Event, + runtime_types::node_runtime::Event, ::subxt::sp_core::H256, >, >, @@ -584,6 +613,15 @@ pub mod api { let entry = EventTopics(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn event_topics_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, EventTopics>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn last_runtime_upgrade( &self, hash: ::core::option::Option, @@ -623,72 +661,34 @@ pub mod api { } } } - pub mod scheduler { + pub mod utility { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Schedule { - pub when: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::polkadot_runtime::Call, - } - impl ::subxt::Call for Schedule { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Cancel { - pub when: u32, - pub index: u32, - } - impl ::subxt::Call for Cancel { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ScheduleNamed { - pub id: Vec, - pub when: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::polkadot_runtime::Call, - } - impl ::subxt::Call for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelNamed { - pub id: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Batch { + pub calls: Vec, } - impl ::subxt::Call for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel_named"; + impl ::subxt::Call for Batch { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ScheduleAfter { - pub after: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsDerivative { + pub index: u16, + pub call: runtime_types::node_runtime::Call, } - impl ::subxt::Call for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_after"; + impl ::subxt::Call for AsDerivative { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "as_derivative"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ScheduleNamedAfter { - pub id: Vec, - pub after: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BatchAll { + pub calls: Vec, } - impl ::subxt::Call for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named_after"; + impl ::subxt::Call for BatchAll { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch_all"; } pub struct TransactionApi< 'a, @@ -703,222 +703,69 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn schedule( - &self, - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Schedule { - when, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel( - &self, - when: u32, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Cancel { when, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn schedule_named( - &self, - id: Vec, - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_named( + pub fn batch( &self, - id: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelNamed { id }; + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Batch { calls }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn schedule_after( + pub fn as_derivative( &self, - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ScheduleAfter { - after, - maybe_periodic, - priority, - call, - }; + index: u16, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsDerivative { index, call }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn schedule_named_after( + pub fn batch_all( &self, - id: Vec, - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call, - }; + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = BatchAll { calls }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub type Event = runtime_types::pallet_utility::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Scheduled(pub u32, pub u32); - impl ::subxt::Event for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BatchInterrupted( + pub u32, + pub runtime_types::sp_runtime::DispatchError, + ); + impl ::subxt::Event for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Canceled(pub u32, pub u32); - impl ::subxt::Event for Canceled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BatchCompleted {} + impl ::subxt::Event for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Dispatched( - pub (u32, u32), - pub Option>, - pub 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)] + pub struct ItemCompleted {} + impl ::subxt::Event for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; } } - pub mod storage { + } + pub mod babe { + use super::runtime_types; + pub mod calls { use super::runtime_types; - pub struct Agenda(pub u32); - impl ::subxt::StorageEntry for Agenda { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Agenda"; - type Value = Vec< - Option< - runtime_types::pallet_scheduler::ScheduledV2< - runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportEquivocation { + pub equivocation_proof: + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::sp_runtime::generic::header::Header< u32, - runtime_types::polkadot_runtime::OriginCaller, - ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_runtime::traits::BlakeTwo256, >, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Lookup(pub Vec); - impl ::subxt::StorageEntry for Lookup { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Lookup"; - type Value = (u32, u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_scheduler::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 agenda( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - Option< - runtime_types::pallet_scheduler::ScheduledV2< - runtime_types::polkadot_runtime::Call, - u32, - runtime_types::polkadot_runtime::OriginCaller, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >, - ::subxt::Error, - > { - let entry = Agenda(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lookup( - &self, - _0: Vec, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(u32, u32)>, - ::subxt::Error, - > { - let entry = Lookup(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_scheduler::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod babe { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReportEquivocation { - pub equivocation_proof: - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - runtime_types::sp_consensus_babe::app::Public, + runtime_types::sp_consensus_babe::app::Public, >, pub key_owner_proof: runtime_types::sp_session::MembershipProof, } @@ -926,7 +773,7 @@ pub mod api { const PALLET: &'static str = "Babe"; const FUNCTION: &'static str = "report_equivocation"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ReportEquivocationUnsigned { pub equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< @@ -942,7 +789,7 @@ pub mod api { const PALLET: &'static str = "Babe"; const FUNCTION: &'static str = "report_equivocation_unsigned"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PlanConfigChange { pub config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, @@ -1238,6 +1085,15 @@ pub mod api { let entry = UnderConstruction(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn under_construction_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, UnderConstruction>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn initialized( &self, hash: ::core::option::Option, @@ -1301,7 +1157,7 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Set { #[codec(compact)] pub now: u64, @@ -1373,11 +1229,133 @@ pub mod api { } } } + pub mod authorship { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetUncles { + pub new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_uncles( + &self, + new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetUncles { new_uncles }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 = Vec< + runtime_types::pallet_authorship::UncleEntryItem< + 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 = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn uncles( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_authorship::UncleEntryItem< + u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Uncles; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn author( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Author; + self.client.storage().fetch(&entry, hash).await + } + pub async fn did_set_uncles( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = DidSetUncles; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } pub mod indices { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Claim { pub index: u32, } @@ -1385,7 +1363,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "claim"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Transfer { pub new: ::subxt::sp_core::crypto::AccountId32, pub index: u32, @@ -1394,7 +1372,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "transfer"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Free { pub index: u32, } @@ -1402,7 +1380,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "free"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceTransfer { pub new: ::subxt::sp_core::crypto::AccountId32, pub index: u32, @@ -1412,7 +1390,7 @@ pub mod api { const PALLET: &'static str = "Indices"; const FUNCTION: &'static str = "force_transfer"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Freeze { pub index: u32, } @@ -1473,19 +1451,19 @@ pub mod api { pub type Event = runtime_types::pallet_indices::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct IndexAssigned(pub ::subxt::sp_core::crypto::AccountId32, pub u32); impl ::subxt::Event for IndexAssigned { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexAssigned"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct IndexFreed(pub u32); impl ::subxt::Event for IndexFreed { const PALLET: &'static str = "Indices"; const EVENT: &'static str = "IndexFreed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct IndexFrozen(pub u32, pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for IndexFrozen { const PALLET: &'static str = "Indices"; @@ -1528,6 +1506,15 @@ pub mod api { let entry = Accounts(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn accounts_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Accounts>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } } } } @@ -1535,11 +1522,11 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Transfer { pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, #[codec(compact)] pub value: u128, @@ -1548,11 +1535,11 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "transfer"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetBalance { pub who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, #[codec(compact)] pub new_free: u128, @@ -1563,15 +1550,15 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "set_balance"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceTransfer { pub source: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, #[codec(compact)] pub value: u128, @@ -1580,11 +1567,11 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "force_transfer"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct TransferKeepAlive { pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, #[codec(compact)] pub value: u128, @@ -1593,11 +1580,11 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "transfer_keep_alive"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct TransferAll { pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, pub keep_alive: bool, } @@ -1605,11 +1592,11 @@ pub mod api { const PALLET: &'static str = "Balances"; const FUNCTION: &'static str = "transfer_all"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceUnreserve { pub who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, pub amount: u128, } @@ -1634,7 +1621,7 @@ pub mod api { &self, dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, value: u128, ) -> ::subxt::SubmittableExtrinsic { @@ -1645,7 +1632,7 @@ pub mod api { &self, who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, new_free: u128, new_reserved: u128, @@ -1661,11 +1648,11 @@ pub mod api { &self, source: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, value: u128, ) -> ::subxt::SubmittableExtrinsic { @@ -1680,7 +1667,7 @@ pub mod api { &self, dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, value: u128, ) -> ::subxt::SubmittableExtrinsic { @@ -1691,7 +1678,7 @@ pub mod api { &self, dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, keep_alive: bool, ) -> ::subxt::SubmittableExtrinsic { @@ -1702,7 +1689,7 @@ pub mod api { &self, who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, amount: u128, ) -> ::subxt::SubmittableExtrinsic { @@ -1714,19 +1701,19 @@ pub mod api { pub type Event = runtime_types::pallet_balances::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Endowed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Endowed { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Endowed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct DustLost(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for DustLost { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "DustLost"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Transfer( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, @@ -1736,7 +1723,7 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Transfer"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct BalanceSet( pub ::subxt::sp_core::crypto::AccountId32, pub u128, @@ -1746,25 +1733,19 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "BalanceSet"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Deposit(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Deposit"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Reserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Reserved { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Reserved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Unreserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Unreserved { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "Unreserved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ReserveRepatriated( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, @@ -1775,6 +1756,24 @@ pub mod api { const PALLET: &'static str = "Balances"; const EVENT: &'static str = "ReserveRepatriated"; } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Deposit(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Deposit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Withdraw(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Withdraw { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Withdraw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Slashed"; + } } pub mod storage { use super::runtime_types; @@ -1859,23 +1858,48 @@ pub mod api { > { let entry = Account(_0); self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < u128 > > , :: subxt :: Error >{ - let entry = Locks(_0); - self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn reserves( + pub async fn account_iter( &self, - _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData<[u8; 8usize], u128>, - >, + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < u128 > > , :: subxt :: Error >{ + let entry = Locks(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn locks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn reserves( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData<[u8; 8usize], u128>, + >, ::subxt::Error, > { let entry = Reserves(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn reserves_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Reserves>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn storage_version( &self, hash: ::core::option::Option, @@ -1941,22 +1965,48 @@ pub mod api { } } } - pub mod authorship { + pub mod election_provider_multi_phase { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetUncles { - pub new_uncles: Vec< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SubmitUnsigned { pub raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > , 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)] + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: Option<[u128; 3usize]>, + } + 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)] + pub struct SetEmergencyElectionResult { + pub supports: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, >, - >, + )>, } - impl ::subxt::Call for SetUncles { - const PALLET: &'static str = "Authorship"; - const FUNCTION: &'static str = "set_uncles"; + 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)] + pub struct Submit { + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::node_runtime::NposSolution16, + >, + pub num_signed_submissions: u32, + } + impl ::subxt::Call for Submit { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit"; } pub struct TransactionApi< 'a, @@ -1971,107 +2021,286 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn set_uncles( + pub fn submit_unsigned( &self, - new_uncles: Vec< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, + witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + ) -> ::subxt::SubmittableExtrinsic { + let call = SubmitUnsigned { + raw_solution, + witness, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: Option<[u128; 3usize]>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMinimumUntrustedScore { maybe_next_score }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_emergency_election_result( + &self, + supports: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetUncles { new_uncles }; + )>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetEmergencyElectionResult { supports }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, + num_signed_submissions: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Submit { + raw_solution, + num_signed_submissions, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } + 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)] + pub struct SolutionStored( + pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub bool, + ); + impl ::subxt::Event for SolutionStored { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SolutionStored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ElectionFinalized( + pub 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)] + pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Slashed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SignedPhaseStarted(pub u32); + impl ::subxt::Event for SignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SignedPhaseStarted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct UnsignedPhaseStarted(pub 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 Uncles; - impl ::subxt::StorageEntry for Uncles { - const PALLET: &'static str = "Authorship"; - const STORAGE: &'static str = "Uncles"; - type Value = Vec< - runtime_types::pallet_authorship::UncleEntryItem< - u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >; + pub struct Round; + impl ::subxt::StorageEntry for Round { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Round"; + type Value = u32; 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; + 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; 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 = bool; + 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 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 uncles( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_authorship::UncleEntryItem< - u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Uncles; - self.client.storage().fetch_or_default(&entry, hash).await + 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< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - pub async fn author( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Author; - self.client.storage().fetch(&entry, hash).await + } + pub struct DesiredTargets; + impl ::subxt::StorageEntry for DesiredTargets { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "DesiredTargets"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - pub async fn did_set_uncles( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = DidSetUncles; - self.client.storage().fetch_or_default(&entry, hash).await + } + 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 = 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 < [u128 ; 3usize] , u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionsMap(pub 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 , u128 , runtime_types :: node_runtime :: NposSolution16 > ; + 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 = [u128; 3usize]; + 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 round( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Round; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_election_provider_multi_phase::Phase, + ::subxt::Error, + > { + let entry = CurrentPhase; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn queued_solution (& self , 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 :: Error >{ + let entry = QueuedSolution; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: Error >{ + let entry = Snapshot; + self.client.storage().fetch(&entry, hash).await + } + pub async fn desired_targets( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = DesiredTargets; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: Error >{ + let entry = SnapshotMetadata; + self.client.storage().fetch(&entry, hash).await + } + pub async fn signed_submission_next_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = SignedSubmissionNextIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [u128 ; 3usize] , u32 > , :: subxt :: Error >{ + let entry = SignedSubmissionIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submissions_map (& self , _0 : u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , u128 , runtime_types :: node_runtime :: NposSolution16 > , :: subxt :: Error >{ + let entry = SignedSubmissionsMap(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn signed_submissions_map_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SignedSubmissionsMap>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn minimum_untrusted_score( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<[u128; 3usize]>, + ::subxt::Error, + > { + let entry = MinimumUntrustedScore; + self.client.storage().fetch(&entry, hash).await + } + } + } } pub mod staking { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Bond { pub controller: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, #[codec(compact)] pub value: u128, @@ -2083,7 +2312,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "bond"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct BondExtra { #[codec(compact)] pub max_additional: u128, @@ -2092,7 +2321,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "bond_extra"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Unbond { #[codec(compact)] pub value: u128, @@ -2101,7 +2330,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "unbond"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct WithdrawUnbonded { pub num_slashing_spans: u32, } @@ -2109,7 +2338,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "withdraw_unbonded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Validate { pub prefs: runtime_types::pallet_staking::ValidatorPrefs, } @@ -2117,12 +2346,12 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "validate"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Nominate { pub targets: Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, >, } @@ -2130,13 +2359,13 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "nominate"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Chill {} impl ::subxt::Call for Chill { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "chill"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetPayee { pub payee: runtime_types::pallet_staking::RewardDestination< ::subxt::sp_core::crypto::AccountId32, @@ -2146,18 +2375,18 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "set_payee"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetController { pub controller: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, } impl ::subxt::Call for SetController { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "set_controller"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetValidatorCount { #[codec(compact)] pub new: u32, @@ -2166,7 +2395,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "set_validator_count"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct IncreaseValidatorCount { #[codec(compact)] pub additional: u32, @@ -2175,7 +2404,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "increase_validator_count"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ScaleValidatorCount { pub factor: runtime_types::sp_arithmetic::per_things::Percent, } @@ -2183,19 +2412,19 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "scale_validator_count"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceNoEras {} impl ::subxt::Call for ForceNoEras { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "force_no_eras"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceNewEra {} impl ::subxt::Call for ForceNewEra { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "force_new_era"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetInvulnerables { pub invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, } @@ -2203,7 +2432,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "set_invulnerables"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceUnstake { pub stash: ::subxt::sp_core::crypto::AccountId32, pub num_slashing_spans: u32, @@ -2212,13 +2441,13 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "force_unstake"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ForceNewEraAlways {} impl ::subxt::Call for ForceNewEraAlways { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "force_new_era_always"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CancelDeferredSlash { pub era: u32, pub slash_indices: Vec, @@ -2227,7 +2456,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "cancel_deferred_slash"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PayoutStakers { pub validator_stash: ::subxt::sp_core::crypto::AccountId32, pub era: u32, @@ -2236,7 +2465,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "payout_stakers"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Rebond { #[codec(compact)] pub value: u128, @@ -2245,7 +2474,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "rebond"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetHistoryDepth { #[codec(compact)] pub new_history_depth: u32, @@ -2256,7 +2485,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "set_history_depth"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ReapStash { pub stash: ::subxt::sp_core::crypto::AccountId32, pub num_slashing_spans: u32, @@ -2265,12 +2494,12 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "reap_stash"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Kick { pub who: Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, >, } @@ -2278,7 +2507,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "kick"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetStakingLimits { pub min_nominator_bond: u128, pub min_validator_bond: u128, @@ -2290,7 +2519,7 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "set_staking_limits"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ChillOther { pub controller: ::subxt::sp_core::crypto::AccountId32, } @@ -2315,7 +2544,7 @@ pub mod api { &self, controller: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, value: u128, payee: runtime_types::pallet_staking::RewardDestination< @@ -2362,7 +2591,7 @@ pub mod api { targets: Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, >, ) -> ::subxt::SubmittableExtrinsic { @@ -2386,7 +2615,7 @@ pub mod api { &self, controller: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, ) -> ::subxt::SubmittableExtrinsic { let call = SetController { controller }; @@ -2505,7 +2734,7 @@ pub mod api { who: Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, >, ) -> ::subxt::SubmittableExtrinsic { @@ -2541,55 +2770,55 @@ pub mod api { pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct EraPaid(pub u32, pub u128, pub u128); impl ::subxt::Event for EraPaid { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "EraPaid"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Rewarded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Rewarded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Slashed { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Slashed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OldSlashingReportDiscarded(pub u32); impl ::subxt::Event for OldSlashingReportDiscarded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "OldSlashingReportDiscarded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct StakersElected {} impl ::subxt::Event for StakersElected { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "StakersElected"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Bonded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Bonded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Bonded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Unbonded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Unbonded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Unbonded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Withdrawn(pub ::subxt::sp_core::crypto::AccountId32, pub u128); impl ::subxt::Event for Withdrawn { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Withdrawn"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Kicked( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, @@ -2598,19 +2827,19 @@ pub mod api { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Kicked"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct StakingElectionFailed {} impl ::subxt::Event for StakingElectionFailed { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "StakingElectionFailed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PayoutStarted(pub u32, pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for PayoutStarted { const PALLET: &'static str = "Staking"; @@ -3035,6 +3264,15 @@ pub mod api { ::subxt::StorageEntryKey::Plain } } + pub struct OffendingValidators; + impl ::subxt::StorageEntry for OffendingValidators { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "OffendingValidators"; + type Value = Vec<(u32, bool)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } pub struct StorageVersion; impl ::subxt::StorageEntry for StorageVersion { const PALLET: &'static str = "Staking"; @@ -3102,6 +3340,13 @@ pub mod api { let entry = Bonded(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn bonded_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Bonded>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } pub async fn min_nominator_bond( &self, hash: ::core::option::Option, @@ -3132,6 +3377,13 @@ pub mod api { let entry = Ledger(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn ledger_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Ledger>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } pub async fn payee( &self, _0: ::subxt::sp_core::crypto::AccountId32, @@ -3145,6 +3397,13 @@ pub mod api { let entry = Payee(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn payee_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Payee>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } pub async fn validators( &self, _0: ::subxt::sp_core::crypto::AccountId32, @@ -3156,6 +3415,15 @@ pub mod api { let entry = Validators(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn validators_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Validators>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn counter_for_validators( &self, hash: ::core::option::Option, @@ -3186,6 +3454,15 @@ pub mod api { let entry = Nominators(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn nominators_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Nominators>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn counter_for_nominators( &self, hash: ::core::option::Option, @@ -3228,6 +3505,15 @@ pub mod api { let entry = ErasStartSessionIndex(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn eras_start_session_index_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStartSessionIndex>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn eras_stakers( &self, _0: u32, @@ -3243,6 +3529,15 @@ pub mod api { let entry = ErasStakers(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn eras_stakers_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStakers>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn eras_stakers_clipped( &self, _0: u32, @@ -3258,6 +3553,15 @@ pub mod api { let entry = ErasStakersClipped(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn eras_stakers_clipped_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStakersClipped>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn eras_validator_prefs( &self, _0: u32, @@ -3270,6 +3574,15 @@ pub mod api { let entry = ErasValidatorPrefs(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn eras_validator_prefs_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorPrefs>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn eras_validator_reward( &self, _0: u32, @@ -3279,6 +3592,15 @@ pub mod api { let entry = ErasValidatorReward(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn eras_validator_reward_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorReward>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn eras_reward_points( &self, _0: u32, @@ -3292,6 +3614,15 @@ pub mod api { let entry = ErasRewardPoints(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn eras_reward_points_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasRewardPoints>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn eras_total_stake( &self, _0: u32, @@ -3300,6 +3631,15 @@ pub mod api { let entry = ErasTotalStake(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn eras_total_stake_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasTotalStake>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn force_era( &self, hash: ::core::option::Option, @@ -3343,6 +3683,15 @@ pub mod api { let entry = UnappliedSlashes(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn unapplied_slashes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, UnappliedSlashes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn bonded_eras( &self, hash: ::core::option::Option, @@ -3366,6 +3715,15 @@ pub mod api { let entry = ValidatorSlashInEra(_0, _1); self.client.storage().fetch(&entry, hash).await } + pub async fn validator_slash_in_era_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ValidatorSlashInEra>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn nominator_slash_in_era( &self, _0: u32, @@ -3376,6 +3734,15 @@ pub mod api { let entry = NominatorSlashInEra(_0, _1); self.client.storage().fetch(&entry, hash).await } + pub async fn nominator_slash_in_era_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, NominatorSlashInEra>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn slashing_spans( &self, _0: ::subxt::sp_core::crypto::AccountId32, @@ -3389,6 +3756,15 @@ pub mod api { let entry = SlashingSpans(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn slashing_spans_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SlashingSpans>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn span_slash( &self, _0: ::subxt::sp_core::crypto::AccountId32, @@ -3401,6 +3777,15 @@ pub mod api { let entry = SpanSlash(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn span_slash_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SpanSlash>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn earliest_unapplied_slash( &self, hash: ::core::option::Option, @@ -3416,6 +3801,14 @@ pub mod api { let entry = CurrentPlannedSession; self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn offending_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = OffendingValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn storage_version( &self, hash: ::core::option::Option, @@ -3441,138 +3834,20 @@ pub mod api { } } } - pub mod offences { + pub mod session { use super::runtime_types; - pub type Event = runtime_types::pallet_offences::pallet::Event; - pub mod events { + pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Offence(pub [u8; 16usize], pub Vec); - 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(pub ::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, - u128, - >, - ), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ConcurrentReportsIndex([u8; 16usize], Vec); - impl ::subxt::StorageEntry for ConcurrentReportsIndex { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ConcurrentReportsIndex"; - type Value = 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(pub [u8; 16usize]); - impl ::subxt::StorageEntry for ReportsByKindIndex { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = 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 } - } - pub async fn reports( - &self, - _0: ::subxt::sp_core::H256, - 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, - u128, - >, - ), - >, - >, - ::subxt::Error, - > { - let entry = Reports(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn concurrent_reports_index( - &self, - _0: [u8; 16usize], - _1: Vec, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = ConcurrentReportsIndex(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn reports_by_kind_index( - &self, - _0: [u8; 16usize], - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> { - let entry = ReportsByKindIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod historical { - use super::runtime_types; - } - pub mod session { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetKeys { - pub keys: runtime_types::polkadot_runtime::SessionKeys, - pub proof: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetKeys { + pub keys: runtime_types::node_runtime::SessionKeys, + pub proof: Vec, } impl ::subxt::Call for SetKeys { const PALLET: &'static str = "Session"; const FUNCTION: &'static str = "set_keys"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PurgeKeys {} impl ::subxt::Call for PurgeKeys { const PALLET: &'static str = "Session"; @@ -3593,7 +3868,7 @@ pub mod api { } pub fn set_keys( &self, - keys: runtime_types::polkadot_runtime::SessionKeys, + keys: runtime_types::node_runtime::SessionKeys, proof: Vec, ) -> ::subxt::SubmittableExtrinsic { let call = SetKeys { keys, proof }; @@ -3608,7 +3883,7 @@ pub mod api { pub type Event = runtime_types::pallet_session::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NewSession(pub u32); impl ::subxt::Event for NewSession { const PALLET: &'static str = "Session"; @@ -3650,7 +3925,7 @@ pub mod api { const STORAGE: &'static str = "QueuedKeys"; type Value = Vec<( ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::SessionKeys, + runtime_types::node_runtime::SessionKeys, )>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain @@ -3669,7 +3944,7 @@ pub mod api { impl ::subxt::StorageEntry for NextKeys { const PALLET: &'static str = "Session"; const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::polkadot_runtime::SessionKeys; + type Value = runtime_types::node_runtime::SessionKeys; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -3726,7 +4001,7 @@ pub mod api { ) -> ::core::result::Result< Vec<( ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::SessionKeys, + runtime_types::node_runtime::SessionKeys, )>, ::subxt::Error, > { @@ -3745,12 +4020,21 @@ pub mod api { _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option, + ::core::option::Option, ::subxt::Error, > { let entry = NextKeys(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn next_keys_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, NextKeys>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn key_owner( &self, _0: runtime_types::sp_core::crypto::KeyTypeId, @@ -3763,260 +4047,235 @@ pub mod api { let entry = KeyOwner(_0, _1); self.client.storage().fetch(&entry, hash).await } + pub async fn key_owner_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, KeyOwner>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } } } } - pub mod grandpa { + pub mod democracy { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReportEquivocation { - pub equivocation_proof: - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - u32, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Propose { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub value: u128, } - impl ::subxt::Call for ReportEquivocation { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation"; + impl ::subxt::Call for Propose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "propose"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - u32, - >, - pub key_owner_proof: runtime_types::sp_session::MembershipProof, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Second { + #[codec(compact)] + pub proposal: u32, + #[codec(compact)] + pub seconds_upper_bound: u32, } - impl ::subxt::Call for ReportEquivocationUnsigned { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "report_equivocation_unsigned"; + impl ::subxt::Call for Second { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "second"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NoteStalled { - pub delay: u32, - pub best_finalized_block_number: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vote { + #[codec(compact)] + pub ref_index: u32, + pub vote: runtime_types::pallet_democracy::vote::AccountVote, } - impl ::subxt::Call for NoteStalled { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "note_stalled"; + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "vote"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct EmergencyCancel { + pub ref_index: u32, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn report_equivocation( - &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocation { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn report_equivocation_unsigned( - &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocationUnsigned { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_stalled( - &self, - delay: u32, - best_finalized_block_number: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = NoteStalled { - delay, - best_finalized_block_number, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } + impl ::subxt::Call for EmergencyCancel { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "emergency_cancel"; } - } - pub type Event = runtime_types::pallet_grandpa::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NewAuthorities( - pub Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, - ); - impl ::subxt::Event for NewAuthorities { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "NewAuthorities"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ExternalPropose { + pub proposal_hash: ::subxt::sp_core::H256, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Paused {} - impl ::subxt::Event for Paused { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Paused"; + impl ::subxt::Call for ExternalPropose { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Resumed {} - impl ::subxt::Event for Resumed { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "Resumed"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ExternalProposeMajority { + pub proposal_hash: ::subxt::sp_core::H256, } - } - 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; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + impl ::subxt::Call for ExternalProposeMajority { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose_majority"; } - 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; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ExternalProposeDefault { + pub proposal_hash: ::subxt::sp_core::H256, } - pub struct NextForced; - impl ::subxt::StorageEntry for NextForced { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "NextForced"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + impl ::subxt::Call for ExternalProposeDefault { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "external_propose_default"; } - pub struct Stalled; - impl ::subxt::StorageEntry for Stalled { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "Stalled"; - type Value = (u32, u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct FastTrack { + pub proposal_hash: ::subxt::sp_core::H256, + pub voting_period: u32, + pub delay: u32, } - pub struct CurrentSetId; - impl ::subxt::StorageEntry for CurrentSetId { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "CurrentSetId"; - type Value = u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + impl ::subxt::Call for FastTrack { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "fast_track"; } - pub struct SetIdSession(pub u64); - impl ::subxt::StorageEntry for SetIdSession { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "SetIdSession"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VetoExternal { + pub proposal_hash: ::subxt::sp_core::H256, } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + impl ::subxt::Call for VetoExternal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "veto_external"; } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn state( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_grandpa::StoredState, - ::subxt::Error, - > { - let entry = State; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn pending_change( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange, - >, - ::subxt::Error, - > { - let entry = PendingChange; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_forced( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = NextForced; - self.client.storage().fetch(&entry, hash).await - } - pub async fn stalled( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(u32, u32)>, - ::subxt::Error, - > { - let entry = Stalled; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_set_id( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CurrentSetId; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn set_id_session( - &self, - _0: u64, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = SetIdSession(_0); - self.client.storage().fetch(&entry, hash).await - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelReferendum { + #[codec(compact)] + pub ref_index: u32, } - } - } - pub mod im_online { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Heartbeat { - pub heartbeat: runtime_types::pallet_im_online::Heartbeat, - pub signature: - runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, + impl ::subxt::Call for CancelReferendum { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_referendum"; } - impl ::subxt::Call for Heartbeat { - const PALLET: &'static str = "ImOnline"; - const FUNCTION: &'static str = "heartbeat"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelQueued { + pub which: u32, + } + impl ::subxt::Call for CancelQueued { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_queued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Delegate { + pub to: ::subxt::sp_core::crypto::AccountId32, + pub conviction: runtime_types::pallet_democracy::conviction::Conviction, + pub balance: u128, + } + impl ::subxt::Call for Delegate { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "delegate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub struct NotePreimage { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NotePreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NotePreimageOperational { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NotePreimageOperational { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_preimage_operational"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NoteImminentPreimage { + pub encoded_proposal: Vec, + } + impl ::subxt::Call for NoteImminentPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "note_imminent_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NoteImminentPreimageOperational { + pub encoded_proposal: Vec, + } + 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)] + pub struct ReapPreimage { + pub proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub proposal_len_upper_bound: u32, + } + impl ::subxt::Call for ReapPreimage { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "reap_preimage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct RemoveVote { + pub index: u32, + } + impl ::subxt::Call for RemoveVote { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "remove_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveOtherVote { + pub target: ::subxt::sp_core::crypto::AccountId32, + pub index: 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)] + pub struct EnactProposal { + pub proposal_hash: ::subxt::sp_core::H256, + pub index: u32, + } + impl ::subxt::Call for EnactProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "enact_proposal"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Blacklist { + pub proposal_hash: ::subxt::sp_core::H256, + pub maybe_ref_index: Option, + } + impl ::subxt::Call for Blacklist { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "blacklist"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelProposal { + #[codec(compact)] + pub prop_index: u32, + } + impl ::subxt::Call for CancelProposal { + const PALLET: &'static str = "Democracy"; + const FUNCTION: &'static str = "cancel_proposal"; } pub struct TransactionApi< 'a, @@ -4031,467 +4290,85 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn heartbeat( + pub fn propose( &self, - heartbeat: runtime_types::pallet_im_online::Heartbeat, - signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, - ) -> ::subxt::SubmittableExtrinsic { - let call = Heartbeat { - heartbeat, - signature, + proposal_hash: ::subxt::sp_core::H256, + value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + proposal_hash, + value, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - } - pub type Event = runtime_types::pallet_im_online::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct HeartbeatReceived( - pub 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AllGood {} - impl ::subxt::Event for AllGood { - const PALLET: &'static str = "ImOnline"; - const EVENT: &'static str = "AllGood"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SomeOffline( - pub Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + pub fn second( + &self, + proposal: u32, + seconds_upper_bound: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Second { + proposal, + seconds_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - 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 fn vote( + &self, + ref_index: u32, + vote: runtime_types::pallet_democracy::vote::AccountVote, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { ref_index, vote }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - pub struct ReceivedHeartbeats(u32, 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 fn emergency_cancel( + &self, + ref_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = EmergencyCancel { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - pub struct AuthoredBlocks(u32, ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for AuthoredBlocks { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "AuthoredBlocks"; - type Value = 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 fn external_propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = ExternalPropose { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - 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 fn external_propose_majority( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExternalProposeMajority { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub async fn heartbeat_after( + pub fn external_propose_default( &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = HeartbeatAfter; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn keys (& self , 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 :: Error >{ - let entry = Keys; - self.client.storage().fetch_or_default(&entry, hash).await + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExternalProposeDefault { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub async fn received_heartbeats( + pub fn fast_track( &self, - _0: u32, - _1: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >, - >, - ::subxt::Error, - > { - let entry = ReceivedHeartbeats(_0, _1); - self.client.storage().fetch(&entry, hash).await + proposal_hash: ::subxt::sp_core::H256, + voting_period: u32, + delay: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FastTrack { + proposal_hash, + voting_period, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub async fn authored_blocks( + pub fn veto_external( &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = AuthoredBlocks(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod authority_discovery { - use super::runtime_types; - } - pub mod democracy { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Propose { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "propose"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Second { - #[codec(compact)] - pub proposal: u32, - #[codec(compact)] - pub seconds_upper_bound: u32, - } - impl ::subxt::Call for Second { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "second"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Vote { - #[codec(compact)] - pub ref_index: u32, - pub vote: runtime_types::pallet_democracy::vote::AccountVote, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "vote"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct EmergencyCancel { - pub ref_index: u32, - } - impl ::subxt::Call for EmergencyCancel { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "emergency_cancel"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct FastTrack { - pub proposal_hash: ::subxt::sp_core::H256, - pub voting_period: u32, - pub delay: u32, - } - impl ::subxt::Call for FastTrack { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "fast_track"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelReferendum { - #[codec(compact)] - pub ref_index: u32, - } - impl ::subxt::Call for CancelReferendum { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_referendum"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelQueued { - pub which: u32, - } - impl ::subxt::Call for CancelQueued { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_queued"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Delegate { - pub to: ::subxt::sp_core::crypto::AccountId32, - pub conviction: runtime_types::pallet_democracy::conviction::Conviction, - pub balance: u128, - } - impl ::subxt::Call for Delegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "delegate"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Undelegate {} - impl ::subxt::Call for Undelegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "undelegate"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ClearPublicProposals {} - impl ::subxt::Call for ClearPublicProposals { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "clear_public_proposals"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NotePreimage { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NotePreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NotePreimageOperational { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NotePreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage_operational"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NoteImminentPreimage { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NoteImminentPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NoteImminentPreimageOperational { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NoteImminentPreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage_operational"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReapPreimage { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub proposal_len_upper_bound: u32, - } - impl ::subxt::Call for ReapPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "reap_preimage"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RemoveVote { - pub index: u32, - } - impl ::subxt::Call for RemoveVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_vote"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RemoveOtherVote { - pub target: ::subxt::sp_core::crypto::AccountId32, - pub index: u32, - } - impl ::subxt::Call for RemoveOtherVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_other_vote"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct EnactProposal { - pub proposal_hash: ::subxt::sp_core::H256, - pub index: u32, - } - impl ::subxt::Call for EnactProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "enact_proposal"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Blacklist { - pub proposal_hash: ::subxt::sp_core::H256, - pub maybe_ref_index: Option, - } - impl ::subxt::Call for Blacklist { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "blacklist"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelProposal { - #[codec(compact)] - pub prop_index: u32, - } - impl ::subxt::Call for CancelProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_proposal"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - proposal_hash, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn second( - &self, - proposal: u32, - seconds_upper_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Second { - proposal, - seconds_upper_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - ref_index: u32, - vote: runtime_types::pallet_democracy::vote::AccountVote, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { ref_index, vote }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn emergency_cancel( - &self, - ref_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = EmergencyCancel { ref_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = ExternalPropose { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose_majority( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExternalProposeMajority { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose_default( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExternalProposeDefault { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn fast_track( - &self, - proposal_hash: ::subxt::sp_core::H256, - voting_period: u32, - delay: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FastTrack { - proposal_hash, - voting_period, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn veto_external( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = VetoExternal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = VetoExternal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn cancel_referendum( &self, @@ -4629,13 +4506,13 @@ pub mod api { pub type Event = runtime_types::pallet_democracy::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Proposed(pub u32, pub u128); impl ::subxt::Event for Proposed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Proposed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Tabled( pub u32, pub u128, @@ -4645,13 +4522,13 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Tabled"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ExternalTabled {} impl ::subxt::Event for ExternalTabled { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "ExternalTabled"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Started( pub u32, pub runtime_types::pallet_democracy::vote_threshold::VoteThreshold, @@ -4660,25 +4537,25 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Started"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Passed(pub u32); impl ::subxt::Event for Passed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Passed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NotPassed(pub u32); impl ::subxt::Event for NotPassed { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "NotPassed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Cancelled(pub u32); impl ::subxt::Event for Cancelled { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Cancelled"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Executed( pub u32, pub Result<(), runtime_types::sp_runtime::DispatchError>, @@ -4687,7 +4564,7 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Executed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Delegated( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, @@ -4696,13 +4573,13 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Delegated"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Undelegated(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for Undelegated { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Undelegated"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Vetoed( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::H256, @@ -4712,7 +4589,7 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "Vetoed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PreimageNoted( pub ::subxt::sp_core::H256, pub ::subxt::sp_core::crypto::AccountId32, @@ -4722,7 +4599,7 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageNoted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PreimageUsed( pub ::subxt::sp_core::H256, pub ::subxt::sp_core::crypto::AccountId32, @@ -4732,19 +4609,19 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageUsed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PreimageInvalid(pub ::subxt::sp_core::H256, pub u32); impl ::subxt::Event for PreimageInvalid { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageInvalid"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PreimageMissing(pub ::subxt::sp_core::H256, pub u32); impl ::subxt::Event for PreimageMissing { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageMissing"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct PreimageReaped( pub ::subxt::sp_core::H256, pub ::subxt::sp_core::crypto::AccountId32, @@ -4755,7 +4632,7 @@ pub mod api { const PALLET: &'static str = "Democracy"; const EVENT: &'static str = "PreimageReaped"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Blacklisted(pub ::subxt::sp_core::H256); impl ::subxt::Event for Blacklisted { const PALLET: &'static str = "Democracy"; @@ -4972,6 +4849,15 @@ pub mod api { let entry = DepositOf(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn deposit_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, DepositOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn preimages( &self, _0: ::subxt::sp_core::H256, @@ -4989,6 +4875,15 @@ pub mod api { let entry = Preimages(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn preimages_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Preimages>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn referendum_count( &self, hash: ::core::option::Option, @@ -5020,6 +4915,15 @@ pub mod api { let entry = ReferendumInfoOf(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn referendum_info_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ReferendumInfoOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn voting_of( &self, _0: ::subxt::sp_core::crypto::AccountId32, @@ -5035,6 +4939,15 @@ pub mod api { let entry = VotingOf(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn voting_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, VotingOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn locks( &self, _0: ::subxt::sp_core::crypto::AccountId32, @@ -5044,6 +4957,13 @@ pub mod api { let entry = Locks(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn locks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } pub async fn last_tabled_was_external( &self, hash: ::core::option::Option, @@ -5078,6 +4998,15 @@ pub mod api { let entry = Blacklist(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn blacklist_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Blacklist>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn cancellations( &self, _0: ::subxt::sp_core::H256, @@ -5086,6 +5015,15 @@ pub mod api { let entry = Cancellations(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn cancellations_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Cancellations>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn storage_version( &self, hash: ::core::option::Option, @@ -5103,7 +5041,7 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetMembers { pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, pub prime: Option<::subxt::sp_core::crypto::AccountId32>, @@ -5113,9 +5051,9 @@ pub mod api { const PALLET: &'static str = "Council"; const FUNCTION: &'static str = "set_members"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Execute { - pub proposal: runtime_types::polkadot_runtime::Call, + pub proposal: runtime_types::node_runtime::Call, #[codec(compact)] pub length_bound: u32, } @@ -5123,11 +5061,11 @@ pub mod api { const PALLET: &'static str = "Council"; const FUNCTION: &'static str = "execute"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Propose { #[codec(compact)] pub threshold: u32, - pub proposal: runtime_types::polkadot_runtime::Call, + pub proposal: runtime_types::node_runtime::Call, #[codec(compact)] pub length_bound: u32, } @@ -5135,7 +5073,7 @@ pub mod api { const PALLET: &'static str = "Council"; const FUNCTION: &'static str = "propose"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Vote { pub proposal: ::subxt::sp_core::H256, #[codec(compact)] @@ -5146,7 +5084,7 @@ pub mod api { const PALLET: &'static str = "Council"; const FUNCTION: &'static str = "vote"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Close { pub proposal_hash: ::subxt::sp_core::H256, #[codec(compact)] @@ -5160,7 +5098,7 @@ pub mod api { const PALLET: &'static str = "Council"; const FUNCTION: &'static str = "close"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct DisapproveProposal { pub proposal_hash: ::subxt::sp_core::H256, } @@ -5196,7 +5134,7 @@ pub mod api { } pub fn execute( &self, - proposal: runtime_types::polkadot_runtime::Call, + proposal: runtime_types::node_runtime::Call, length_bound: u32, ) -> ::subxt::SubmittableExtrinsic { let call = Execute { @@ -5208,7 +5146,7 @@ pub mod api { pub fn propose( &self, threshold: u32, - proposal: runtime_types::polkadot_runtime::Call, + proposal: runtime_types::node_runtime::Call, length_bound: u32, ) -> ::subxt::SubmittableExtrinsic { let call = Propose { @@ -5259,7 +5197,7 @@ pub mod api { pub type Event = runtime_types::pallet_collective::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Proposed( pub ::subxt::sp_core::crypto::AccountId32, pub u32, @@ -5270,7 +5208,7 @@ pub mod api { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Proposed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Voted( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::H256, @@ -5282,19 +5220,19 @@ pub mod api { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Voted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Approved(pub ::subxt::sp_core::H256); impl ::subxt::Event for Approved { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Approved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Disapproved(pub ::subxt::sp_core::H256); impl ::subxt::Event for Disapproved { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Disapproved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Executed( pub ::subxt::sp_core::H256, pub Result<(), runtime_types::sp_runtime::DispatchError>, @@ -5303,7 +5241,7 @@ pub mod api { const PALLET: &'static str = "Council"; const EVENT: &'static str = "Executed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MemberExecuted( pub ::subxt::sp_core::H256, pub Result<(), runtime_types::sp_runtime::DispatchError>, @@ -5312,7 +5250,7 @@ pub mod api { const PALLET: &'static str = "Council"; const EVENT: &'static str = "MemberExecuted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Closed(pub ::subxt::sp_core::H256, pub u32, pub u32); impl ::subxt::Event for Closed { const PALLET: &'static str = "Council"; @@ -5337,7 +5275,7 @@ pub mod api { impl ::subxt::StorageEntry for ProposalOf { const PALLET: &'static str = "Council"; const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::polkadot_runtime::Call; + type Value = runtime_types::node_runtime::Call; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -5411,12 +5349,21 @@ pub mod api { _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option, + ::core::option::Option, ::subxt::Error, > { let entry = ProposalOf(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn proposal_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ProposalOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn voting( &self, _0: ::subxt::sp_core::H256, @@ -5433,6 +5380,13 @@ pub mod api { let entry = Voting(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } pub async fn proposal_count( &self, hash: ::core::option::Option, @@ -5467,7 +5421,7 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetMembers { pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, pub prime: Option<::subxt::sp_core::crypto::AccountId32>, @@ -5477,9 +5431,9 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const FUNCTION: &'static str = "set_members"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Execute { - pub proposal: runtime_types::polkadot_runtime::Call, + pub proposal: runtime_types::node_runtime::Call, #[codec(compact)] pub length_bound: u32, } @@ -5487,11 +5441,11 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const FUNCTION: &'static str = "execute"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Propose { #[codec(compact)] pub threshold: u32, - pub proposal: runtime_types::polkadot_runtime::Call, + pub proposal: runtime_types::node_runtime::Call, #[codec(compact)] pub length_bound: u32, } @@ -5499,7 +5453,7 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const FUNCTION: &'static str = "propose"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Vote { pub proposal: ::subxt::sp_core::H256, #[codec(compact)] @@ -5510,7 +5464,7 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const FUNCTION: &'static str = "vote"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Close { pub proposal_hash: ::subxt::sp_core::H256, #[codec(compact)] @@ -5524,7 +5478,7 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const FUNCTION: &'static str = "close"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct DisapproveProposal { pub proposal_hash: ::subxt::sp_core::H256, } @@ -5560,7 +5514,7 @@ pub mod api { } pub fn execute( &self, - proposal: runtime_types::polkadot_runtime::Call, + proposal: runtime_types::node_runtime::Call, length_bound: u32, ) -> ::subxt::SubmittableExtrinsic { let call = Execute { @@ -5572,7 +5526,7 @@ pub mod api { pub fn propose( &self, threshold: u32, - proposal: runtime_types::polkadot_runtime::Call, + proposal: runtime_types::node_runtime::Call, length_bound: u32, ) -> ::subxt::SubmittableExtrinsic { let call = Propose { @@ -5623,7 +5577,7 @@ pub mod api { pub type Event = runtime_types::pallet_collective::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Proposed( pub ::subxt::sp_core::crypto::AccountId32, pub u32, @@ -5634,7 +5588,7 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Proposed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Voted( pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::H256, @@ -5646,19 +5600,19 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Voted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Approved(pub ::subxt::sp_core::H256); impl ::subxt::Event for Approved { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Approved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Disapproved(pub ::subxt::sp_core::H256); impl ::subxt::Event for Disapproved { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Disapproved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Executed( pub ::subxt::sp_core::H256, pub Result<(), runtime_types::sp_runtime::DispatchError>, @@ -5667,7 +5621,7 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "Executed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MemberExecuted( pub ::subxt::sp_core::H256, pub Result<(), runtime_types::sp_runtime::DispatchError>, @@ -5676,7 +5630,7 @@ pub mod api { const PALLET: &'static str = "TechnicalCommittee"; const EVENT: &'static str = "MemberExecuted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Closed(pub ::subxt::sp_core::H256, pub u32, pub u32); impl ::subxt::Event for Closed { const PALLET: &'static str = "TechnicalCommittee"; @@ -5701,7 +5655,7 @@ pub mod api { impl ::subxt::StorageEntry for ProposalOf { const PALLET: &'static str = "TechnicalCommittee"; const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::polkadot_runtime::Call; + type Value = runtime_types::node_runtime::Call; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -5775,12 +5729,21 @@ pub mod api { _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option, + ::core::option::Option, ::subxt::Error, > { let entry = ProposalOf(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn proposal_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ProposalOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn voting( &self, _0: ::subxt::sp_core::H256, @@ -5797,6 +5760,13 @@ pub mod api { let entry = Voting(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } pub async fn proposal_count( &self, hash: ::core::option::Option, @@ -5827,62 +5797,62 @@ pub mod api { } } } - pub mod phragmen_election { + pub mod elections { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Vote { pub votes: Vec<::subxt::sp_core::crypto::AccountId32>, #[codec(compact)] pub value: u128, } impl ::subxt::Call for Vote { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const FUNCTION: &'static str = "vote"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RemoveVoter {} impl ::subxt::Call for RemoveVoter { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const FUNCTION: &'static str = "remove_voter"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SubmitCandidacy { #[codec(compact)] pub candidate_count: u32, } impl ::subxt::Call for SubmitCandidacy { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const FUNCTION: &'static str = "submit_candidacy"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RenounceCandidacy { pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, } impl ::subxt::Call for RenounceCandidacy { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const FUNCTION: &'static str = "renounce_candidacy"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RemoveMember { pub who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, pub has_replacement: bool, } impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const FUNCTION: &'static str = "remove_member"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CleanDefunctVoters { pub num_voters: u32, pub num_defunct: u32, } impl ::subxt::Call for CleanDefunctVoters { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const FUNCTION: &'static str = "clean_defunct_voters"; } pub struct TransactionApi< @@ -5930,7 +5900,7 @@ pub mod api { &self, who: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, has_replacement: bool, ) -> ::subxt::SubmittableExtrinsic { @@ -5957,52 +5927,52 @@ pub mod api { pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NewTerm(pub Vec<(::subxt::sp_core::crypto::AccountId32, u128)>); impl ::subxt::Event for NewTerm { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "NewTerm"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct EmptyTerm {} impl ::subxt::Event for EmptyTerm { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "EmptyTerm"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ElectionError {} impl ::subxt::Event for ElectionError { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "ElectionError"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MemberKicked(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for MemberKicked { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "MemberKicked"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Renounced(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::Event for Renounced { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "Renounced"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CandidateSlashed( pub ::subxt::sp_core::crypto::AccountId32, pub u128, ); impl ::subxt::Event for CandidateSlashed { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "CandidateSlashed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SeatHolderSlashed( pub ::subxt::sp_core::crypto::AccountId32, pub u128, ); impl ::subxt::Event for SeatHolderSlashed { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const EVENT: &'static str = "SeatHolderSlashed"; } } @@ -6010,7 +5980,7 @@ pub mod api { use super::runtime_types; pub struct Members; impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "Members"; type Value = Vec< runtime_types::pallet_elections_phragmen::SeatHolder< @@ -6024,7 +5994,7 @@ pub mod api { } pub struct RunnersUp; impl ::subxt::StorageEntry for RunnersUp { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "RunnersUp"; type Value = Vec< runtime_types::pallet_elections_phragmen::SeatHolder< @@ -6038,7 +6008,7 @@ pub mod api { } pub struct Candidates; impl ::subxt::StorageEntry for Candidates { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "Candidates"; type Value = Vec<(::subxt::sp_core::crypto::AccountId32, u128)>; fn key(&self) -> ::subxt::StorageEntryKey { @@ -6047,7 +6017,7 @@ pub mod api { } pub struct ElectionRounds; impl ::subxt::StorageEntry for ElectionRounds { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "ElectionRounds"; type Value = u32; fn key(&self) -> ::subxt::StorageEntryKey { @@ -6056,7 +6026,7 @@ pub mod api { } pub struct Voting(pub ::subxt::sp_core::crypto::AccountId32); impl ::subxt::StorageEntry for Voting { - const PALLET: &'static str = "PhragmenElection"; + const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "Voting"; type Value = runtime_types::pallet_elections_phragmen::Voter< ::subxt::sp_core::crypto::AccountId32, @@ -6137,6 +6107,13 @@ pub mod api { let entry = Voting(_0); self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } } } } @@ -6144,7 +6121,7 @@ pub mod api { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct AddMember { pub who: ::subxt::sp_core::crypto::AccountId32, } @@ -6152,7 +6129,7 @@ pub mod api { const PALLET: &'static str = "TechnicalMembership"; const FUNCTION: &'static str = "add_member"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RemoveMember { pub who: ::subxt::sp_core::crypto::AccountId32, } @@ -6160,7 +6137,7 @@ pub mod api { const PALLET: &'static str = "TechnicalMembership"; const FUNCTION: &'static str = "remove_member"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SwapMember { pub remove: ::subxt::sp_core::crypto::AccountId32, pub add: ::subxt::sp_core::crypto::AccountId32, @@ -6169,7 +6146,7 @@ pub mod api { const PALLET: &'static str = "TechnicalMembership"; const FUNCTION: &'static str = "swap_member"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ResetMembers { pub members: Vec<::subxt::sp_core::crypto::AccountId32>, } @@ -6177,7 +6154,7 @@ pub mod api { const PALLET: &'static str = "TechnicalMembership"; const FUNCTION: &'static str = "reset_members"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ChangeKey { pub new: ::subxt::sp_core::crypto::AccountId32, } @@ -6185,7 +6162,7 @@ pub mod api { const PALLET: &'static str = "TechnicalMembership"; const FUNCTION: &'static str = "change_key"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetPrime { pub who: ::subxt::sp_core::crypto::AccountId32, } @@ -6193,7 +6170,7 @@ pub mod api { const PALLET: &'static str = "TechnicalMembership"; const FUNCTION: &'static str = "set_prime"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ClearPrime {} impl ::subxt::Call for ClearPrime { const PALLET: &'static str = "TechnicalMembership"; @@ -6266,37 +6243,37 @@ pub mod api { pub type Event = runtime_types::pallet_membership::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MemberAdded {} impl ::subxt::Event for MemberAdded { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MemberAdded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MemberRemoved {} impl ::subxt::Event for MemberRemoved { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MemberRemoved"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MembersSwapped {} impl ::subxt::Event for MembersSwapped { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MembersSwapped"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MembersReset {} impl ::subxt::Event for MembersReset { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "MembersReset"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KeyChanged {} impl ::subxt::Event for KeyChanged { const PALLET: &'static str = "TechnicalMembership"; const EVENT: &'static str = "KeyChanged"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Dummy {} impl ::subxt::Event for Dummy { const PALLET: &'static str = "TechnicalMembership"; @@ -6353,40 +6330,44 @@ pub mod api { } } } - pub mod treasury { + pub mod grandpa { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProposeSpend { - #[codec(compact)] - pub value: u128, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportEquivocation { + pub equivocation_proof: + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + u32, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, } - impl ::subxt::Call for ProposeSpend { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "propose_spend"; + impl ::subxt::Call for ReportEquivocation { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "report_equivocation"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RejectProposal { - #[codec(compact)] - pub proposal_id: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + u32, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, } - impl ::subxt::Call for RejectProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "reject_proposal"; + impl ::subxt::Call for ReportEquivocationUnsigned { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "report_equivocation_unsigned"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ApproveProposal { - #[codec(compact)] - pub proposal_id: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NoteStalled { + pub delay: u32, + pub best_finalized_block_number: u32, } - impl ::subxt::Call for ApproveProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "approve_proposal"; + impl ::subxt::Call for NoteStalled { + const PALLET: &'static str = "Grandpa"; + const FUNCTION: &'static str = "note_stalled"; } pub struct TransactionApi< 'a, @@ -6401,119 +6382,126 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn propose_spend( + pub fn report_equivocation( &self, - value: u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeSpend { value, beneficiary }; + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocation { + equivocation_proof, + key_owner_proof, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn reject_proposal( + pub fn report_equivocation_unsigned( &self, - proposal_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RejectProposal { proposal_id }; + equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocationUnsigned { + equivocation_proof, + key_owner_proof, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn approve_proposal( + pub fn note_stalled( &self, - proposal_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveProposal { proposal_id }; + delay: u32, + best_finalized_block_number: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = NoteStalled { + delay, + best_finalized_block_number, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub type Event = runtime_types::pallet_grandpa::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Proposed(pub u32); - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Proposed"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Spending(pub u128); - impl ::subxt::Event for Spending { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Spending"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Awarded( - pub u32, - pub u128, - pub ::subxt::sp_core::crypto::AccountId32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewAuthorities( + pub Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, ); - impl ::subxt::Event for Awarded { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Awarded"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Rejected(pub u32, pub u128); - impl ::subxt::Event for Rejected { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rejected"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Burnt(pub u128); - impl ::subxt::Event for Burnt { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Burnt"; + impl ::subxt::Event for NewAuthorities { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "NewAuthorities"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Rollover(pub u128); - impl ::subxt::Event for Rollover { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rollover"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Paused {} + impl ::subxt::Event for Paused { + const PALLET: &'static str = "Grandpa"; + const EVENT: &'static str = "Paused"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Deposit(pub u128); - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Deposit"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Treasury"; - const STORAGE: &'static str = "ProposalCount"; + 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; + 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; + 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 = u32; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } } - pub struct Proposals(pub 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, - u128, - >; + pub struct Stalled; + impl ::subxt::StorageEntry for Stalled { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "Stalled"; + type Value = (u32, u32); fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) + ::subxt::StorageEntryKey::Plain } } - 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; + pub struct CurrentSetId; + impl ::subxt::StorageEntry for CurrentSetId { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "CurrentSetId"; + type Value = u64; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } } + pub struct SetIdSession(pub u64); + impl ::subxt::StorageEntry for SetIdSession { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "SetIdSession"; + type Value = 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, } @@ -6521,96 +6509,108 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn proposal_count( + pub async fn state( &self, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ProposalCount; + ) -> ::core::result::Result< + runtime_types::pallet_grandpa::StoredState, + ::subxt::Error, + > { + let entry = State; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn proposals( + pub async fn pending_change( &self, - _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, + runtime_types::pallet_grandpa::StoredPendingChange, >, ::subxt::Error, > { - let entry = Proposals(_0); + let entry = PendingChange; self.client.storage().fetch(&entry, hash).await } - pub async fn approvals( + pub async fn next_forced( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = NextForced; + self.client.storage().fetch(&entry, hash).await + } + pub async fn stalled( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec, + ::core::option::Option<(u32, u32)>, ::subxt::Error, > { - let entry = Approvals; + let entry = Stalled; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_set_id( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CurrentSetId; self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn set_id_session( + &self, + _0: u64, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = SetIdSession(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn set_id_session_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SetIdSession>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } } } } - pub mod claims { + pub mod treasury { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Claim { - pub dest: ::subxt::sp_core::crypto::AccountId32, - pub ethereum_signature: - runtime_types::polkadot_runtime_common::claims::EcdsaSignature, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProposeSpend { + #[codec(compact)] + pub value: u128, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "claim"; + impl ::subxt::Call for ProposeSpend { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "propose_spend"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MintClaim { - pub who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub value: u128, - pub vesting_schedule: Option<(u128, u128, u32)>, - pub statement: - Option, - } - impl ::subxt::Call for MintClaim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "mint_claim"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ClaimAttest { - pub dest: ::subxt::sp_core::crypto::AccountId32, - pub ethereum_signature: - runtime_types::polkadot_runtime_common::claims::EcdsaSignature, - pub statement: Vec, - } - impl ::subxt::Call for ClaimAttest { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "claim_attest"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Attest { - pub statement: Vec, - } - impl ::subxt::Call for Attest { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "attest"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MoveClaim { - pub old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - pub maybe_preclaim: Option<::subxt::sp_core::crypto::AccountId32>, - } - impl ::subxt::Call for MoveClaim { - const PALLET: &'static str = "Claims"; - const FUNCTION: &'static str = "move_claim"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RejectProposal { + #[codec(compact)] + pub proposal_id: u32, + } + impl ::subxt::Call for RejectProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "reject_proposal"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveProposal { + #[codec(compact)] + pub proposal_id: u32, + } + impl ::subxt::Call for ApproveProposal { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "approve_proposal"; } pub struct TransactionApi< 'a, @@ -6625,148 +6625,117 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn claim( - &self, - dest: ::subxt::sp_core::crypto::AccountId32, - ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, - ) -> ::subxt::SubmittableExtrinsic { - let call = Claim { - dest, - ethereum_signature, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn mint_claim( + pub fn propose_spend( &self, - who: runtime_types::polkadot_runtime_common::claims::EthereumAddress, value: u128, - vesting_schedule: Option<(u128, u128, u32)>, - statement: Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, >, - ) -> ::subxt::SubmittableExtrinsic { - let call = MintClaim { - who, - value, - vesting_schedule, - statement, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn claim_attest( - &self, - dest: ::subxt::sp_core::crypto::AccountId32, - ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature, - statement: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClaimAttest { - dest, - ethereum_signature, - statement, - }; + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeSpend { value, beneficiary }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn attest( + pub fn reject_proposal( &self, - statement: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Attest { statement }; + proposal_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RejectProposal { proposal_id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn move_claim( + pub fn approve_proposal( &self, - old: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - new: runtime_types::polkadot_runtime_common::claims::EthereumAddress, - maybe_preclaim: Option<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = MoveClaim { - old, - new, - maybe_preclaim, - }; + proposal_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveProposal { proposal_id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::polkadot_runtime_common::claims::pallet::Event; + pub type Event = runtime_types::pallet_treasury::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Claimed( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposed(pub u32); + impl ::subxt::Event for Proposed { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Proposed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Spending(pub u128); + impl ::subxt::Event for Spending { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Spending"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Awarded( + pub u32, pub u128, + pub ::subxt::sp_core::crypto::AccountId32, ); - impl ::subxt::Event for Claimed { - const PALLET: &'static str = "Claims"; - const EVENT: &'static str = "Claimed"; + impl ::subxt::Event for Awarded { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Awarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Rejected(pub u32, pub u128); + impl ::subxt::Event for Rejected { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rejected"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burnt(pub u128); + impl ::subxt::Event for Burnt { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Burnt"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Rollover(pub u128); + impl ::subxt::Event for Rollover { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rollover"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Deposit(pub 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 Claims( - pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Claims { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Claims"; - type Value = 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 = u128; + pub struct ProposalCount; + impl ::subxt::StorageEntry for ProposalCount { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "ProposalCount"; + type Value = u32; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } } - pub struct Vesting( - pub runtime_types::polkadot_runtime_common::claims::EthereumAddress, - ); - impl ::subxt::StorageEntry for Vesting { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Vesting"; - type Value = (u128, u128, u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Signing( - pub 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; + pub struct Proposals(pub 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, + u128, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Identity, + ::subxt::StorageHasher::Twox64Concat, )]) } } - pub struct Preclaims(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Preclaims { - const PALLET: &'static str = "Claims"; - const STORAGE: &'static str = "Preclaims"; + pub struct Approvals; + impl ::subxt::StorageEntry for Approvals { + const PALLET: &'static str = "Treasury"; + const STORAGE: &'static str = "Approvals"; type Value = - runtime_types::polkadot_runtime_common::claims::EthereumAddress; + runtime_types::frame_support::storage::bounded_vec::BoundedVec; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) + ::subxt::StorageEntryKey::Plain } } pub struct StorageApi<'a, T: ::subxt::Config> { @@ -6776,121 +6745,98 @@ 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, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = Claims(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn total( + pub async fn proposal_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Total; + ) -> ::core::result::Result { + let entry = ProposalCount; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn vesting( + pub async fn proposals( &self, - _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, + _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<(u128, u128, u32)>, + ::core::option::Option< + runtime_types::pallet_treasury::Proposal< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, ::subxt::Error, > { - let entry = Vesting(_0); + let entry = Proposals(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn signing( + pub async fn proposals_iter( &self, - _0: runtime_types::polkadot_runtime_common::claims::EthereumAddress, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::StatementKind, - >, + ::subxt::KeyIter<'a, T, Proposals>, ::subxt::Error, > { - let entry = Signing(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn preclaims( + pub async fn approvals( &self, - _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::claims::EthereumAddress, - >, + runtime_types::frame_support::storage::bounded_vec::BoundedVec, ::subxt::Error, > { - let entry = Preclaims(_0); - self.client.storage().fetch(&entry, hash).await + let entry = Approvals; + self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod vesting { + pub mod contracts { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Vest {} - impl ::subxt::Call for Vest { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct VestedTransfer { - pub target: ::subxt::sp_runtime::MultiAddress< + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Call { + pub dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, - pub schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo, + #[codec(compact)] + pub value: u128, + #[codec(compact)] + pub gas_limit: u64, + pub data: Vec, } - impl ::subxt::Call for VestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vested_transfer"; + impl ::subxt::Call for Call { + const PALLET: &'static str = "Contracts"; + const FUNCTION: &'static str = "call"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstantiateWithCode { + #[codec(compact)] + pub endowment: u128, + #[codec(compact)] + pub gas_limit: u64, + pub code: Vec, + pub data: Vec, + pub salt: Vec, } - impl ::subxt::Call for ForceVestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "force_vested_transfer"; + impl ::subxt::Call for InstantiateWithCode { + const PALLET: &'static str = "Contracts"; + const FUNCTION: &'static str = "instantiate_with_code"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MergeSchedules { - pub schedule1_index: u32, - pub schedule2_index: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Instantiate { + #[codec(compact)] + pub endowment: u128, + #[codec(compact)] + pub gas_limit: u64, + pub code_hash: ::subxt::sp_core::H256, + pub data: Vec, + pub salt: Vec, } - impl ::subxt::Call for MergeSchedules { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "merge_schedules"; + impl ::subxt::Call for Instantiate { + const PALLET: &'static str = "Contracts"; + const FUNCTION: &'static str = "instantiate"; } pub struct TransactionApi< 'a, @@ -6905,114 +6851,171 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn vest(&self) -> ::subxt::SubmittableExtrinsic { - let call = Vest {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vest_other( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = VestOther { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vested_transfer( + pub fn call( &self, - target: ::subxt::sp_runtime::MultiAddress< + dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - u128, u32, >, - ) -> ::subxt::SubmittableExtrinsic { - let call = VestedTransfer { target, schedule }; + value: u128, + gas_limit: u64, + data: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Call { + dest, + value, + gas_limit, + data, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_vested_transfer( + pub fn instantiate_with_code( &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< - u128, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic + endowment: u128, + gas_limit: u64, + code: Vec, + data: Vec, + salt: Vec, + ) -> ::subxt::SubmittableExtrinsic { - let call = ForceVestedTransfer { - source, - target, - schedule, + let call = InstantiateWithCode { + endowment, + gas_limit, + code, + data, + salt, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn merge_schedules( + pub fn instantiate( &self, - schedule1_index: u32, - schedule2_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = MergeSchedules { - schedule1_index, - schedule2_index, + endowment: u128, + gas_limit: u64, + code_hash: ::subxt::sp_core::H256, + data: Vec, + salt: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Instantiate { + endowment, + gas_limit, + code_hash, + data, + salt, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub type Event = runtime_types::pallet_contracts::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct VestingUpdated( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for VestingUpdated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingUpdated"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Instantiated { + pub deployer: ::subxt::sp_core::crypto::AccountId32, + pub contract: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Instantiated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "Instantiated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Terminated { + pub contract: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Terminated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "Terminated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CodeStored { + pub code_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for CodeStored { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "CodeStored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduleUpdated { + pub version: u32, + } + impl ::subxt::Event for ScheduleUpdated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "ScheduleUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ContractEmitted { + pub contract: ::subxt::sp_core::crypto::AccountId32, + pub data: Vec, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct VestingCompleted(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for VestingCompleted { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingCompleted"; + impl ::subxt::Event for ContractEmitted { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "ContractEmitted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CodeRemoved { + pub code_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for CodeRemoved { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "CodeRemoved"; } } pub mod storage { use super::runtime_types; - pub struct Vesting(pub ::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< - u128, - u32, - >, - >; + pub struct PristineCode(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for PristineCode { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "PristineCode"; + type Value = Vec; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Blake2_128Concat, + ::subxt::StorageHasher::Identity, )]) } } - 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; + pub struct CodeStorage(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for CodeStorage { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "CodeStorage"; + type Value = runtime_types::pallet_contracts::wasm::PrefabWasmModule; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct AccountCounter; + impl ::subxt::StorageEntry for AccountCounter { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "AccountCounter"; + type Value = u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ContractInfoOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for ContractInfoOf { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "ContractInfoOf"; + type Value = runtime_types::pallet_contracts::storage::RawContractInfo< + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct DeletionQueue; + impl ::subxt::StorageEntry for DeletionQueue { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "DeletionQueue"; + type Value = + Vec; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -7024,65 +7027,133 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn vesting( + pub async fn pristine_code( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> + { + let entry = PristineCode(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn pristine_code_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, PristineCode>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn code_storage( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_contracts::wasm::PrefabWasmModule, + >, + ::subxt::Error, + > { + let entry = CodeStorage(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn code_storage_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, CodeStorage>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn account_counter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = AccountCounter; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn contract_info_of( &self, _0: ::subxt::sp_core::crypto::AccountId32, 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< - u128, - u32, - >, + runtime_types::pallet_contracts::storage::RawContractInfo< + ::subxt::sp_core::H256, >, >, ::subxt::Error, > { - let entry = Vesting(_0); + let entry = ContractInfoOf(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn storage_version( + pub async fn contract_info_of_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::pallet_vesting::Releases, + ::subxt::KeyIter<'a, T, ContractInfoOf>, ::subxt::Error, > { - let entry = StorageVersion; + self.client.storage().iter(hash).await + } + pub async fn deletion_queue( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = DeletionQueue; self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod utility { + pub mod sudo { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Batch { - pub calls: Vec, - } - impl ::subxt::Call for Batch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AsDerivative { - pub index: u16, - pub call: runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Sudo { + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for Sudo { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "sudo"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SudoUncheckedWeight { + pub call: runtime_types::node_runtime::Call, + pub weight: u64, + } + impl ::subxt::Call for SudoUncheckedWeight { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "sudo_unchecked_weight"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetKey { + pub new: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; + impl ::subxt::Call for SetKey { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "set_key"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BatchAll { - pub calls: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SudoAs { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub call: runtime_types::node_runtime::Call, } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; + impl ::subxt::Call for SudoAs { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "sudo_as"; } pub struct TransactionApi< 'a, @@ -7097,210 +7168,113 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn batch( + pub fn sudo( &self, - calls: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Batch { calls }; + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Sudo { call }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn as_derivative( + pub fn sudo_unchecked_weight( &self, - index: u16, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsDerivative { index, call }; + call: runtime_types::node_runtime::Call, + weight: u64, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SudoUncheckedWeight { call, weight }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn batch_all( + pub fn set_key( &self, - calls: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = BatchAll { calls }; + new: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetKey { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn sudo_as( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = SudoAs { who, call }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::pallet_utility::pallet::Event; + pub type Event = runtime_types::pallet_sudo::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BatchInterrupted( - pub u32, - pub runtime_types::sp_runtime::DispatchError, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Sudid(pub Result<(), runtime_types::sp_runtime::DispatchError>); + impl ::subxt::Event for Sudid { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "Sudid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct KeyChanged(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for KeyChanged { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SudoAsDone( + pub Result<(), runtime_types::sp_runtime::DispatchError>, ); - impl ::subxt::Event for BatchInterrupted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchInterrupted"; + impl ::subxt::Event for SudoAsDone { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "SudoAsDone"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BatchCompleted {} - impl ::subxt::Event for BatchCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "BatchCompleted"; + } + pub mod storage { + use super::runtime_types; + pub struct Key; + impl ::subxt::StorageEntry for Key { + const PALLET: &'static str = "Sudo"; + const STORAGE: &'static str = "Key"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ItemCompleted {} - impl ::subxt::Event for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; + 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 key( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::sp_core::crypto::AccountId32, + ::subxt::Error, + > { + let entry = Key; + self.client.storage().fetch_or_default(&entry, hash).await + } } } } - pub mod identity { + pub mod im_online { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct Heartbeat { + pub heartbeat: runtime_types::pallet_im_online::Heartbeat, + pub signature: + runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetIdentity { - pub info: runtime_types::pallet_identity::types::IdentityInfo, - } - impl ::subxt::Call for SetIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_identity"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetSubs { - pub subs: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ClearIdentity {} - impl ::subxt::Call for ClearIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "clear_identity"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RequestJudgement { - #[codec(compact)] - pub reg_index: u32, - #[codec(compact)] - pub max_fee: u128, - } - impl ::subxt::Call for RequestJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "request_judgement"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelRequest { - pub reg_index: u32, - } - impl ::subxt::Call for CancelRequest { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "cancel_request"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetFee { - #[codec(compact)] - pub index: u32, - #[codec(compact)] - pub fee: u128, - } - impl ::subxt::Call for SetFee { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_fee"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetAccountId { - #[codec(compact)] - pub index: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetFields { - #[codec(compact)] - pub index: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProvideJudgement { - #[codec(compact)] - pub reg_index: u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - pub judgement: runtime_types::pallet_identity::types::Judgement, - } - impl ::subxt::Call for ProvideJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "provide_judgement"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct QuitSub {} - impl ::subxt::Call for QuitSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "quit_sub"; + impl ::subxt::Call for Heartbeat { + const PALLET: &'static str = "ImOnline"; + const FUNCTION: &'static str = "heartbeat"; } pub struct TransactionApi< 'a, @@ -7315,236 +7289,203 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn add_registrar( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddRegistrar { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_identity( + pub fn heartbeat( &self, - info: runtime_types::pallet_identity::types::IdentityInfo, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetIdentity { info }; + heartbeat: runtime_types::pallet_im_online::Heartbeat, + signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, + ) -> ::subxt::SubmittableExtrinsic { + let call = Heartbeat { + heartbeat, + signature, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_subs( - &self, - subs: Vec<( + } + } + pub type Event = runtime_types::pallet_im_online::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct HeartbeatReceived( + pub 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)] + 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)] + pub struct SomeOffline( + pub Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetSubs { subs }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + 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 = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - pub fn clear_identity( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearIdentity {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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 fn request_judgement( - &self, - reg_index: u32, - max_fee: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = RequestJudgement { reg_index, max_fee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub struct ReceivedHeartbeats(u32, 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 fn cancel_request( - &self, - reg_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelRequest { reg_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub struct AuthoredBlocks(u32, ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for AuthoredBlocks { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "AuthoredBlocks"; + type Value = 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 fn set_fee( - &self, - index: u32, - fee: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetFee { index, fee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_account_id( - &self, - index: u32, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetAccountId { index, new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_fields( - &self, - index: u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetFields { index, fields }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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 fn provide_judgement( + pub async fn heartbeat_after( &self, - reg_index: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - judgement: runtime_types::pallet_identity::types::Judgement, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProvideJudgement { - reg_index, - target, - judgement, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = HeartbeatAfter; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn keys (& self , 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 :: Error >{ + let entry = Keys; + self.client.storage().fetch_or_default(&entry, hash).await } - pub fn kill_identity( + pub async fn received_heartbeats( &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), + _0: u32, + _1: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, >, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillIdentity { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + ::subxt::Error, + > { + let entry = ReceivedHeartbeats(_0, _1); + self.client.storage().fetch(&entry, hash).await } - pub fn add_sub( + pub async fn received_heartbeats_iter( &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddSub { sub, data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ReceivedHeartbeats>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } - pub fn rename_sub( + pub async fn authored_blocks( &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - ) -> ::subxt::SubmittableExtrinsic { - let call = RenameSub { sub, data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = AuthoredBlocks(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await } - pub fn remove_sub( + pub async fn authored_blocks_iter( &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveSub { sub }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn quit_sub(&self) -> ::subxt::SubmittableExtrinsic { - let call = QuitSub {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, AuthoredBlocks>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } } } - pub type Event = runtime_types::pallet_identity::pallet::Event; + } + pub mod authority_discovery { + use super::runtime_types; + } + pub mod offences { + use super::runtime_types; + pub type Event = runtime_types::pallet_offences::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct IdentitySet(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for IdentitySet { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentitySet"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct IdentityCleared( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for IdentityCleared { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityCleared"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct IdentityKilled( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for IdentityKilled { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityKilled"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct JudgementRequested( - pub ::subxt::sp_core::crypto::AccountId32, - pub u32, - ); - impl ::subxt::Event for JudgementRequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementRequested"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct JudgementUnrequested( - pub ::subxt::sp_core::crypto::AccountId32, - pub u32, - ); - impl ::subxt::Event for JudgementUnrequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementUnrequested"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct JudgementGiven(pub ::subxt::sp_core::crypto::AccountId32, pub u32); - impl ::subxt::Event for JudgementGiven { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementGiven"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RegistrarAdded(pub u32); - impl ::subxt::Event for RegistrarAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "RegistrarAdded"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SubIdentityAdded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for SubIdentityAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityAdded"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SubIdentityRemoved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for SubIdentityRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRemoved"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SubIdentityRevoked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for SubIdentityRevoked { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRevoked"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Offence(pub [u8; 16usize], pub Vec); + impl ::subxt::Event for Offence { + const PALLET: &'static str = "Offences"; + const EVENT: &'static str = "Offence"; } } pub mod storage { use super::runtime_types; - pub struct IdentityOf(pub ::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; + pub struct Reports(pub ::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, + u128, + >, + ), + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -7552,55 +7493,36 @@ pub mod api { )]) } } - pub struct SuperOf(pub ::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, - ); + pub struct ConcurrentReportsIndex([u8; 16usize], Vec); + impl ::subxt::StorageEntry for ConcurrentReportsIndex { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ConcurrentReportsIndex"; + type Value = 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(pub [u8; 16usize]); + impl ::subxt::StorageEntry for ReportsByKindIndex { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ReportsByKindIndex"; + type Value = Vec; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Blake2_128Concat, + ::subxt::StorageHasher::Twox64Concat, )]) } } - pub struct SubsOf(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SubsOf { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "SubsOf"; - type Value = ( - 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< - Option< - runtime_types::pallet_identity::types::RegistrarInfo< - 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, } @@ -7608,174 +7530,268 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn identity_of( + pub async fn reports( &self, - _0: ::subxt::sp_core::crypto::AccountId32, + _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::pallet_identity::types::Registration, + 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, + u128, + >, + ), + >, >, ::subxt::Error, > { - let entry = IdentityOf(_0); + let entry = Reports(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn super_of( + pub async fn reports_iter( &self, - _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, + ::subxt::KeyIter<'a, T, Reports>, ::subxt::Error, > { - let entry = SuperOf(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn subs_of( + pub async fn concurrent_reports_index( + &self, + _0: [u8; 16usize], + _1: Vec, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = ConcurrentReportsIndex(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn concurrent_reports_index_iter( &self, - _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ( - u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ), + ::subxt::KeyIter<'a, T, ConcurrentReportsIndex>, ::subxt::Error, > { - let entry = SubsOf(_0); + self.client.storage().iter(hash).await + } + pub async fn reports_by_kind_index( + &self, + _0: [u8; 16usize], + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> { + let entry = ReportsByKindIndex(_0); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn registrars( + pub async fn reports_by_kind_index_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - Option< - runtime_types::pallet_identity::types::RegistrarInfo< - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >, + ::subxt::KeyIter<'a, T, ReportsByKindIndex>, ::subxt::Error, > { - let entry = Registrars; + self.client.storage().iter(hash).await + } + } + } + } + pub mod historical { + use super::runtime_types; + } + pub mod randomness_collective_flip { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct RandomMaterial; + impl ::subxt::StorageEntry for RandomMaterial { + const PALLET: &'static str = "RandomnessCollectiveFlip"; + const STORAGE: &'static str = "RandomMaterial"; + type Value = Vec<::subxt::sp_core::H256>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn random_material( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = RandomMaterial; self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod proxy { + pub mod identity { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: Option, - pub call: runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AddRegistrar { + pub account: ::subxt::sp_core::crypto::AccountId32, } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; + impl ::subxt::Call for AddRegistrar { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "add_registrar"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AddProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetIdentity { + pub info: runtime_types::pallet_identity::types::IdentityInfo, } - impl ::subxt::Call for AddProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "add_proxy"; + impl ::subxt::Call for SetIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_identity"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RemoveProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetSubs { + pub subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, } - impl ::subxt::Call for RemoveProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxy"; + impl ::subxt::Call for SetSubs { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_subs"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct ClearIdentity {} + impl ::subxt::Call for ClearIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "clear_identity"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Anonymous { - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub delay: u32, - pub index: u16, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RequestJudgement { + #[codec(compact)] + pub reg_index: u32, + #[codec(compact)] + pub max_fee: u128, } - impl ::subxt::Call for Anonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "anonymous"; + impl ::subxt::Call for RequestJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "request_judgement"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct KillAnonymous { - pub spawner: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::polkadot_runtime::ProxyType, - pub index: u16, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelRequest { + pub reg_index: u32, + } + impl ::subxt::Call for CancelRequest { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "cancel_request"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetFee { #[codec(compact)] - pub height: u32, + pub index: u32, #[codec(compact)] - pub ext_index: u32, + pub fee: u128, } - impl ::subxt::Call for KillAnonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "kill_anonymous"; + impl ::subxt::Call for SetFee { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fee"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Announce { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetAccountId { + #[codec(compact)] + pub index: u32, + pub new: ::subxt::sp_core::crypto::AccountId32, } - impl ::subxt::Call for Announce { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "announce"; + impl ::subxt::Call for SetAccountId { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_account_id"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RemoveAnnouncement { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetFields { + #[codec(compact)] + pub index: u32, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, } - impl ::subxt::Call for RemoveAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_announcement"; + impl ::subxt::Call for SetFields { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "set_fields"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RejectAnnouncement { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub call_hash: ::subxt::sp_core::H256, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub judgement: runtime_types::pallet_identity::types::Judgement, } - impl ::subxt::Call for RejectAnnouncement { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "reject_announcement"; + impl ::subxt::Call for ProvideJudgement { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "provide_judgement"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProxyAnnounced { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: Option, - pub call: runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct KillIdentity { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; + impl ::subxt::Call for KillIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "kill_identity"; } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AddSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + 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)] + pub struct RenameSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + 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)] + pub struct RemoveSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for RemoveSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "remove_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, > { client: &'a ::subxt::Client, } @@ -7786,207 +7802,267 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn proxy( + pub fn add_registrar( &self, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: Option, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Proxy { - real, - force_proxy_type, - call, - }; + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddRegistrar { account }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn add_proxy( + pub fn set_identity( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddProxy { - delegate, - proxy_type, - delay, - }; + info: runtime_types::pallet_identity::types::IdentityInfo, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetIdentity { info }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn remove_proxy( + pub fn set_subs( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxy { - delegate, - proxy_type, - delay, - }; + subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetSubs { subs }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn remove_proxies( + pub fn clear_identity( &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxies {}; + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearIdentity {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn anonymous( + pub fn request_judgement( &self, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: u32, - index: u16, - ) -> ::subxt::SubmittableExtrinsic { - let call = Anonymous { - proxy_type, - delay, - index, - }; + reg_index: u32, + max_fee: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = RequestJudgement { reg_index, max_fee }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn kill_anonymous( + pub fn cancel_request( &self, - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - index: u16, - height: u32, - ext_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillAnonymous { - spawner, - proxy_type, - index, - height, - ext_index, - }; + reg_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelRequest { reg_index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn announce( + pub fn set_fee( &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = Announce { real, call_hash }; + index: u32, + fee: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetFee { index, fee }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn remove_announcement( + pub fn set_account_id( &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RemoveAnnouncement { real, call_hash }; + index: u32, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetAccountId { index, new }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn reject_announcement( + pub fn set_fields( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RejectAnnouncement { - delegate, - call_hash, - }; + index: u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetFields { index, fields }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn proxy_announced( + pub fn provide_judgement( &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: Option, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProxyAnnounced { - delegate, - real, - force_proxy_type, - call, + reg_index: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + judgement: runtime_types::pallet_identity::types::Judgement, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProvideJudgement { + reg_index, + target, + judgement, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } + pub fn kill_identity( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillIdentity { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rename_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic { + let call = RenameSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveSub { sub }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn quit_sub(&self) -> ::subxt::SubmittableExtrinsic { + let call = QuitSub {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } } } - pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub type Event = runtime_types::pallet_identity::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProxyExecuted( - pub 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)] + pub struct IdentitySet(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for IdentitySet { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentitySet"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AnonymousCreated( - pub ::subxt::sp_core::crypto::AccountId32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct IdentityCleared( pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_runtime::ProxyType, - pub u16, + pub u128, ); - impl ::subxt::Event for AnonymousCreated { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "AnonymousCreated"; + impl ::subxt::Event for IdentityCleared { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityCleared"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Announced( - pub ::subxt::sp_core::crypto::AccountId32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct IdentityKilled( pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, + pub u128, ); - impl ::subxt::Event for Announced { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "Announced"; + impl ::subxt::Event for IdentityKilled { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityKilled"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProxyAdded( + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgementRequested( pub ::subxt::sp_core::crypto::AccountId32, + pub u32, + ); + impl ::subxt::Event for JudgementRequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementRequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgementUnrequested( pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_runtime::ProxyType, pub u32, ); - impl ::subxt::Event for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; + impl ::subxt::Event for JudgementUnrequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementUnrequested"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgementGiven(pub ::subxt::sp_core::crypto::AccountId32, pub u32); + impl ::subxt::Event for JudgementGiven { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementGiven"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RegistrarAdded(pub u32); + impl ::subxt::Event for RegistrarAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "RegistrarAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SubIdentityAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for SubIdentityAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityAdded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SubIdentityRemoved( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for SubIdentityRemoved { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRemoved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SubIdentityRevoked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub 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 Proxies(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Proxies { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Proxies"; + pub struct IdentityOf(pub ::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; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct SuperOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuperOf { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SuperOf"; 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, - u32, - >, - >, - u128, + ::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::Twox64Concat, + ::subxt::StorageHasher::Blake2_128Concat, )]) } } - pub struct Announcements(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Announcements { - const PALLET: &'static str = "Proxy"; - const STORAGE: &'static str = "Announcements"; + pub struct SubsOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SubsOf { + const PALLET: &'static str = "Identity"; + const STORAGE: &'static str = "SubsOf"; type Value = ( + u128, runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - u32, - >, + ::subxt::sp_core::crypto::AccountId32, >, - u128, ); fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( @@ -7995,6 +8071,23 @@ pub mod api { )]) } } + 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< + Option< + runtime_types::pallet_identity::types::RegistrarInfo< + 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, } @@ -8002,99 +8095,199 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn proxies( + pub async fn identity_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_identity::types::Registration, + >, + ::subxt::Error, + > { + let entry = IdentityOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn identity_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, IdentityOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn super_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ::subxt::Error, + > { + let entry = SuperOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn super_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuperOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn subs_of( &self, _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< ( + u128, runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::ProxyDefinition< - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - u32, - >, + ::subxt::sp_core::crypto::AccountId32, >, - u128, ), ::subxt::Error, > { - let entry = Proxies(_0); + let entry = SubsOf(_0); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn announcements( + pub async fn subs_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, SubsOf>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn registrars( &self, - _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_proxy::Announcement< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + Option< + runtime_types::pallet_identity::types::RegistrarInfo< + u128, ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - u32, >, >, - u128, - ), + >, ::subxt::Error, > { - let entry = Announcements(_0); + let entry = Registrars; self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod multisig { + pub mod society { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AsMultiThreshold1 { - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub call: runtime_types::polkadot_runtime::Call, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bid { + pub value: u128, } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold1"; + impl ::subxt::Call for Bid { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "bid"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AsMulti { - pub threshold: u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: - Option>, - pub call: Vec, - pub store_call: bool, - pub max_weight: u64, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unbid { + pub pos: u32, } - impl ::subxt::Call for AsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi"; + impl ::subxt::Call for Unbid { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "unbid"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ApproveAsMulti { - pub threshold: u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: - Option>, - pub call_hash: [u8; 32usize], - pub max_weight: u64, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vouch { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub value: u128, + pub tip: u128, } - impl ::subxt::Call for ApproveAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "approve_as_multi"; + impl ::subxt::Call for Vouch { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "vouch"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelAsMulti { - pub threshold: u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub timepoint: runtime_types::pallet_multisig::Timepoint, - pub call_hash: [u8; 32usize], + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unvouch { + pub pos: u32, } - impl ::subxt::Call for CancelAsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "cancel_as_multi"; + impl ::subxt::Call for Unvouch { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "unvouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vote { + pub candidate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub approve: bool, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DefenderVote { + pub approve: bool, + } + impl ::subxt::Call for DefenderVote { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "defender_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Payout {} + impl ::subxt::Call for Payout { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "payout"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Found { + pub founder: ::subxt::sp_core::crypto::AccountId32, + pub max_members: u32, + pub rules: Vec, + } + impl ::subxt::Call for Found { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "found"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unfound {} + impl ::subxt::Call for Unfound { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "unfound"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgeSuspendedMember { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub forgive: bool, + } + impl ::subxt::Call for JudgeSuspendedMember { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "judge_suspended_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgeSuspendedCandidate { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub judgement: runtime_types::pallet_society::Judgement, + } + impl ::subxt::Call for JudgeSuspendedCandidate { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "judge_suspended_candidate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMaxMembers { + pub max: u32, + } + impl ::subxt::Call for SetMaxMembers { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "set_max_members"; } pub struct TransactionApi< 'a, @@ -8109,133 +8302,359 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn as_multi_threshold1( - &self, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - call: runtime_types::polkadot_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMultiThreshold1 { - other_signatories, - call, - }; + pub fn bid(&self, value: u128) -> ::subxt::SubmittableExtrinsic { + let call = Bid { value }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn as_multi( - &self, - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: Option< - runtime_types::pallet_multisig::Timepoint, - >, - call: Vec, - store_call: bool, - max_weight: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call, - store_call, - max_weight, - }; + pub fn unbid(&self, pos: u32) -> ::subxt::SubmittableExtrinsic { + let call = Unbid { pos }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn approve_as_multi( + pub fn vouch( &self, - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: Option< - runtime_types::pallet_multisig::Timepoint, + who: ::subxt::sp_core::crypto::AccountId32, + value: u128, + tip: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vouch { who, value, tip }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unvouch( + &self, + pos: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unvouch { pos }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + candidate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, >, - call_hash: [u8; 32usize], - max_weight: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }; + approve: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { candidate, approve }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn cancel_as_multi( + pub fn defender_vote( &self, - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: runtime_types::pallet_multisig::Timepoint, - call_hash: [u8; 32usize], - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, + approve: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = DefenderVote { approve }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn payout(&self) -> ::subxt::SubmittableExtrinsic { + let call = Payout {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn found( + &self, + founder: ::subxt::sp_core::crypto::AccountId32, + max_members: u32, + rules: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Found { + founder, + max_members, + rules, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } + pub fn unfound(&self) -> ::subxt::SubmittableExtrinsic { + let call = Unfound {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn judge_suspended_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + forgive: bool, + ) -> ::subxt::SubmittableExtrinsic + { + let call = JudgeSuspendedMember { who, forgive }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn judge_suspended_candidate( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + judgement: runtime_types::pallet_society::Judgement, + ) -> ::subxt::SubmittableExtrinsic + { + let call = JudgeSuspendedCandidate { who, judgement }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_members( + &self, + max: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMaxMembers { max }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } } } - pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub type Event = runtime_types::pallet_society::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NewMultisig( + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Founded(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Founded { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Founded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bid(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Bid { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vouch( pub ::subxt::sp_core::crypto::AccountId32, + pub u128, pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], ); - impl ::subxt::Event for NewMultisig { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "NewMultisig"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MultisigApproval( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint, + impl ::subxt::Event for Vouch { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Vouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AutoUnbid(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for AutoUnbid { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "AutoUnbid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unbid(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Unbid { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Unbid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unvouch(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Unvouch { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Unvouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Inducted( pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], + pub Vec<::subxt::sp_core::crypto::AccountId32>, ); - impl ::subxt::Event for MultisigApproval { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigApproval"; + impl ::subxt::Event for Inducted { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Inducted"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MultisigExecuted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SuspendedMemberJudgement( pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], - pub Result<(), runtime_types::sp_runtime::DispatchError>, + pub bool, ); - impl ::subxt::Event for MultisigExecuted { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigExecuted"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MultisigCancelled( + impl ::subxt::Event for SuspendedMemberJudgement { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "SuspendedMemberJudgement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CandidateSuspended(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for CandidateSuspended { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "CandidateSuspended"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MemberSuspended(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for MemberSuspended { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "MemberSuspended"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Challenged(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Challenged { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Challenged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vote( pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint, pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], + pub bool, ); - impl ::subxt::Event for MultisigCancelled { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigCancelled"; + impl ::subxt::Event for Vote { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DefenderVote(pub ::subxt::sp_core::crypto::AccountId32, pub bool); + impl ::subxt::Event for DefenderVote { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "DefenderVote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewMaxMembers(pub u32); + impl ::subxt::Event for NewMaxMembers { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "NewMaxMembers"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unfounded(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Unfounded { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Unfounded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Deposit(pub u128); + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Deposit"; } } pub mod storage { use super::runtime_types; - pub struct Multisigs(::subxt::sp_core::crypto::AccountId32, [u8; 32usize]); - impl ::subxt::StorageEntry for Multisigs { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Multisigs"; - type Value = runtime_types::pallet_multisig::Multisig< - u32, + pub struct Founder; + impl ::subxt::StorageEntry for Founder { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Founder"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Rules; + impl ::subxt::StorageEntry for Rules { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Rules"; + type Value = ::subxt::sp_core::H256; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Candidates; + impl ::subxt::StorageEntry for Candidates { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Candidates"; + type Value = Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SuspendedCandidates(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuspendedCandidates { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "SuspendedCandidates"; + type Value = ( u128, - ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_society::BidKind< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Pot; + impl ::subxt::StorageEntry for Pot { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Pot"; + type Value = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Head; + impl ::subxt::StorageEntry for Head { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Head"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Members"; + type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SuspendedMembers(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuspendedMembers { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "SuspendedMembers"; + type Value = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Bids; + impl ::subxt::StorageEntry for Bids { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Bids"; + type Value = Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Vouching(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Vouching { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Vouching"; + type Value = runtime_types::pallet_society::VouchingStatus; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Payouts(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Payouts { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Payouts"; + type Value = Vec<(u32, u128)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Strikes(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Strikes { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Strikes"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Votes( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for Votes { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Votes"; + type Value = runtime_types::pallet_society::Vote; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![ ::subxt::StorageMapKey::new( @@ -8244,23 +8663,41 @@ pub mod api { ), ::subxt::StorageMapKey::new( &self.1, - ::subxt::StorageHasher::Blake2_128Concat, + ::subxt::StorageHasher::Twox64Concat, ), ]) } } - pub struct Calls(pub [u8; 32usize]); - impl ::subxt::StorageEntry for Calls { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = (Vec, ::subxt::sp_core::crypto::AccountId32, u128); + pub struct Defender; + impl ::subxt::StorageEntry for Defender { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Defender"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DefenderVotes(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for DefenderVotes { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "DefenderVotes"; + type Value = runtime_types::pallet_society::Vote; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Identity, + ::subxt::StorageHasher::Twox64Concat, )]) } } + pub struct MaxMembers; + impl ::subxt::StorageEntry for MaxMembers { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "MaxMembers"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } @@ -8268,138 +8705,318 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn multisigs( + pub async fn founder( &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: [u8; 32usize], hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_multisig::Multisig< - u32, - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { - let entry = Multisigs(_0, _1); + let entry = Founder; self.client.storage().fetch(&entry, hash).await } - pub async fn calls( + pub async fn rules( &self, - _0: [u8; 32usize], hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<( - Vec, - ::subxt::sp_core::crypto::AccountId32, - u128, - )>, + ::core::option::Option<::subxt::sp_core::H256>, ::subxt::Error, > { - let entry = Calls(_0); + let entry = Rules; self.client.storage().fetch(&entry, hash).await } + pub async fn candidates( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Candidates; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn suspended_candidates( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + u128, + runtime_types::pallet_society::BidKind< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + )>, + ::subxt::Error, + > { + let entry = SuspendedCandidates(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn suspended_candidates_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuspendedCandidates>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn pot( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Pot; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn head( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Head; + self.client.storage().fetch(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn suspended_members( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = SuspendedMembers(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn suspended_members_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuspendedMembers>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn bids( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Bids; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn vouching( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = Vouching(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn vouching_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Vouching>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn payouts( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = Payouts(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn payouts_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Payouts>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn strikes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = Strikes(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn strikes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Strikes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn votes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = Votes(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn votes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Votes>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn defender( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Defender; + self.client.storage().fetch(&entry, hash).await + } + pub async fn defender_votes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = DefenderVotes(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn defender_votes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, DefenderVotes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn max_members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = MaxMembers; + self.client.storage().fetch_or_default(&entry, hash).await + } } - } - } - pub mod bounties { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProposeBounty { - #[codec(compact)] - pub value: u128, - pub description: Vec, - } - impl ::subxt::Call for ProposeBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_bounty"; + } + } + pub mod recovery { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsRecovered { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub call: runtime_types::node_runtime::Call, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ApproveBounty { - #[codec(compact)] - pub bounty_id: u32, + impl ::subxt::Call for AsRecovered { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "as_recovered"; } - impl ::subxt::Call for ApproveBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "approve_bounty"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetRecovered { + pub lost: ::subxt::sp_core::crypto::AccountId32, + pub rescuer: ::subxt::sp_core::crypto::AccountId32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProposeCurator { - #[codec(compact)] - pub bounty_id: u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - pub fee: u128, + impl ::subxt::Call for SetRecovered { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "set_recovered"; } - impl ::subxt::Call for ProposeCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_curator"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CreateRecovery { + pub friends: Vec<::subxt::sp_core::crypto::AccountId32>, + pub threshold: u16, + pub delay_period: u32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct UnassignCurator { - #[codec(compact)] - pub bounty_id: u32, + impl ::subxt::Call for CreateRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "create_recovery"; } - impl ::subxt::Call for UnassignCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "unassign_curator"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InitiateRecovery { + pub account: ::subxt::sp_core::crypto::AccountId32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AcceptCurator { - #[codec(compact)] - pub bounty_id: u32, + impl ::subxt::Call for InitiateRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "initiate_recovery"; } - impl ::subxt::Call for AcceptCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "accept_curator"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VouchRecovery { + pub lost: ::subxt::sp_core::crypto::AccountId32, + pub rescuer: ::subxt::sp_core::crypto::AccountId32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AwardBounty { - #[codec(compact)] - pub bounty_id: u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, + impl ::subxt::Call for VouchRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "vouch_recovery"; } - impl ::subxt::Call for AwardBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "award_bounty"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClaimRecovery { + pub account: ::subxt::sp_core::crypto::AccountId32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ClaimBounty { - #[codec(compact)] - pub bounty_id: u32, + impl ::subxt::Call for ClaimRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "claim_recovery"; } - impl ::subxt::Call for ClaimBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "claim_bounty"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CloseRecovery { + pub rescuer: ::subxt::sp_core::crypto::AccountId32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CloseBounty { - #[codec(compact)] - pub bounty_id: u32, + impl ::subxt::Call for CloseRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "close_recovery"; } - impl ::subxt::Call for CloseBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "close_bounty"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveRecovery {} + impl ::subxt::Call for RemoveRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "remove_recovery"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ExtendBountyExpiry { - #[codec(compact)] - pub bounty_id: u32, - pub remark: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelRecovered { + pub account: ::subxt::sp_core::crypto::AccountId32, } - impl ::subxt::Call for ExtendBountyExpiry { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "extend_bounty_expiry"; + impl ::subxt::Call for CancelRecovered { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "cancel_recovered"; } pub struct TransactionApi< 'a, @@ -8414,159 +9031,142 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn propose_bounty( + pub fn as_recovered( &self, - value: u128, - description: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeBounty { value, description }; + account: ::subxt::sp_core::crypto::AccountId32, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsRecovered { account, call }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn approve_bounty( + pub fn set_recovered( &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveBounty { bounty_id }; + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetRecovered { lost, rescuer }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn propose_curator( + pub fn create_recovery( &self, - bounty_id: u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - fee: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeCurator { - bounty_id, - curator, - fee, - }; + friends: Vec<::subxt::sp_core::crypto::AccountId32>, + threshold: u16, + delay_period: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CreateRecovery { + friends, + threshold, + delay_period, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn unassign_curator( + pub fn initiate_recovery( &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = UnassignCurator { bounty_id }; + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = InitiateRecovery { account }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn accept_curator( + pub fn vouch_recovery( &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AcceptCurator { bounty_id }; + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = VouchRecovery { lost, rescuer }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn award_bounty( + pub fn claim_recovery( &self, - bounty_id: u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = AwardBounty { - bounty_id, - beneficiary, - }; + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClaimRecovery { account }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn claim_bounty( + pub fn close_recovery( &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClaimBounty { bounty_id }; + rescuer: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseRecovery { rescuer }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn close_bounty( + pub fn remove_recovery( &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseBounty { bounty_id }; + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveRecovery {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn extend_bounty_expiry( + pub fn cancel_recovered( &self, - bounty_id: u32, - remark: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExtendBountyExpiry { bounty_id, remark }; + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelRecovered { account }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::pallet_bounties::pallet::Event; + pub type Event = runtime_types::pallet_recovery::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyProposed(pub u32); - impl ::subxt::Event for BountyProposed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyProposed"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyRejected(pub u32, pub u128); - impl ::subxt::Event for BountyRejected { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyRejected"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyBecameActive(pub u32); - impl ::subxt::Event for BountyBecameActive { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyBecameActive"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryCreated(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for RecoveryCreated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryInitiated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for RecoveryInitiated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryInitiated"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyAwarded(pub u32, pub ::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)] + pub struct RecoveryVouched( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for RecoveryVouched { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryVouched"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyClaimed( - pub u32, - pub u128, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryClosed( + pub ::subxt::sp_core::crypto::AccountId32, pub ::subxt::sp_core::crypto::AccountId32, ); - impl ::subxt::Event for BountyClaimed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyClaimed"; + impl ::subxt::Event for RecoveryClosed { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryClosed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyCanceled(pub u32); - impl ::subxt::Event for BountyCanceled { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyCanceled"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AccountRecovered( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for AccountRecovered { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "AccountRecovered"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BountyExtended(pub u32); - impl ::subxt::Event for BountyExtended { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyExtended"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryRemoved(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for RecoveryRemoved { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryRemoved"; } } 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bounties(pub 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, - u128, + pub struct Recoverable(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Recoverable { + const PALLET: &'static str = "Recovery"; + const STORAGE: &'static str = "Recoverable"; + type Value = runtime_types::pallet_recovery::RecoveryConfig< u32, + u128, + ::subxt::sp_core::crypto::AccountId32, >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( @@ -8575,25 +9175,41 @@ pub mod api { )]) } } - pub struct BountyDescriptions(pub u32); - impl ::subxt::StorageEntry for BountyDescriptions { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyDescriptions"; - type Value = Vec; + pub struct ActiveRecoveries( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ActiveRecoveries { + const PALLET: &'static str = "Recovery"; + const STORAGE: &'static str = "ActiveRecoveries"; + type Value = runtime_types::pallet_recovery::ActiveRecovery< + u32, + u128, + ::subxt::sp_core::crypto::AccountId32, + >; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) } } - pub struct BountyApprovals; - impl ::subxt::StorageEntry for BountyApprovals { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyApprovals"; - type Value = Vec; + pub struct Proxy(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Proxy { + const PALLET: &'static str = "Recovery"; + const STORAGE: &'static str = "Proxy"; + type Value = ::subxt::sp_core::crypto::AccountId32; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) } } pub struct StorageApi<'a, T: ::subxt::Config> { @@ -8603,106 +9219,139 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn bounty_count( + pub async fn recoverable( &self, + _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = BountyCount; - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_recovery::RecoveryConfig< + u32, + u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Recoverable(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn bounties( + pub async fn recoverable_iter( &self, - _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Recoverable>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn active_recoveries( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::pallet_bounties::Bounty< - ::subxt::sp_core::crypto::AccountId32, - u128, + runtime_types::pallet_recovery::ActiveRecovery< u32, + u128, + ::subxt::sp_core::crypto::AccountId32, >, >, ::subxt::Error, > { - let entry = Bounties(_0); + let entry = ActiveRecoveries(_0, _1); self.client.storage().fetch(&entry, hash).await } - pub async fn bounty_descriptions( + pub async fn active_recoveries_iter( &self, - _0: u32, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> - { - let entry = BountyDescriptions(_0); + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ActiveRecoveries>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn proxy( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Proxy(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn bounty_approvals( + pub async fn proxy_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> { - let entry = BountyApprovals; - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Proxy>, ::subxt::Error> + { + self.client.storage().iter(hash).await } } } } - pub mod tips { + pub mod vesting { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReportAwesome { - pub reason: Vec, - pub who: ::subxt::sp_core::crypto::AccountId32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vest {} + impl ::subxt::Call for Vest { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest"; } - impl ::subxt::Call for ReportAwesome { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "report_awesome"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestOther { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RetractTip { - pub hash: ::subxt::sp_core::H256, + impl ::subxt::Call for VestOther { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest_other"; } - impl ::subxt::Call for RetractTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "retract_tip"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestedTransfer { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct TipNew { - pub reason: Vec, - pub who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - pub tip_value: u128, + impl ::subxt::Call for VestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vested_transfer"; } - impl ::subxt::Call for TipNew { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip_new"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceVestedTransfer { + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Tip { - pub hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub tip_value: u128, + impl ::subxt::Call for ForceVestedTransfer { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "force_vested_transfer"; } - impl ::subxt::Call for Tip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MergeSchedules { + pub schedule1_index: u32, + pub schedule2_index: u32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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"; + impl ::subxt::Call for MergeSchedules { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "merge_schedules"; } pub struct TransactionApi< 'a, @@ -8717,129 +9366,116 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn report_awesome( - &self, - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReportAwesome { reason, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn retract_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = RetractTip { hash }; + pub fn vest(&self) -> ::subxt::SubmittableExtrinsic { + let call = Vest {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn tip_new( + pub fn vest_other( &self, - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - tip_value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = TipNew { - reason, - who, - tip_value, - }; + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = VestOther { target }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn tip( + pub fn vested_transfer( &self, - hash: ::subxt::sp_core::H256, - tip_value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Tip { hash, tip_value }; + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = VestedTransfer { target, schedule }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn close_tip( + pub fn force_vested_transfer( &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseTip { hash }; + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceVestedTransfer { + source, + target, + schedule, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn slash_tip( + pub fn merge_schedules( &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = SlashTip { hash }; + schedule1_index: u32, + schedule2_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = MergeSchedules { + schedule1_index, + schedule2_index, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::pallet_tips::pallet::Event; + pub type Event = runtime_types::pallet_vesting::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NewTip(pub ::subxt::sp_core::H256); - impl ::subxt::Event for NewTip { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "NewTip"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct TipClosing(pub ::subxt::sp_core::H256); - impl ::subxt::Event for TipClosing { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosing"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct TipClosed( - pub ::subxt::sp_core::H256, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestingUpdated( pub ::subxt::sp_core::crypto::AccountId32, pub u128, ); - impl ::subxt::Event for TipClosed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosed"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct TipRetracted(pub ::subxt::sp_core::H256); - impl ::subxt::Event for TipRetracted { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipRetracted"; + impl ::subxt::Event for VestingUpdated { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingUpdated"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct TipSlashed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for TipSlashed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipSlashed"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestingCompleted(pub ::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 Tips(pub ::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, - u128, - u32, - ::subxt::sp_core::H256, - >; + pub struct Vesting(pub ::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< + u128, + u32, + >, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Twox64Concat, + ::subxt::StorageHasher::Blake2_128Concat, )]) } } - pub struct Reasons(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reasons { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Reasons"; - type Value = Vec; + 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::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) + ::subxt::StorageEntryKey::Plain } } pub struct StorageApi<'a, T: ::subxt::Config> { @@ -8849,78 +9485,112 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn tips( + pub async fn vesting( &self, - _0: ::subxt::sp_core::H256, + _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::pallet_tips::OpenTip< - ::subxt::sp_core::crypto::AccountId32, - u128, - u32, - ::subxt::sp_core::H256, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, + >, >, >, ::subxt::Error, > { - let entry = Tips(_0); + let entry = Vesting(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn reasons( + pub async fn vesting_iter( &self, - _0: ::subxt::sp_core::H256, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> - { - let entry = Reasons(_0); - self.client.storage().fetch(&entry, hash).await + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Vesting>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_vesting::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod election_provider_multi_phase { + pub mod scheduler { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SubmitUnsigned { pub raw_solution : 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMinimumUntrustedScore { - pub maybe_next_score: Option<[u128; 3usize]>, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Schedule { + pub when: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::node_runtime::Call, } - impl ::subxt::Call for SetMinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_minimum_untrusted_score"; + impl ::subxt::Call for Schedule { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetEmergencyElectionResult { - pub supports: Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Cancel { + pub when: u32, + pub index: u32, } - impl ::subxt::Call for SetEmergencyElectionResult { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_emergency_election_result"; + impl ::subxt::Call for Cancel { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Submit { - pub raw_solution: - runtime_types::pallet_election_provider_multi_phase::RawSolution< - runtime_types::polkadot_runtime::NposCompactSolution16, - >, - pub num_signed_submissions: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduleNamed { + pub id: Vec, + pub when: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::node_runtime::Call, } - impl ::subxt::Call for Submit { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit"; + impl ::subxt::Call for ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelNamed { + pub id: Vec, + } + impl ::subxt::Call for CancelNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "cancel_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduleAfter { + pub after: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_after"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduleNamedAfter { + pub id: Vec, + pub after: u32, + pub maybe_periodic: Option<(u32, u32)>, + pub priority: u8, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named_after"; } pub struct TransactionApi< 'a, @@ -8935,611 +9605,330 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn submit_unsigned( + pub fn schedule( &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, - ) -> ::subxt::SubmittableExtrinsic { - let call = SubmitUnsigned { - raw_solution, - witness, + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Schedule { + when, + maybe_periodic, + priority, + call, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_minimum_untrusted_score( + pub fn cancel( &self, - maybe_next_score: Option<[u128; 3usize]>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMinimumUntrustedScore { maybe_next_score }; + when: u32, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Cancel { when, index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_emergency_election_result( + pub fn schedule_named( &self, - supports: Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetEmergencyElectionResult { supports }; + id: Vec, + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn submit( + pub fn cancel_named( &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, - num_signed_submissions: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Submit { - raw_solution, - num_signed_submissions, + id: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelNamed { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_after( + &self, + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ScheduleAfter { + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named_after( + &self, + id: Vec, + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = - runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub type Event = runtime_types::pallet_scheduler::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SolutionStored( - pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - pub bool, - ); - impl ::subxt::Event for SolutionStored { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SolutionStored"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ElectionFinalized( - pub 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Rewarded { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Rewarded"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Slashed"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Scheduled(pub u32, pub u32); + impl ::subxt::Event for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SignedPhaseStarted(pub u32); - impl ::subxt::Event for SignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SignedPhaseStarted"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Canceled(pub u32, pub u32); + impl ::subxt::Event for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct UnsignedPhaseStarted(pub u32); - impl ::subxt::Event for UnsignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "UnsignedPhaseStarted"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Dispatched( + pub (u32, u32), + pub Option>, + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; } } 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 = 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; + pub struct Agenda(pub u32); + impl ::subxt::StorageEntry for Agenda { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Agenda"; + type Value = Vec< + Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::node_runtime::Call, + u32, + runtime_types::node_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) } } - 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, - >; + pub struct Lookup(pub Vec); + impl ::subxt::StorageEntry for Lookup { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Lookup"; + type Value = (u32, u32); fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) } } - 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< - ::subxt::sp_core::crypto::AccountId32, - >; + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_scheduler::Releases; 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, } - 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 + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } } - } - pub struct SignedSubmissionNextIndex; - impl ::subxt::StorageEntry for SignedSubmissionNextIndex { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionNextIndex"; - type Value = 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 < [u128 ; 3usize] , u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionsMap(pub 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 , 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 = [u128; 3usize]; - 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 round( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Round; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_phase( + pub async fn agenda( &self, + _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::pallet_election_provider_multi_phase::Phase, + Vec< + Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::node_runtime::Call, + u32, + runtime_types::node_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >, ::subxt::Error, > { - let entry = CurrentPhase; + let entry = Agenda(_0); self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn queued_solution (& self , 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 :: Error >{ - let entry = QueuedSolution; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: Error >{ - let entry = Snapshot; - self.client.storage().fetch(&entry, hash).await } - pub async fn desired_targets( + pub async fn agenda_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Agenda>, ::subxt::Error> { - let entry = DesiredTargets; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: Error >{ - let entry = SnapshotMetadata; + self.client.storage().iter(hash).await + } + pub async fn lookup( + &self, + _0: Vec, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<(u32, u32)>, + ::subxt::Error, + > { + let entry = Lookup(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn signed_submission_next_index( + pub async fn lookup_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = SignedSubmissionNextIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [u128 ; 3usize] , u32 > , :: subxt :: Error >{ - let entry = SignedSubmissionIndices; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submissions_map (& self , _0 : u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > , :: subxt :: Error >{ - let entry = SignedSubmissionsMap(_0); - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Lookup>, ::subxt::Error> + { + self.client.storage().iter(hash).await } - pub async fn minimum_untrusted_score( + pub async fn storage_version( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<[u128; 3usize]>, + runtime_types::pallet_scheduler::Releases, ::subxt::Error, > { - let entry = MinimumUntrustedScore; - self.client.storage().fetch(&entry, hash).await + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod parachains_origin { - use super::runtime_types; - } - pub mod configuration { + pub mod proxy { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetValidationUpgradeFrequency { - pub new: u32, - } - impl ::subxt::Call for SetValidationUpgradeFrequency { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_frequency"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetValidationUpgradeDelay { - pub new: u32, - } - impl ::subxt::Call for SetValidationUpgradeDelay { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_validation_upgrade_delay"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetCodeRetentionPeriod { - pub new: u32, - } - impl ::subxt::Call for SetCodeRetentionPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_code_retention_period"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxCodeSize { - pub new: u32, - } - impl ::subxt::Call for SetMaxCodeSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_code_size"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxPovSize { - pub new: u32, - } - impl ::subxt::Call for SetMaxPovSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_pov_size"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxHeadDataSize { - pub new: u32, - } - impl ::subxt::Call for SetMaxHeadDataSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_head_data_size"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetParathreadCores { - pub new: u32, - } - impl ::subxt::Call for SetParathreadCores { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_cores"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetParathreadRetries { - pub new: u32, - } - impl ::subxt::Call for SetParathreadRetries { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_parathread_retries"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetGroupRotationFrequency { - pub new: u32, - } - impl ::subxt::Call for SetGroupRotationFrequency { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_group_rotation_frequency"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetChainAvailabilityPeriod { - pub new: u32, - } - impl ::subxt::Call for SetChainAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_chain_availability_period"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetThreadAvailabilityPeriod { - pub new: u32, - } - impl ::subxt::Call for SetThreadAvailabilityPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_thread_availability_period"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetSchedulingLookahead { - pub new: u32, - } - impl ::subxt::Call for SetSchedulingLookahead { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_scheduling_lookahead"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxValidatorsPerCore { - pub new: Option, - } - impl ::subxt::Call for SetMaxValidatorsPerCore { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators_per_core"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxValidators { - pub new: Option, - } - impl ::subxt::Call for SetMaxValidators { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_validators"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetDisputePeriod { - pub new: u32, - } - impl ::subxt::Call for SetDisputePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_period"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetDisputePostConclusionAcceptancePeriod { - pub new: u32, - } - impl ::subxt::Call for SetDisputePostConclusionAcceptancePeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_dispute_post_conclusion_acceptance_period"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetDisputeMaxSpamSlots { - pub new: u32, - } - impl ::subxt::Call for SetDisputeMaxSpamSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_dispute_max_spam_slots"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetDisputeConclusionByTimeOutPeriod { - pub new: u32, - } - impl ::subxt::Call for SetDisputeConclusionByTimeOutPeriod { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_dispute_conclusion_by_time_out_period"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetNoShowSlots { - pub new: u32, - } - impl ::subxt::Call for SetNoShowSlots { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_no_show_slots"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetNDelayTranches { - pub new: u32, - } - impl ::subxt::Call for SetNDelayTranches { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_n_delay_tranches"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetZerothDelayTrancheWidth { - pub new: u32, - } - impl ::subxt::Call for SetZerothDelayTrancheWidth { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_zeroth_delay_tranche_width"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetNeededApprovals { - pub new: u32, - } - impl ::subxt::Call for SetNeededApprovals { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_needed_approvals"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetRelayVrfModuloSamples { - pub new: u32, - } - impl ::subxt::Call for SetRelayVrfModuloSamples { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_relay_vrf_modulo_samples"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxUpwardQueueCount { - pub new: u32, - } - impl ::subxt::Call for SetMaxUpwardQueueCount { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_count"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxUpwardQueueSize { - pub new: u32, - } - impl ::subxt::Call for SetMaxUpwardQueueSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_queue_size"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxDownwardMessageSize { - pub new: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proxy { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: Option, + pub call: runtime_types::node_runtime::Call, } - impl ::subxt::Call for SetMaxDownwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_downward_message_size"; + impl ::subxt::Call for Proxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetUmpServiceTotalWeight { - pub new: u64, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AddProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::node_runtime::ProxyType, + pub delay: u32, } - impl ::subxt::Call for SetUmpServiceTotalWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_service_total_weight"; + impl ::subxt::Call for AddProxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "add_proxy"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxUpwardMessageSize { - pub new: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::node_runtime::ProxyType, + pub delay: u32, } - impl ::subxt::Call for SetMaxUpwardMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_max_upward_message_size"; + impl ::subxt::Call for RemoveProxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxy"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetMaxUpwardMessageNumPerCandidate { - pub new: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveProxies {} + impl ::subxt::Call for RemoveProxies { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_proxies"; } - 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)] + pub struct Anonymous { + pub proxy_type: runtime_types::node_runtime::ProxyType, + pub delay: u32, + pub index: u16, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpOpenRequestTtl { - pub new: u32, + impl ::subxt::Call for Anonymous { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "anonymous"; } - 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)] + pub struct KillAnonymous { + pub spawner: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::node_runtime::ProxyType, + pub index: u16, + #[codec(compact)] + pub height: u32, + #[codec(compact)] + pub ext_index: u32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpSenderDeposit { - pub new: u128, + impl ::subxt::Call for KillAnonymous { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "kill_anonymous"; } - 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)] + pub struct Announce { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpRecipientDeposit { - pub new: u128, + impl ::subxt::Call for Announce { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "announce"; } - 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)] + pub struct RemoveAnnouncement { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpChannelMaxCapacity { - pub new: u32, + impl ::subxt::Call for RemoveAnnouncement { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "remove_announcement"; } - 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)] + pub struct RejectAnnouncement { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub call_hash: ::subxt::sp_core::H256, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpChannelMaxTotalSize { - pub new: u32, + impl ::subxt::Call for RejectAnnouncement { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "reject_announcement"; } - 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)] + pub struct ProxyAnnounced { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: Option, + pub call: runtime_types::node_runtime::Call, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpMaxParachainInboundChannels { - pub new: u32, + impl ::subxt::Call for ProxyAnnounced { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy_announced"; } - impl ::subxt::Call for SetHrmpMaxParachainInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_inbound_channels"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpMaxParathreadInboundChannels { - pub new: u32, - } - impl ::subxt::Call for SetHrmpMaxParathreadInboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parathread_inbound_channels"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpChannelMaxMessageSize { - pub new: u32, - } - impl ::subxt::Call for SetHrmpChannelMaxMessageSize { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_channel_max_message_size"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpMaxParachainOutboundChannels { - pub new: u32, - } - impl ::subxt::Call for SetHrmpMaxParachainOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_parachain_outbound_channels"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpMaxParathreadOutboundChannels { - pub new: u32, - } - impl ::subxt::Call for SetHrmpMaxParathreadOutboundChannels { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = - "set_hrmp_max_parathread_outbound_channels"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetHrmpMaxMessageNumPerCandidate { - pub new: u32, - } - impl ::subxt::Call for SetHrmpMaxMessageNumPerCandidate { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_hrmp_max_message_num_per_candidate"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SetUmpMaxIndividualWeight { - pub new: u64, - } - impl ::subxt::Call for SetUmpMaxIndividualWeight { - const PALLET: &'static str = "Configuration"; - const FUNCTION: &'static str = "set_ump_max_individual_weight"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, } impl<'a, T: ::subxt::Config> TransactionApi<'a, T> where @@ -9548,461 +9937,336 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn set_validation_upgrade_frequency( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetValidationUpgradeFrequency { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_validation_upgrade_delay( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetValidationUpgradeDelay { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_code_retention_period( + pub fn proxy( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetCodeRetentionPeriod { new }; + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: Option, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Proxy { + real, + force_proxy_type, + call, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_max_code_size( + pub fn add_proxy( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMaxCodeSize { new }; + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddProxy { + delegate, + proxy_type, + delay, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_max_pov_size( + pub fn remove_proxy( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMaxPovSize { new }; + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveProxy { + delegate, + proxy_type, + delay, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_max_head_data_size( + pub fn remove_proxies( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxHeadDataSize { new }; + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveProxies {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_parathread_cores( + pub fn anonymous( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetParathreadCores { new }; + proxy_type: runtime_types::node_runtime::ProxyType, + delay: u32, + index: u16, + ) -> ::subxt::SubmittableExtrinsic { + let call = Anonymous { + proxy_type, + delay, + index, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_parathread_retries( + pub fn kill_anonymous( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetParathreadRetries { new }; + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + index: u16, + height: u32, + ext_index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillAnonymous { + spawner, + proxy_type, + index, + height, + ext_index, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_group_rotation_frequency( + pub fn announce( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetGroupRotationFrequency { new }; + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = Announce { real, call_hash }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_chain_availability_period( + pub fn remove_announcement( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { - let call = SetChainAvailabilityPeriod { new }; + let call = RemoveAnnouncement { real, call_hash }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_thread_availability_period( + pub fn reject_announcement( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { - let call = SetThreadAvailabilityPeriod { new }; + let call = RejectAnnouncement { + delegate, + call_hash, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_scheduling_lookahead( + pub fn proxy_announced( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetSchedulingLookahead { new }; + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: Option, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProxyAnnounced { + delegate, + real, + force_proxy_type, + call, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_max_validators_per_core( - &self, - new: Option, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxValidatorsPerCore { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProxyExecuted( + pub 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)] + pub struct AnonymousCreated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::node_runtime::ProxyType, + pub u16, + ); + impl ::subxt::Event for AnonymousCreated { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "AnonymousCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Announced( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct ProxyAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::node_runtime::ProxyType, + pub u32, + ); + impl ::subxt::Event for ProxyAdded { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyAdded"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proxies(pub ::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::node_runtime::ProxyType, + u32, + >, + >, + u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) } - pub fn set_max_validators( - &self, - new: Option, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMaxValidators { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub struct Announcements(pub ::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, + u32, + >, + >, + u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) } - pub fn set_dispute_period( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetDisputePeriod { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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 fn set_dispute_post_conclusion_acceptance_period( + pub async fn proxies( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic< - T, - SetDisputePostConclusionAcceptancePeriod, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::node_runtime::ProxyType, + u32, + >, + >, + u128, + ), + ::subxt::Error, > { - let call = SetDisputePostConclusionAcceptancePeriod { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_dispute_max_spam_slots( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetDisputeMaxSpamSlots { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + let entry = Proxies(_0); + self.client.storage().fetch_or_default(&entry, hash).await } - pub fn set_dispute_conclusion_by_time_out_period( + pub async fn proxies_iter( &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetDisputeConclusionByTimeOutPeriod { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Proxies>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } - pub fn set_no_show_slots( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetNoShowSlots { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_n_delay_tranches( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetNDelayTranches { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_zeroth_delay_tranche_width( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetZerothDelayTrancheWidth { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_needed_approvals( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetNeededApprovals { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_relay_vrf_modulo_samples( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetRelayVrfModuloSamples { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_upward_queue_count( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxUpwardQueueCount { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_upward_queue_size( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxUpwardQueueSize { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_downward_message_size( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxDownwardMessageSize { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_ump_service_total_weight( - &self, - new: u64, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetUmpServiceTotalWeight { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_upward_message_size( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxUpwardMessageSize { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_upward_message_num_per_candidate( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMaxUpwardMessageNumPerCandidate { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_open_request_ttl( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpOpenRequestTtl { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_sender_deposit( - &self, - new: u128, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpSenderDeposit { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_recipient_deposit( - &self, - new: u128, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpRecipientDeposit { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_channel_max_capacity( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpChannelMaxCapacity { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_channel_max_total_size( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpChannelMaxTotalSize { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_max_parachain_inbound_channels( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpMaxParachainInboundChannels { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_max_parathread_inbound_channels( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpMaxParathreadInboundChannels { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_channel_max_message_size( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpChannelMaxMessageSize { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_max_parachain_outbound_channels( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpMaxParachainOutboundChannels { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_max_parathread_outbound_channels( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpMaxParathreadOutboundChannels { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_hrmp_max_message_num_per_candidate( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetHrmpMaxMessageNumPerCandidate { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_ump_max_individual_weight( - &self, - new: u64, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetUmpMaxIndividualWeight { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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 < u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct PendingConfig(pub u32); - impl ::subxt::StorageEntry for PendingConfig { - const PALLET: &'static str = "Configuration"; - const STORAGE: &'static str = "PendingConfig"; - type Value = runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } pub async fn active_config (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < u32 > , :: subxt :: Error >{ - let entry = ActiveConfig; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn pending_config (& self , _0 : u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: configuration :: HostConfiguration < u32 > > , :: subxt :: Error >{ - let entry = PendingConfig(_0); - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod paras_shared { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - } - } - 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 = 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 = Vec; - 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 = - Vec; - 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 current_session_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CurrentSessionIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn active_validator_indices( + pub async fn announcements( &self, + _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ( + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_proxy::Announcement< + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + u32, + >, + >, + u128, + ), ::subxt::Error, > { - let entry = ActiveValidatorIndices; + let entry = Announcements(_0); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn active_validator_keys( + pub async fn announcements_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::subxt::KeyIter<'a, T, Announcements>, ::subxt::Error, > { - let entry = ActiveValidatorKeys; - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().iter(hash).await } } } } - pub mod para_inclusion { + pub mod multisig { use super::runtime_types; pub mod calls { use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsMultiThreshold1 { + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for AsMultiThreshold1 { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi_threshold1"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsMulti { + pub threshold: u16, + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub maybe_timepoint: + Option>, + pub call: runtime_types::frame_support::traits::misc::WrapperKeepOpaque< + runtime_types::node_runtime::Call, + >, + pub store_call: bool, + pub max_weight: u64, + } + impl ::subxt::Call for AsMulti { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveAsMulti { + pub threshold: u16, + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub maybe_timepoint: + Option>, + pub call_hash: [u8; 32usize], + pub max_weight: 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)] + pub struct CancelAsMulti { + pub threshold: u16, + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub timepoint: runtime_types::pallet_multisig::Timepoint, + pub call_hash: [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 + ::subxt::ExtrinsicExtraData, @@ -10016,258 +10280,164 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - } - } - pub type Event = - runtime_types::polkadot_runtime_parachains::inclusion::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CandidateBacked( - pub runtime_types::polkadot_primitives::v1::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v1::CoreIndex, - pub runtime_types::polkadot_primitives::v1::GroupIndex, - ); - impl ::subxt::Event for CandidateBacked { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateBacked"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CandidateIncluded( - pub runtime_types::polkadot_primitives::v1::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v1::CoreIndex, - pub runtime_types::polkadot_primitives::v1::GroupIndex, - ); - impl ::subxt::Event for CandidateIncluded { - const PALLET: &'static str = "ParaInclusion"; - const EVENT: &'static str = "CandidateIncluded"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CandidateTimedOut( - pub runtime_types::polkadot_primitives::v1::CandidateReceipt< - ::subxt::sp_core::H256, - >, - pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v1::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( - pub runtime_types::polkadot_primitives::v0::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 < u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailability( - pub 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 , u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PendingAvailabilityCommitments( - pub 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::v1::CandidateCommitments; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } pub async fn availability_bitfields (& self , _0 : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < u32 > > , :: subxt :: Error >{ - let entry = AvailabilityBitfields(_0); - self.client.storage().fetch(&entry, hash).await - } pub async fn pending_availability (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: CandidatePendingAvailability < :: subxt :: sp_core :: H256 , u32 > > , :: subxt :: Error >{ - let entry = PendingAvailability(_0); - self.client.storage().fetch(&entry, hash).await + pub fn as_multi_threshold1( + &self, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsMultiThreshold1 { + other_signatories, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub async fn pending_availability_commitments( + pub fn as_multi( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v1::CandidateCommitments, + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: Option< + runtime_types::pallet_multisig::Timepoint, >, - ::subxt::Error, - > { - let entry = PendingAvailabilityCommitments(_0); - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod para_inherent { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Enter { - pub data: runtime_types::polkadot_primitives::v1::InherentData< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, + call: runtime_types::frame_support::traits::misc::WrapperKeepOpaque< + runtime_types::node_runtime::Call, >, - >, - } - impl ::subxt::Call for Enter { - const PALLET: &'static str = "ParaInherent"; - const FUNCTION: &'static str = "enter"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } + store_call: bool, + max_weight: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call, + store_call, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn enter( + pub fn approve_as_multi( &self, - data: runtime_types::polkadot_primitives::v1::InherentData< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: Option< + runtime_types::pallet_multisig::Timepoint, >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Enter { data }; + call_hash: [u8; 32usize], + max_weight: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - } - 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 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 included( + pub fn cancel_as_multi( &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> - { - let entry = Included; - self.client.storage().fetch(&entry, hash).await + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint, + call_hash: [u8; 32usize], + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - } - pub mod para_scheduler { - use super::runtime_types; - pub mod storage { + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { use super::runtime_types; - pub struct ValidatorGroups; - impl ::subxt::StorageEntry for ValidatorGroups { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ValidatorGroups"; - type Value = - Vec>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewMultisig( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + ); + impl ::subxt::Event for NewMultisig { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "NewMultisig"; } - 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 - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MultisigApproval( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + ); + impl ::subxt::Event for MultisigApproval { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigApproval"; } - pub struct AvailabilityCores; - impl ::subxt::StorageEntry for AvailabilityCores { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "AvailabilityCores"; - type Value = - Vec>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MultisigExecuted( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + pub Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for MultisigExecuted { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigExecuted"; } - pub struct ParathreadClaimIndex; - impl ::subxt::StorageEntry for ParathreadClaimIndex { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "ParathreadClaimIndex"; - type Value = Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MultisigCancelled( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint, + pub ::subxt::sp_core::crypto::AccountId32, + pub [u8; 32usize], + ); + impl ::subxt::Event for MultisigCancelled { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigCancelled"; } - pub struct SessionStartBlock; - impl ::subxt::StorageEntry for SessionStartBlock { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "SessionStartBlock"; - type Value = u32; + } + pub mod storage { + use super::runtime_types; + pub struct Multisigs(::subxt::sp_core::crypto::AccountId32, [u8; 32usize]); + impl ::subxt::StorageEntry for Multisigs { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Multisigs"; + type Value = runtime_types::pallet_multisig::Multisig< + u32, + u128, + ::subxt::sp_core::crypto::AccountId32, + >; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) } } - pub struct Scheduled; - impl ::subxt::StorageEntry for Scheduled { - const PALLET: &'static str = "ParaScheduler"; - const STORAGE: &'static str = "Scheduled"; - type Value = Vec< - runtime_types::polkadot_runtime_parachains::scheduler::CoreAssignment, - >; + pub struct Calls(pub [u8; 32usize]); + impl ::subxt::StorageEntry for Calls { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Calls"; + type Value = ( + runtime_types::frame_support::traits::misc::WrapperKeepOpaque< + runtime_types::node_runtime::Call, + >, + ::subxt::sp_core::crypto::AccountId32, + u128, + ); fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) } } pub struct StorageApi<'a, T: ::subxt::Config> { @@ -10277,102 +10447,156 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn validator_groups( + pub async fn multisigs( &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: [u8; 32usize], hash: ::core::option::Option, ) -> ::core::result::Result< - Vec>, + ::core::option::Option< + runtime_types::pallet_multisig::Multisig< + u32, + u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, ::subxt::Error, > { - let entry = ValidatorGroups; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn parathread_queue (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: polkadot_runtime_parachains :: scheduler :: ParathreadClaimQueue , :: subxt :: Error >{ - let entry = ParathreadQueue; - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Multisigs(_0, _1); + self.client.storage().fetch(&entry, hash).await } - pub async fn availability_cores( + pub async fn multisigs_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec>, + ::subxt::KeyIter<'a, T, Multisigs>, ::subxt::Error, > { - let entry = AvailabilityCores; - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn parathread_claim_index( + pub async fn calls( &self, + _0: [u8; 32usize], hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = ParathreadClaimIndex; - self.client.storage().fetch_or_default(&entry, hash).await + ::core::option::Option<( + runtime_types::frame_support::traits::misc::WrapperKeepOpaque< + runtime_types::node_runtime::Call, + >, + ::subxt::sp_core::crypto::AccountId32, + u128, + )>, + ::subxt::Error, + > { + let entry = Calls(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn session_start_block( + pub async fn calls_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = SessionStartBlock; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn scheduled (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: CoreAssignment > , :: subxt :: Error >{ - let entry = Scheduled; - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Calls>, ::subxt::Error> + { + self.client.storage().iter(hash).await } } } } - pub mod paras { + pub mod bounties { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceScheduleCodeUpgrade { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub new_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - pub relay_parent_number: u32, - } - impl ::subxt::Call for ForceScheduleCodeUpgrade { - const PALLET: &'static str = "Paras"; - const FUNCTION: &'static str = "force_schedule_code_upgrade"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct ProposeBounty { + #[codec(compact)] + pub value: u128, + pub description: Vec, + } + impl ::subxt::Call for ProposeBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveBounty { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for ApproveBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "approve_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub fee: u128, + } + impl ::subxt::Call for ProposeCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "propose_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct UnassignCurator { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for UnassignCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "unassign_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AcceptCurator { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for AcceptCurator { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "accept_curator"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for AwardBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "award_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClaimBounty { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for ClaimBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "claim_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CloseBounty { + #[codec(compact)] + pub bounty_id: u32, + } + impl ::subxt::Call for CloseBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "close_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: u32, + pub remark: Vec, + } + impl ::subxt::Call for ExtendBountyExpiry { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "extend_bounty_expiry"; } pub struct TransactionApi< 'a, @@ -10387,119 +10611,160 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn force_set_current_code( + pub fn propose_bounty( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceSetCurrentCode { para, new_code }; + value: u128, + description: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeBounty { value, description }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_set_current_head( + pub fn approve_bounty( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceSetCurrentHead { para, new_head }; + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveBounty { bounty_id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_schedule_code_upgrade( + pub fn propose_curator( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - relay_parent_number: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceScheduleCodeUpgrade { - para, - new_code, - relay_parent_number, + bounty_id: u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + fee: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeCurator { + bounty_id, + curator, + fee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unassign_curator( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = UnassignCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn accept_curator( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AcceptCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn award_bounty( + &self, + bounty_id: u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = AwardBounty { + bounty_id, + beneficiary, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_note_new_head( + pub fn claim_bounty( + &self, + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClaimBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_bounty( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - new_head: runtime_types::polkadot_parachain::primitives::HeadData, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNoteNewHead { para, new_head }; + bounty_id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseBounty { bounty_id }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_queue_action( + pub fn extend_bounty_expiry( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceQueueAction { para }; + bounty_id: u32, + remark: Vec, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExtendBountyExpiry { bounty_id, remark }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::polkadot_runtime_parachains::paras::pallet::Event; + pub type Event = runtime_types::pallet_bounties::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct BountyProposed(pub u32); + impl ::subxt::Event for BountyProposed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyProposed"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct BountyRejected(pub u32, pub u128); + impl ::subxt::Event for BountyRejected { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyRejected"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct BountyBecameActive(pub u32); + impl ::subxt::Event for BountyBecameActive { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyBecameActive"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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)] + pub struct BountyAwarded(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for BountyAwarded { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyAwarded"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ActionQueued( - pub runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BountyClaimed( pub u32, + pub u128, + pub ::subxt::sp_core::crypto::AccountId32, ); - impl ::subxt::Event for ActionQueued { - const PALLET: &'static str = "Paras"; - const EVENT: &'static str = "ActionQueued"; + impl ::subxt::Event for BountyClaimed { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyClaimed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BountyCanceled(pub u32); + impl ::subxt::Event for BountyCanceled { + const PALLET: &'static str = "Bounties"; + const EVENT: &'static str = "BountyCanceled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BountyExtended(pub 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 Parachains; - impl ::subxt::StorageEntry for Parachains { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "Parachains"; - type Value = Vec; + pub struct BountyCount; + impl ::subxt::StorageEntry for BountyCount { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyCount"; + type Value = u32; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } } - pub struct ParaLifecycles( - pub 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; + pub struct Bounties(pub 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, + u128, + u32, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -10507,11 +10772,11 @@ pub mod api { )]) } } - pub struct Heads(pub 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; + pub struct BountyDescriptions(pub u32); + impl ::subxt::StorageEntry for BountyDescriptions { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyDescriptions"; + type Value = Vec; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -10519,407 +10784,140 @@ pub mod api { )]) } } - pub struct CurrentCodeHash( - pub 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; + pub struct BountyApprovals; + impl ::subxt::StorageEntry for BountyApprovals { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyApprovals"; + type Value = Vec; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) + ::subxt::StorageEntryKey::Plain } } - pub struct PastCodeHash( - runtime_types::polkadot_parachain::primitives::Id, - 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, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct PastCodeMeta( - pub 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< - 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 = - Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct FutureCodeUpgrades( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for FutureCodeUpgrades { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "FutureCodeUpgrades"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct FutureCodeHash( - pub 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( - pub 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::v1::UpgradeGoAhead; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpgradeRestrictionSignal( - pub 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::v1::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 = - Vec<(runtime_types::polkadot_parachain::primitives::Id, 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 = - Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ActionsQueue(pub u32); - impl ::subxt::StorageEntry for ActionsQueue { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "ActionsQueue"; - type Value = Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct UpcomingParasGenesis( - pub 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( - pub runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - ); - impl ::subxt::StorageEntry for CodeByHashRefs { - const PALLET: &'static str = "Paras"; - const STORAGE: &'static str = "CodeByHashRefs"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct CodeByHash( - pub 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, + 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 parachains( + pub async fn bounty_count( &self, hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = Parachains; + ) -> ::core::result::Result { + let entry = BountyCount; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn para_lifecycles( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::paras::ParaLifecycle, - >, - ::subxt::Error, - > { - let entry = ParaLifecycles(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn heads( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::HeadData, - >, - ::subxt::Error, - > { - let entry = Heads(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_code_hash( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::Error, - > { - let entry = CurrentCodeHash(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn past_code_hash( + pub async fn bounties( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - _1: u32, + _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + runtime_types::pallet_bounties::Bounty< + ::subxt::sp_core::crypto::AccountId32, + u128, + u32, + >, >, ::subxt::Error, > { - let entry = PastCodeHash(_0, _1); + let entry = Bounties(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn past_code_meta( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::polkadot_runtime_parachains::paras::ParaPastCodeMeta< - u32, - >, - ::subxt::Error, - > { - let entry = PastCodeMeta(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn past_code_pruning( + pub async fn bounties_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>, + ::subxt::KeyIter<'a, T, Bounties>, ::subxt::Error, > { - let entry = PastCodePruning; - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn future_code_upgrades( + pub async fn bounty_descriptions( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, + _0: u32, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> { - let entry = FutureCodeUpgrades(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn future_code_hash( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - >, - ::subxt::Error, - > { - let entry = FutureCodeHash(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn upgrade_go_ahead_signal( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v1::UpgradeGoAhead, - >, - ::subxt::Error, - > { - let entry = UpgradeGoAheadSignal(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn upgrade_restriction_signal( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v1::UpgradeRestriction, - >, - ::subxt::Error, - > { - let entry = UpgradeRestrictionSignal(_0); + let entry = BountyDescriptions(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn upgrade_cooldowns( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>, - ::subxt::Error, - > { - let entry = UpgradeCooldowns; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn upcoming_upgrades( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<(runtime_types::polkadot_parachain::primitives::Id, u32)>, - ::subxt::Error, - > { - let entry = UpcomingUpgrades; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn actions_queue( + pub async fn bounty_descriptions_iter( &self, - _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::subxt::KeyIter<'a, T, BountyDescriptions>, ::subxt::Error, > { - let entry = ActionsQueue(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn upcoming_paras_genesis (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: Id , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: paras :: ParaGenesisArgs > , :: subxt :: Error >{ - let entry = UpcomingParasGenesis(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn code_by_hash_refs( + pub async fn bounty_approvals( &self, - _0: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CodeByHashRefs(_0); + ) -> ::core::result::Result, ::subxt::Error> { + let entry = BountyApprovals; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn code_by_hash( - &self, - _0: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::ValidationCode, - >, - ::subxt::Error, - > { - let entry = CodeByHash(_0); - self.client.storage().fetch(&entry, hash).await - } } } } - pub mod initializer { + pub mod tips { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceApprove { - pub up_to: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportAwesome { + pub reason: Vec, + 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)] + 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)] + pub struct TipNew { + pub reason: Vec, + pub who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + pub tip_value: u128, } - impl ::subxt::Call for ForceApprove { - const PALLET: &'static str = "Initializer"; - const FUNCTION: &'static str = "force_approve"; + impl ::subxt::Call for TipNew { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip_new"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Tip { + pub hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub tip_value: u128, + } + impl ::subxt::Call for Tip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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, @@ -10934,85 +10932,111 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn force_approve( + pub fn report_awesome( &self, - up_to: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceApprove { up_to }; + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReportAwesome { reason, who }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - } - 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 fn retract_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = RetractTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - pub struct BufferedSessionChanges; - impl ::subxt::StorageEntry for BufferedSessionChanges { - const PALLET: &'static str = "Initializer"; - const STORAGE: &'static str = "BufferedSessionChanges"; - type Value = Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + pub fn tip_new( + &self, + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + tip_value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = TipNew { + reason, + who, + tip_value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - 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 fn tip( + &self, + hash: ::subxt::sp_core::H256, + tip_value: u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Tip { hash, tip_value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub async fn has_initialized( + pub fn close_tip( &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> - { - let entry = HasInitialized; - self.client.storage().fetch(&entry, hash).await - } pub async fn buffered_session_changes (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < Vec < runtime_types :: polkadot_runtime_parachains :: initializer :: BufferedSessionChange > , :: subxt :: Error >{ - let entry = BufferedSessionChanges; - self.client.storage().fetch_or_default(&entry, hash).await + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn slash_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = SlashTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - } - pub mod dmp { - use super::runtime_types; - pub mod calls { + pub type Event = runtime_types::pallet_tips::pallet::Event; + pub mod events { use super::runtime_types; - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewTip(pub ::subxt::sp_core::H256); + impl ::subxt::Event for NewTip { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "NewTip"; } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TipClosing(pub ::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)] + pub struct TipClosed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for TipClosed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TipRetracted(pub ::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)] + pub struct TipSlashed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub 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 DownwardMessageQueues( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for DownwardMessageQueues { - const PALLET: &'static str = "Dmp"; - const STORAGE: &'static str = "DownwardMessageQueues"; - type Value = Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage, + pub struct Tips(pub ::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, + u128, + u32, + ::subxt::sp_core::H256, >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( @@ -11021,17 +11045,15 @@ pub mod api { )]) } } - pub struct DownwardMessageQueueHeads( - pub 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; + pub struct Reasons(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reasons { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Reasons"; + type Value = Vec; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Twox64Concat, + ::subxt::StorageHasher::Identity, )]) } } @@ -11042,328 +11064,388 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn downward_message_queues( + pub async fn tips( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, + _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< - runtime_types::polkadot_core_primitives::InboundDownwardMessage< + ::core::option::Option< + runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + u128, u32, + ::subxt::sp_core::H256, >, >, ::subxt::Error, > { - let entry = DownwardMessageQueues(_0); - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Tips(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn downward_message_queue_heads( + pub async fn tips_iter( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Tips>, ::subxt::Error> { - let entry = DownwardMessageQueueHeads(_0); - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().iter(hash).await + } + pub async fn reasons( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> + { + let entry = Reasons(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn reasons_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Reasons>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } } } } - pub mod ump { + pub mod assets { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ServiceOverweight { - pub index: u64, - pub weight_limit: u64, - } - impl ::subxt::Call for ServiceOverweight { - const PALLET: &'static str = "Ump"; - const FUNCTION: &'static str = "service_overweight"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Create { + #[codec(compact)] + pub id: u32, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub min_balance: u64, } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn service_overweight( - &self, - index: u64, - weight_limit: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ServiceOverweight { - index, - weight_limit, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } + impl ::subxt::Call for Create { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "create"; } - } - pub type Event = runtime_types::polkadot_runtime_parachains::ump::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct InvalidFormat(pub [u8; 32usize]); - impl ::subxt::Event for InvalidFormat { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "InvalidFormat"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct UnsupportedVersion(pub [u8; 32usize]); - impl ::subxt::Event for UnsupportedVersion { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "UnsupportedVersion"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ExecutedUpward( - pub [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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct WeightExhausted(pub [u8; 32usize], pub u64, pub u64); - impl ::subxt::Event for WeightExhausted { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "WeightExhausted"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct UpwardMessagesReceived( - pub runtime_types::polkadot_parachain::primitives::Id, - pub u32, - pub u32, - ); - impl ::subxt::Event for UpwardMessagesReceived { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "UpwardMessagesReceived"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreate { + #[codec(compact)] + pub id: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub is_sufficient: bool, + #[codec(compact)] + pub min_balance: u64, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct OverweightEnqueued( - pub runtime_types::polkadot_parachain::primitives::Id, - pub [u8; 32usize], - pub u64, - pub u64, - ); - impl ::subxt::Event for OverweightEnqueued { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "OverweightEnqueued"; + impl ::subxt::Call for ForceCreate { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_create"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct OverweightServiced(pub u64, pub u64); - impl ::subxt::Event for OverweightServiced { - const PALLET: &'static str = "Ump"; - const EVENT: &'static str = "OverweightServiced"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroy { + #[codec(compact)] + pub id: u32, + pub witness: runtime_types::pallet_assets::types::DestroyWitness, } - } - pub mod storage { - use super::runtime_types; - pub struct RelayDispatchQueues( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueues { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueues"; - type Value = Vec>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + impl ::subxt::Call for Destroy { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "destroy"; } - pub struct RelayDispatchQueueSize( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for RelayDispatchQueueSize { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "RelayDispatchQueueSize"; - type Value = (u32, u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Mint { + #[codec(compact)] + pub id: u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, } - pub struct NeedsDispatch; - impl ::subxt::StorageEntry for NeedsDispatch { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "NeedsDispatch"; - type Value = Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + impl ::subxt::Call for Mint { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "mint"; } - 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 - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burn { + #[codec(compact)] + pub id: u32, + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, } - pub struct Overweight(pub u64); - impl ::subxt::StorageEntry for Overweight { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "Overweight"; - type Value = (runtime_types::polkadot_parachain::primitives::Id, Vec); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + impl ::subxt::Call for Burn { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "burn"; } - pub struct OverweightCount; - impl ::subxt::StorageEntry for OverweightCount { - const PALLET: &'static str = "Ump"; - const STORAGE: &'static str = "OverweightCount"; - type Value = u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transfer { + #[codec(compact)] + pub id: u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer"; } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn relay_dispatch_queues( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result>, ::subxt::Error> - { - let entry = RelayDispatchQueues(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn relay_dispatch_queue_size( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result<(u32, u32), ::subxt::Error> { - let entry = RelayDispatchQueueSize(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn needs_dispatch( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = NeedsDispatch; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn next_dispatch_round_start_with( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_parachain::primitives::Id, - >, - ::subxt::Error, - > { - let entry = NextDispatchRoundStartWith; - self.client.storage().fetch(&entry, hash).await - } - pub async fn overweight( - &self, - _0: u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::polkadot_parachain::primitives::Id, - Vec, - )>, - ::subxt::Error, - > { - let entry = Overweight(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn overweight_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = OverweightCount; - self.client.storage().fetch_or_default(&entry, hash).await - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferKeepAlive { + #[codec(compact)] + pub id: u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, } - } - } - pub mod hrmp { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct HrmpInitOpenChannel { - pub recipient: runtime_types::polkadot_parachain::primitives::Id, - pub proposed_max_capacity: u32, - pub proposed_max_message_size: u32, - } - impl ::subxt::Call for HrmpInitOpenChannel { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_init_open_channel"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceCleanHrmp { - pub para: runtime_types::polkadot_parachain::primitives::Id, - } - impl ::subxt::Call for ForceCleanHrmp { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_clean_hrmp"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceProcessHrmpOpen {} - impl ::subxt::Call for ForceProcessHrmpOpen { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_open"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceProcessHrmpClose {} - impl ::subxt::Call for ForceProcessHrmpClose { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "force_process_hrmp_close"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct HrmpCancelOpenRequest { - pub channel_id: - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - } - impl ::subxt::Call for HrmpCancelOpenRequest { - const PALLET: &'static str = "Hrmp"; - const FUNCTION: &'static str = "hrmp_cancel_open_request"; + impl ::subxt::Call for TransferKeepAlive { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer_keep_alive"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceTransfer { + #[codec(compact)] + pub id: u32, + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, + } + impl ::subxt::Call for ForceTransfer { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Freeze { + #[codec(compact)] + pub id: u32, + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for Freeze { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "freeze"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thaw { + #[codec(compact)] + pub id: u32, + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for Thaw { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "thaw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct FreezeAsset { + #[codec(compact)] + pub id: u32, + } + impl ::subxt::Call for FreezeAsset { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "freeze_asset"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ThawAsset { + #[codec(compact)] + pub id: u32, + } + impl ::subxt::Call for ThawAsset { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "thaw_asset"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferOwnership { + #[codec(compact)] + pub id: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for TransferOwnership { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer_ownership"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetTeam { + #[codec(compact)] + pub id: u32, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for SetTeam { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "set_team"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMetadata { + #[codec(compact)] + pub id: u32, + pub name: Vec, + pub symbol: Vec, + pub decimals: u8, + } + impl ::subxt::Call for SetMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "set_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearMetadata { + #[codec(compact)] + pub id: u32, + } + impl ::subxt::Call for ClearMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "clear_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceSetMetadata { + #[codec(compact)] + pub id: u32, + pub name: Vec, + pub symbol: Vec, + pub decimals: u8, + pub is_frozen: bool, + } + impl ::subxt::Call for ForceSetMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_set_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceClearMetadata { + #[codec(compact)] + pub id: u32, + } + impl ::subxt::Call for ForceClearMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_clear_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceAssetStatus { + #[codec(compact)] + pub id: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub min_balance: u64, + pub is_sufficient: bool, + pub is_frozen: bool, + } + impl ::subxt::Call for ForceAssetStatus { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_asset_status"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveTransfer { + #[codec(compact)] + pub id: u32, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, + } + impl ::subxt::Call for ApproveTransfer { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "approve_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelApproval { + #[codec(compact)] + pub id: u32, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for CancelApproval { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "cancel_approval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCancelApproval { + #[codec(compact)] + pub id: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for ForceCancelApproval { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_cancel_approval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferApproved { + #[codec(compact)] + pub id: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub destination: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + pub amount: u64, + } + impl ::subxt::Call for TransferApproved { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer_approved"; } pub struct TransactionApi< 'a, @@ -11378,270 +11460,567 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn hrmp_init_open_channel( + pub fn create( &self, - recipient: runtime_types::polkadot_parachain::primitives::Id, - proposed_max_capacity: u32, - proposed_max_message_size: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = HrmpInitOpenChannel { - recipient, - proposed_max_capacity, - proposed_max_message_size, + id: u32, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + min_balance: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Create { + id, + admin, + min_balance, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn hrmp_accept_open_channel( + pub fn force_create( &self, - sender: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic - { - let call = HrmpAcceptOpenChannel { sender }; + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + is_sufficient: bool, + min_balance: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceCreate { + id, + owner, + is_sufficient, + min_balance, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn hrmp_close_channel( + pub fn destroy( &self, - channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - ) -> ::subxt::SubmittableExtrinsic { - let call = HrmpCloseChannel { channel_id }; + id: u32, + witness: runtime_types::pallet_assets::types::DestroyWitness, + ) -> ::subxt::SubmittableExtrinsic { + let call = Destroy { id, witness }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_clean_hrmp( + pub fn mint( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceCleanHrmp { para }; + id: u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Mint { + id, + beneficiary, + amount, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_process_hrmp_open( + pub fn burn( &self, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceProcessHrmpOpen {}; + id: u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Burn { id, who, amount }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_process_hrmp_close( + pub fn transfer( &self, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceProcessHrmpClose {}; + id: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { id, target, amount }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn hrmp_cancel_open_request( + pub fn transfer_keep_alive( &self, - channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, - ) -> ::subxt::SubmittableExtrinsic - { - let call = HrmpCancelOpenRequest { channel_id }; + id: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferKeepAlive { id, target, amount }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - } - pub type Event = runtime_types::polkadot_runtime_parachains::hrmp::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct OpenChannelRequested( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_parachain::primitives::Id, - pub u32, - pub u32, - ); - impl ::subxt::Event for OpenChannelRequested { - const PALLET: &'static str = "Hrmp"; - const EVENT: &'static str = "OpenChannelRequested"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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( - pub 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 fn force_transfer( + &self, + id: u32, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceTransfer { + id, + source, + dest, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - pub struct HrmpOpenChannelRequestsList; - impl ::subxt::StorageEntry for HrmpOpenChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestsList"; - type Value = - Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + pub fn freeze( + &self, + id: u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Freeze { id, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw( + &self, + id: u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Thaw { id, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze_asset( + &self, + id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FreezeAsset { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw_asset( + &self, + id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ThawAsset { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_ownership( + &self, + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferOwnership { id, owner }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_team( + &self, + id: u32, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetTeam { + id, + issuer, + admin, + freezer, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_metadata( + &self, + id: u32, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMetadata { + id, + name, + symbol, + decimals, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_metadata( + &self, + id: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearMetadata { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_set_metadata( + &self, + id: u32, + name: Vec, + symbol: Vec, + decimals: u8, + is_frozen: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceSetMetadata { + id, + name, + symbol, + decimals, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_clear_metadata( + &self, + id: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceClearMetadata { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_asset_status( + &self, + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + min_balance: u64, + is_sufficient: bool, + is_frozen: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceAssetStatus { + id, + owner, + issuer, + admin, + freezer, + min_balance, + is_sufficient, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_transfer( + &self, + id: u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveTransfer { + id, + delegate, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_approval( + &self, + id: u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelApproval { id, delegate }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_cancel_approval( + &self, + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceCancelApproval { + id, + owner, + delegate, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_approved( + &self, + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + destination: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferApproved { + id, + owner, + destination, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } } - pub struct HrmpOpenChannelRequestCount( - pub runtime_types::polkadot_parachain::primitives::Id, + } + pub type Event = runtime_types::pallet_assets::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Created( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, ); - impl ::subxt::StorageEntry for HrmpOpenChannelRequestCount { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpOpenChannelRequestCount"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + impl ::subxt::Event for Created { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Created"; } - pub struct HrmpAcceptedChannelRequestCount( - pub runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Issued( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u64, ); - impl ::subxt::StorageEntry for HrmpAcceptedChannelRequestCount { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpAcceptedChannelRequestCount"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + impl ::subxt::Event for Issued { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Issued"; } - pub struct HrmpCloseChannelRequests( - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transferred( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u64, ); - 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, - )]) - } + impl ::subxt::Event for Transferred { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Transferred"; } - pub struct HrmpCloseChannelRequestsList; - impl ::subxt::StorageEntry for HrmpCloseChannelRequestsList { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpCloseChannelRequestsList"; - type Value = - Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burned( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u64, + ); + impl ::subxt::Event for Burned { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Burned"; } - pub struct HrmpWatermarks( - pub runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TeamChanged( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, ); - impl ::subxt::StorageEntry for HrmpWatermarks { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpWatermarks"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + impl ::subxt::Event for TeamChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "TeamChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OwnerChanged(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for OwnerChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "OwnerChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Frozen(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Frozen { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Frozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thawed(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Thawed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Thawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetFrozen(pub u32); + impl ::subxt::Event for AssetFrozen { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetFrozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetThawed(pub u32); + impl ::subxt::Event for AssetThawed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetThawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroyed(pub u32); + impl ::subxt::Event for Destroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Destroyed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreated(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for ForceCreated { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ForceCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataSet(pub u32, pub Vec, pub Vec, pub u8, pub bool); + impl ::subxt::Event for MetadataSet { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataCleared(pub u32); + impl ::subxt::Event for MetadataCleared { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "MetadataCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovedTransfer( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u64, + ); + impl ::subxt::Event for ApprovedTransfer { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovedTransfer"; } - pub struct HrmpChannels( - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovalCancelled( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, ); - 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, - )]) - } + impl ::subxt::Event for ApprovalCancelled { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovalCancelled"; } - pub struct HrmpIngressChannelsIndex( - pub runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferredApproved( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u64, ); - impl ::subxt::StorageEntry for HrmpIngressChannelsIndex { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpIngressChannelsIndex"; - type Value = Vec; + impl ::subxt::Event for TransferredApproved { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "TransferredApproved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetStatusChanged(pub u32); + impl ::subxt::Event for AssetStatusChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetStatusChanged"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Asset(pub u32); + impl ::subxt::StorageEntry for Asset { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Asset"; + type Value = runtime_types::pallet_assets::types::AssetDetails< + u64, + ::subxt::sp_core::crypto::AccountId32, + u128, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Twox64Concat, + ::subxt::StorageHasher::Blake2_128Concat, )]) } } - pub struct HrmpEgressChannelsIndex( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpEgressChannelsIndex { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpEgressChannelsIndex"; - type Value = Vec; + pub struct Account(u32, ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Account { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Account"; + type Value = runtime_types::pallet_assets::types::AssetBalance; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) } } - pub struct HrmpChannelContents( - pub runtime_types::polkadot_parachain::primitives::HrmpChannelId, + pub struct Approvals( + u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, ); - impl ::subxt::StorageEntry for HrmpChannelContents { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelContents"; - type Value = - Vec>; + impl ::subxt::StorageEntry for Approvals { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Approvals"; + type Value = runtime_types::pallet_assets::types::Approval; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.2, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) } } - pub struct HrmpChannelDigests( - pub runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for HrmpChannelDigests { - const PALLET: &'static str = "Hrmp"; - const STORAGE: &'static str = "HrmpChannelDigests"; - type Value = - Vec<(u32, Vec)>; + pub struct Metadata(pub u32); + impl ::subxt::StorageEntry for Metadata { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Metadata"; + type Value = runtime_types::pallet_assets::types::AssetMetadata< + u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Twox64Concat, + ::subxt::StorageHasher::Blake2_128Concat, )]) } } @@ -11651,152 +12030,131 @@ pub mod api { impl<'a, T: ::subxt::Config> StorageApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } - } pub async fn hrmp_open_channel_requests (& self , _0 : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: hrmp :: HrmpOpenChannelRequest > , :: subxt :: Error >{ - let entry = HrmpOpenChannelRequests(_0); - self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_open_channel_requests_list( + pub async fn asset( &self, + _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::core::option::Option< + runtime_types::pallet_assets::types::AssetDetails< + u64, + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, ::subxt::Error, > { - let entry = HrmpOpenChannelRequestsList; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn hrmp_open_channel_request_count( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = HrmpOpenChannelRequestCount(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn hrmp_accepted_channel_request_count( - &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = HrmpAcceptedChannelRequestCount(_0); - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Asset(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_close_channel_requests( + pub async fn asset_iter( &self, - _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> { - let entry = HrmpCloseChannelRequests(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn hrmp_close_channel_requests_list( + pub async fn account( &self, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + runtime_types::pallet_assets::types::AssetBalance, ::subxt::Error, > { - let entry = HrmpCloseChannelRequestsList; + let entry = Account(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_watermarks( + pub async fn account_iter( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = HrmpWatermarks(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn hrmp_channels( - &self, - _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, - >, + ::subxt::KeyIter<'a, T, Account>, ::subxt::Error, > { - let entry = HrmpChannels(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn hrmp_ingress_channels_index( + pub async fn approvals( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, + _0: u32, + _1: ::subxt::sp_core::crypto::AccountId32, + _2: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::core::option::Option< + runtime_types::pallet_assets::types::Approval, + >, ::subxt::Error, > { - let entry = HrmpIngressChannelsIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Approvals(_0, _1, _2); + self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_egress_channels_index( + pub async fn approvals_iter( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::subxt::KeyIter<'a, T, Approvals>, ::subxt::Error, > { - let entry = HrmpEgressChannelsIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn hrmp_channel_contents( + pub async fn metadata( &self, - _0: runtime_types::polkadot_parachain::primitives::HrmpChannelId, + _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec>, + runtime_types::pallet_assets::types::AssetMetadata< + u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + >, ::subxt::Error, > { - let entry = HrmpChannelContents(_0); + let entry = Metadata(_0); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_channel_digests( + pub async fn metadata_iter( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(u32, Vec)>, + ::subxt::KeyIter<'a, T, Metadata>, ::subxt::Error, > { - let entry = HrmpChannelDigests(_0); - self.client.storage().fetch_or_default(&entry, hash).await + self.client.storage().iter(hash).await } } } } - pub mod para_session_info { + pub mod mmr { use super::runtime_types; pub mod storage { use super::runtime_types; - pub struct AssignmentKeysUnsafe; - impl ::subxt::StorageEntry for AssignmentKeysUnsafe { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "AssignmentKeysUnsafe"; - type Value = - Vec; + pub struct RootHash; + impl ::subxt::StorageEntry for RootHash { + const PALLET: &'static str = "Mmr"; + const STORAGE: &'static str = "RootHash"; + type Value = ::subxt::sp_core::H256; 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 = u32; + pub struct NumberOfLeaves; + impl ::subxt::StorageEntry for NumberOfLeaves { + const PALLET: &'static str = "Mmr"; + const STORAGE: &'static str = "NumberOfLeaves"; + type Value = u64; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } } - pub struct Sessions(pub u32); - impl ::subxt::StorageEntry for Sessions { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "Sessions"; - type Value = runtime_types::polkadot_primitives::v1::SessionInfo; + pub struct Nodes(pub u64); + impl ::subxt::StorageEntry for Nodes { + const PALLET: &'static str = "Mmr"; + const STORAGE: &'static str = "Nodes"; + type Value = ::subxt::sp_core::H256; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -11811,97 +12169,78 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn assignment_keys_unsafe( + pub async fn root_hash( &self, hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = AssignmentKeysUnsafe; + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = RootHash; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn earliest_stored_session( + pub async fn number_of_leaves( &self, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = EarliestStoredSession; + ) -> ::core::result::Result { + let entry = NumberOfLeaves; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn sessions( + pub async fn nodes( &self, - _0: u32, + _0: u64, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v1::SessionInfo, - >, + ::core::option::Option<::subxt::sp_core::H256>, ::subxt::Error, > { - let entry = Sessions(_0); + let entry = Nodes(_0); self.client.storage().fetch(&entry, hash).await } + pub async fn nodes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Nodes>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } } } } - pub mod registrar { + pub mod lottery { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceRegister { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub deposit: 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Reserve {} - impl ::subxt::Call for Reserve { - const PALLET: &'static str = "Registrar"; - const FUNCTION: &'static str = "reserve"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BuyTicket { + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for BuyTicket { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "buy_ticket"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetCalls { + pub calls: Vec, + } + impl ::subxt::Call for SetCalls { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "set_calls"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct StartLottery { + pub price: u128, + pub length: u32, + pub delay: u32, + pub repeat: bool, + } + impl ::subxt::Call for StartLottery { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "start_lottery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct StopRepeat {} + impl ::subxt::Call for StopRepeat { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "stop_repeat"; } pub struct TransactionApi< 'a, @@ -11916,102 +12255,99 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = Register { - id, - genesis_head, - validation_code, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_register( + pub fn buy_ticket( &self, - who: ::subxt::sp_core::crypto::AccountId32, - deposit: u128, - id: runtime_types::polkadot_parachain::primitives::Id, - genesis_head: runtime_types::polkadot_parachain::primitives::HeadData, - validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceRegister { - who, - deposit, - id, - genesis_head, - validation_code, - }; + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = BuyTicket { call }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn deregister( + pub fn set_calls( &self, - id: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = Deregister { id }; + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetCalls { calls }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn swap( + pub fn start_lottery( &self, - id: runtime_types::polkadot_parachain::primitives::Id, - other: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = Swap { id, other }; + price: u128, + length: u32, + delay: u32, + repeat: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = StartLottery { + price, + length, + delay, + repeat, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn force_remove_lock( + pub fn stop_repeat( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceRemoveLock { para }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reserve(&self) -> ::subxt::SubmittableExtrinsic { - let call = Reserve {}; + ) -> ::subxt::SubmittableExtrinsic { + let call = StopRepeat {}; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = - runtime_types::polkadot_runtime_common::paras_registrar::pallet::Event; + pub type Event = runtime_types::pallet_lottery::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Reserved( - pub runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct LotteryStarted {} + impl ::subxt::Event for LotteryStarted { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "LotteryStarted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CallsUpdated {} + impl ::subxt::Event for CallsUpdated { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "CallsUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Winner(pub ::subxt::sp_core::crypto::AccountId32, pub u128); + impl ::subxt::Event for Winner { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "Winner"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TicketBought( pub ::subxt::sp_core::crypto::AccountId32, + pub (u8, u8), ); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Registrar"; - const EVENT: &'static str = "Reserved"; + impl ::subxt::Event for TicketBought { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "TicketBought"; } } pub mod storage { use super::runtime_types; - pub struct PendingSwap(pub 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; + pub struct LotteryIndex; + impl ::subxt::StorageEntry for LotteryIndex { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "LotteryIndex"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Lottery; + impl ::subxt::StorageEntry for Lottery { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "Lottery"; + type Value = runtime_types::pallet_lottery::LotteryConfig; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Participants(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Participants { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "Participants"; + type Value = (u32, Vec<(u8, u8)>); fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -12019,15 +12355,20 @@ pub mod api { )]) } } - pub struct Paras(pub 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, - u128, - >; + pub struct TicketsCount; + impl ::subxt::StorageEntry for TicketsCount { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "TicketsCount"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Tickets(pub u32); + impl ::subxt::StorageEntry for Tickets { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "Tickets"; + type Value = ::subxt::sp_core::crypto::AccountId32; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -12035,11 +12376,11 @@ pub mod api { )]) } } - 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; + pub struct CallIndices; + impl ::subxt::StorageEntry for CallIndices { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "CallIndices"; + type Value = Vec<(u8, u8)>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -12051,79 +12392,122 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn pending_swap( + pub async fn lottery_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = LotteryIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lottery( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_parachain::primitives::Id, + runtime_types::pallet_lottery::LotteryConfig, >, ::subxt::Error, > { - let entry = PendingSwap(_0); + let entry = Lottery; self.client.storage().fetch(&entry, hash).await } - pub async fn paras( + pub async fn participants( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result<(u32, Vec<(u8, u8)>), ::subxt::Error> + { + let entry = Participants(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn participants_iter( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_common::paras_registrar::ParaInfo< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, + ::subxt::KeyIter<'a, T, Participants>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn tickets_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = TicketsCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn tickets( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { - let entry = Paras(_0); + let entry = Tickets(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn next_free_para_id( + pub async fn tickets_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::polkadot_parachain::primitives::Id, + ::subxt::KeyIter<'a, T, Tickets>, ::subxt::Error, > { - let entry = NextFreeParaId; + self.client.storage().iter(hash).await + } + pub async fn call_indices( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = CallIndices; self.client.storage().fetch_or_default(&entry, hash).await } } } } - pub mod slots { + pub mod gilt { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ForceLease { - pub para: runtime_types::polkadot_parachain::primitives::Id, - pub leaser: ::subxt::sp_core::crypto::AccountId32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PlaceBid { + #[codec(compact)] + pub amount: u128, + pub duration: u32, + } + impl ::subxt::Call for PlaceBid { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "place_bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RetractBid { + #[codec(compact)] pub amount: u128, - pub period_begin: u32, - pub period_count: u32, + pub duration: u32, } - impl ::subxt::Call for ForceLease { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "force_lease"; + impl ::subxt::Call for RetractBid { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "retract_bid"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ClearAllLeases { - pub para: runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetTarget { + #[codec(compact)] + pub target: ::subxt::sp_arithmetic::per_things::Perquintill, } - impl ::subxt::Call for ClearAllLeases { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "clear_all_leases"; + impl ::subxt::Call for SetTarget { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "set_target"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct TriggerOnboard { - pub para: runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thaw { + #[codec(compact)] + pub index: u32, } - impl ::subxt::Call for TriggerOnboard { - const PALLET: &'static str = "Slots"; - const FUNCTION: &'static str = "trigger_onboard"; + impl ::subxt::Call for Thaw { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "thaw"; } pub struct TransactionApi< 'a, @@ -12138,73 +12522,131 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub fn force_lease( + pub fn place_bid( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, amount: u128, - period_begin: u32, - period_count: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceLease { - para, - leaser, - amount, - period_begin, - period_count, - }; + duration: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = PlaceBid { amount, duration }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn clear_all_leases( + pub fn retract_bid( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearAllLeases { para }; + amount: u128, + duration: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RetractBid { amount, duration }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn trigger_onboard( + pub fn set_target( &self, - para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = TriggerOnboard { para }; + target: ::subxt::sp_arithmetic::per_things::Perquintill, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetTarget { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw(&self, index: u32) -> ::subxt::SubmittableExtrinsic { + let call = Thaw { index }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = runtime_types::polkadot_runtime_common::slots::pallet::Event; + pub type Event = runtime_types::pallet_gilt::pallet::Event; pub mod events { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NewLeasePeriod(pub u32); - impl ::subxt::Event for NewLeasePeriod { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "NewLeasePeriod"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Leased( - pub runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BidPlaced( + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + pub u32, + ); + impl ::subxt::Event for BidPlaced { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "BidPlaced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BidRetracted( pub ::subxt::sp_core::crypto::AccountId32, + pub u128, pub u32, + ); + impl ::subxt::Event for BidRetracted { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "BidRetracted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct GiltIssued( + pub u32, + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub u128, + ); + impl ::subxt::Event for GiltIssued { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "GiltIssued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct GiltThawed( pub u32, + pub ::subxt::sp_core::crypto::AccountId32, pub u128, pub u128, ); - impl ::subxt::Event for Leased { - const PALLET: &'static str = "Slots"; - const EVENT: &'static str = "Leased"; + impl ::subxt::Event for GiltThawed { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "GiltThawed"; } } pub mod storage { use super::runtime_types; - pub struct Leases(pub runtime_types::polkadot_parachain::primitives::Id); - impl ::subxt::StorageEntry for Leases { - const PALLET: &'static str = "Slots"; - const STORAGE: &'static str = "Leases"; - type Value = Vec>; + pub struct QueueTotals; + impl ::subxt::StorageEntry for QueueTotals { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "QueueTotals"; + type Value = Vec<(u32, u128)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Queues(pub u32); + impl ::subxt::StorageEntry for Queues { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "Queues"; + type Value = Vec< + runtime_types::pallet_gilt::pallet::GiltBid< + u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Twox64Concat, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct ActiveTotal; + impl ::subxt::StorageEntry for ActiveTotal { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "ActiveTotal"; + type Value = runtime_types::pallet_gilt::pallet::ActiveGiltsTotal; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Active(pub u32); + impl ::subxt::StorageEntry for Active { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "Active"; + type Value = runtime_types::pallet_gilt::pallet::ActiveGilt< + u128, + ::subxt::sp_core::crypto::AccountId32, + u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, )]) } } @@ -12215,368 +12657,376 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn leases( + pub async fn queue_totals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = QueueTotals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queues( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_gilt::pallet::GiltBid< + u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Queues(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queues_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Queues>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn active_total( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec>, + runtime_types::pallet_gilt::pallet::ActiveGiltsTotal, ::subxt::Error, > { - let entry = Leases(_0); + let entry = ActiveTotal; self.client.storage().fetch_or_default(&entry, hash).await } + pub async fn active( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_gilt::pallet::ActiveGilt< + u128, + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, + ::subxt::Error, + > { + let entry = Active(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn active_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Active>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } } } } - pub mod auctions { + pub mod uniques { use super::runtime_types; pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NewAuction { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Create { #[codec(compact)] - pub duration: u32, + pub class: u32, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for Create { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "create"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreate { #[codec(compact)] - pub lease_period_index: u32, + pub class: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub free_holding: bool, } - impl ::subxt::Call for NewAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "new_auction"; + impl ::subxt::Call for ForceCreate { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "force_create"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Bid { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroy { #[codec(compact)] - pub para: runtime_types::polkadot_parachain::primitives::Id, + pub class: u32, + pub witness: runtime_types::pallet_uniques::types::DestroyWitness, + } + impl ::subxt::Call for Destroy { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "destroy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Mint { #[codec(compact)] - pub auction_index: u32, + pub class: u32, #[codec(compact)] - pub first_slot: u32, + pub instance: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + } + impl ::subxt::Call for Mint { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "mint"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burn { #[codec(compact)] - pub last_slot: u32, + pub class: u32, #[codec(compact)] - pub amount: u128, + pub instance: u32, + pub check_owner: Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, } - impl ::subxt::Call for Bid { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "bid"; + impl ::subxt::Call for Burn { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "burn"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CancelAuction {} - impl ::subxt::Call for CancelAuction { - const PALLET: &'static str = "Auctions"; - const FUNCTION: &'static str = "cancel_auction"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transfer { + #[codec(compact)] + pub class: u32, + #[codec(compact)] + pub instance: u32, + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "transfer"; } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn new_auction( - &self, - duration: u32, - lease_period_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = NewAuction { - duration, - lease_period_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn bid( - &self, - para: runtime_types::polkadot_parachain::primitives::Id, - auction_index: u32, - first_slot: u32, - last_slot: u32, - amount: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Bid { - para, - auction_index, - first_slot, - last_slot, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_auction( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelAuction {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Redeposit { + #[codec(compact)] + pub class: u32, + pub instances: Vec, } - } - pub type Event = runtime_types::polkadot_runtime_common::auctions::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AuctionStarted(pub u32, pub u32, pub u32); - impl ::subxt::Event for AuctionStarted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionStarted"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AuctionClosed(pub u32); - impl ::subxt::Event for AuctionClosed { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "AuctionClosed"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Reserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub u128, - ); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Reserved"; + impl ::subxt::Call for Redeposit { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "redeposit"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Unreserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Unreserved { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "Unreserved"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Freeze { + #[codec(compact)] + pub class: u32, + #[codec(compact)] + pub instance: u32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReserveConfiscated( - pub runtime_types::polkadot_parachain::primitives::Id, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for ReserveConfiscated { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "ReserveConfiscated"; + impl ::subxt::Call for Freeze { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "freeze"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BidAccepted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub u128, - pub u32, - pub u32, - ); - impl ::subxt::Event for BidAccepted { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "BidAccepted"; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thaw { + #[codec(compact)] + pub class: u32, + #[codec(compact)] + pub instance: u32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct WinningOffset(pub u32, pub u32); - impl ::subxt::Event for WinningOffset { - const PALLET: &'static str = "Auctions"; - const EVENT: &'static str = "WinningOffset"; + impl ::subxt::Call for Thaw { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "thaw"; } - } - 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct FreezeClass { + #[codec(compact)] + pub class: u32, } - pub struct AuctionInfo; - impl ::subxt::StorageEntry for AuctionInfo { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "AuctionInfo"; - type Value = (u32, u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + impl ::subxt::Call for FreezeClass { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "freeze_class"; } - pub struct ReservedAmounts( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - ); - impl ::subxt::StorageEntry for ReservedAmounts { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "ReservedAmounts"; - type Value = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ThawClass { + #[codec(compact)] + pub class: u32, } - pub struct Winning(pub u32); - impl ::subxt::StorageEntry for Winning { - const PALLET: &'static str = "Auctions"; - const STORAGE: &'static str = "Winning"; - type Value = [Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - u128, - )>; 36usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } + impl ::subxt::Call for ThawClass { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "thaw_class"; } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferOwnership { + #[codec(compact)] + pub class: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn auction_counter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = AuctionCounter; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn auction_info( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(u32, u32)>, - ::subxt::Error, - > { - let entry = AuctionInfo; - self.client.storage().fetch(&entry, hash).await - } - pub async fn reserved_amounts( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = ReservedAmounts(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn winning( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - [Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - u128, - )>; 36usize], - >, - ::subxt::Error, - > { - let entry = Winning(_0); - self.client.storage().fetch(&entry, hash).await - } + impl ::subxt::Call for TransferOwnership { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "transfer_ownership"; } - } - } - pub mod crowdloan { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Create { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - pub cap: u128, - #[codec(compact)] - pub first_period: u32, - #[codec(compact)] - pub last_period: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetTeam { #[codec(compact)] - pub end: u32, - pub verifier: Option, + pub class: u32, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "create"; + impl ::subxt::Call for SetTeam { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_team"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Contribute { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveTransfer { #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, + pub class: u32, #[codec(compact)] - pub value: u128, - pub signature: Option, + pub instance: u32, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, } - impl ::subxt::Call for Contribute { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "contribute"; + impl ::subxt::Call for ApproveTransfer { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "approve_transfer"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Withdraw { - pub who: ::subxt::sp_core::crypto::AccountId32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelApproval { #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, + pub class: u32, + #[codec(compact)] + pub instance: u32, + pub maybe_check_delegate: Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, } - impl ::subxt::Call for Withdraw { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "withdraw"; + impl ::subxt::Call for CancelApproval { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "cancel_approval"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Refund { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceAssetStatus { #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, + pub class: u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + pub free_holding: bool, + pub is_frozen: bool, } - impl ::subxt::Call for Refund { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "refund"; + impl ::subxt::Call for ForceAssetStatus { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "force_asset_status"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Dissolve { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetAttribute { #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, + pub class: u32, + pub maybe_instance: Option, + pub key: + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + pub value: + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + } + impl ::subxt::Call for SetAttribute { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_attribute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearAttribute { + #[codec(compact)] + pub class: u32, + pub maybe_instance: Option, + pub key: + runtime_types::frame_support::storage::bounded_vec::BoundedVec, } - impl ::subxt::Call for Dissolve { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "dissolve"; + impl ::subxt::Call for ClearAttribute { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "clear_attribute"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Edit { - #[codec(compact)] - pub index: runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMetadata { #[codec(compact)] - pub cap: u128, + pub class: u32, #[codec(compact)] - pub first_period: u32, + pub instance: u32, + pub data: + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + pub is_frozen: bool, + } + impl ::subxt::Call for SetMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearMetadata { #[codec(compact)] - pub last_period: u32, + pub class: u32, #[codec(compact)] - pub end: u32, - pub verifier: Option, + pub instance: u32, } - impl ::subxt::Call for Edit { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "edit"; + impl ::subxt::Call for ClearMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "clear_metadata"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AddMemo { - pub index: runtime_types::polkadot_parachain::primitives::Id, - pub memo: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetClassMetadata { + #[codec(compact)] + pub class: u32, + pub data: + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + pub is_frozen: bool, } - impl ::subxt::Call for AddMemo { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "add_memo"; + impl ::subxt::Call for SetClassMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_class_metadata"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Poke { - pub index: runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearClassMetadata { + #[codec(compact)] + pub class: u32, } - impl ::subxt::Call for Poke { - const PALLET: &'static str = "Crowdloan"; - const FUNCTION: &'static str = "poke"; + impl ::subxt::Call for ClearClassMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "clear_class_metadata"; } pub struct TransactionApi< 'a, @@ -12593,221 +13043,616 @@ pub mod api { } pub fn create( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - cap: u128, - first_period: u32, - last_period: u32, - end: u32, - verifier: Option, + class: u32, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, ) -> ::subxt::SubmittableExtrinsic { - let call = Create { - index, - cap, - first_period, - last_period, - end, - verifier, - }; + let call = Create { class, admin }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn contribute( + pub fn force_create( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - value: u128, - signature: Option, - ) -> ::subxt::SubmittableExtrinsic { - let call = Contribute { - index, - value, - signature, + class: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + free_holding: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceCreate { + class, + owner, + free_holding, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn withdraw( + pub fn destroy( &self, - who: ::subxt::sp_core::crypto::AccountId32, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = Withdraw { who, index }; + class: u32, + witness: runtime_types::pallet_uniques::types::DestroyWitness, + ) -> ::subxt::SubmittableExtrinsic { + let call = Destroy { class, witness }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn refund( + pub fn mint( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = Refund { index }; + class: u32, + instance: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Mint { + class, + instance, + owner, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn dissolve( + pub fn burn( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = Dissolve { index }; + class: u32, + instance: u32, + check_owner: Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Burn { + class, + instance, + check_owner, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn edit( + pub fn transfer( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - cap: u128, - first_period: u32, - last_period: u32, - end: u32, - verifier: Option, - ) -> ::subxt::SubmittableExtrinsic { - let call = Edit { - index, - cap, - first_period, - last_period, - end, - verifier, + class: u32, + instance: u32, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { + class, + instance, + dest, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn add_memo( + pub fn redeposit( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - memo: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddMemo { index, memo }; + class: u32, + instances: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Redeposit { class, instances }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn poke( + pub fn freeze( &self, - index: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::SubmittableExtrinsic { - let call = Poke { index }; + class: u32, + instance: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Freeze { class, instance }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - } - pub type Event = runtime_types::polkadot_runtime_common::crowdloan::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Contributed( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub u128, - ); - impl ::subxt::Event for Contributed { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Contributed"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Withdrew( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub u128, - ); - impl ::subxt::Event for Withdrew { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "Withdrew"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct HandleBidResult( - pub runtime_types::polkadot_parachain::primitives::Id, - pub Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for HandleBidResult { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "HandleBidResult"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct MemoUpdated( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::polkadot_parachain::primitives::Id, - pub Vec, - ); - impl ::subxt::Event for MemoUpdated { - const PALLET: &'static str = "Crowdloan"; - const EVENT: &'static str = "MemoUpdated"; - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(pub 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, - u128, - u32, - u32, + pub fn thaw( + &self, + class: u32, + instance: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Thaw { class, instance }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze_class( + &self, + class: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FreezeClass { class }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw_class( + &self, + class: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ThawClass { class }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_ownership( + &self, + class: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferOwnership { class, owner }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_team( + &self, + class: u32, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetTeam { + class, + issuer, + admin, + freezer, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_transfer( + &self, + class: u32, + instance: u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveTransfer { + class, + instance, + delegate, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_approval( + &self, + class: u32, + instance: u32, + maybe_check_delegate: Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelApproval { + class, + instance, + maybe_check_delegate, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_asset_status( + &self, + class: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + free_holding: bool, + is_frozen: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceAssetStatus { + class, + owner, + issuer, + admin, + freezer, + free_holding, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_attribute( + &self, + class: u32, + maybe_instance: Option, + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + value: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetAttribute { + class, + maybe_instance, + key, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_attribute( + &self, + class: u32, + maybe_instance: Option, + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearAttribute { + class, + maybe_instance, + key, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_metadata( + &self, + class: u32, + instance: u32, + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + is_frozen: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMetadata { + class, + instance, + data, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_metadata( + &self, + class: u32, + instance: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearMetadata { class, instance }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_class_metadata( + &self, + class: u32, + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + is_frozen: bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetClassMetadata { + class, + data, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_class_metadata( + &self, + class: u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ClearClassMetadata { class }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_uniques::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Created( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Created { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Created"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreated(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for ForceCreated { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ForceCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroyed(pub u32); + impl ::subxt::Event for Destroyed { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Destroyed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Issued( + pub u32, + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Issued { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Issued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transferred( + pub u32, + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Transferred { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Transferred"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burned( + pub u32, + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Burned { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Burned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Frozen(pub u32, pub u32); + impl ::subxt::Event for Frozen { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Frozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thawed(pub u32, pub u32); + impl ::subxt::Event for Thawed { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Thawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassFrozen(pub u32); + impl ::subxt::Event for ClassFrozen { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassFrozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassThawed(pub u32); + impl ::subxt::Event for ClassThawed { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassThawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OwnerChanged(pub u32, pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for OwnerChanged { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "OwnerChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TeamChanged( + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for TeamChanged { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "TeamChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovedTransfer( + pub u32, + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ApprovedTransfer { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ApprovedTransfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovalCancelled( + pub u32, + pub u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ApprovalCancelled { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ApprovalCancelled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetStatusChanged(pub u32); + impl ::subxt::Event for AssetStatusChanged { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "AssetStatusChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassMetadataSet( + pub u32, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, + pub bool, + ); + impl ::subxt::Event for ClassMetadataSet { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassMetadataSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassMetadataCleared(pub u32); + impl ::subxt::Event for ClassMetadataCleared { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassMetadataCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataSet( + pub u32, + pub u32, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, + pub bool, + ); + impl ::subxt::Event for MetadataSet { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataCleared(pub u32, pub u32); + impl ::subxt::Event for MetadataCleared { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "MetadataCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Redeposited(pub u32, pub Vec); + impl ::subxt::Event for Redeposited { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Redeposited"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AttributeSet( + pub u32, + pub Option, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, + ); + impl ::subxt::Event for AttributeSet { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "AttributeSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AttributeCleared( + pub u32, + pub Option, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, + ); + impl ::subxt::Event for AttributeCleared { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "AttributeCleared"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Class(pub u32); + impl ::subxt::StorageEntry for Class { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Class"; + type Value = runtime_types::pallet_uniques::types::ClassDetails< + ::subxt::sp_core::crypto::AccountId32, + u128, >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Twox64Concat, + ::subxt::StorageHasher::Blake2_128Concat, )]) } } - pub struct NewRaise; - impl ::subxt::StorageEntry for NewRaise { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NewRaise"; - type Value = Vec; + pub struct Account(::subxt::sp_core::crypto::AccountId32, u32, u32); + impl ::subxt::StorageEntry for Account { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Account"; + type Value = (); fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.2, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) } } - pub struct EndingsCount; - impl ::subxt::StorageEntry for EndingsCount { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "EndingsCount"; - type Value = u32; + pub struct Asset(u32, u32); + impl ::subxt::StorageEntry for Asset { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Asset"; + type Value = runtime_types::pallet_uniques::types::InstanceDetails< + ::subxt::sp_core::crypto::AccountId32, + u128, + >; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) } } - pub struct NextTrieIndex; - impl ::subxt::StorageEntry for NextTrieIndex { - const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NextTrieIndex"; - type Value = u32; + pub struct ClassMetadataOf(pub u32); + impl ::subxt::StorageEntry for ClassMetadataOf { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "ClassMetadataOf"; + type Value = runtime_types::pallet_uniques::types::ClassMetadata; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct InstanceMetadataOf(u32, u32); + impl ::subxt::StorageEntry for InstanceMetadataOf { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "InstanceMetadataOf"; + type Value = runtime_types::pallet_uniques::types::InstanceMetadata; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Attribute( + u32, + Option, + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + ); + impl ::subxt::StorageEntry for Attribute { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Attribute"; + type Value = ( + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.2, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) } } pub struct StorageApi<'a, T: ::subxt::Config> { @@ -12817,3883 +13662,4285 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn funds( + pub async fn class( &self, - _0: runtime_types::polkadot_parachain::primitives::Id, + _0: u32, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_runtime_common::crowdloan::FundInfo< + runtime_types::pallet_uniques::types::ClassDetails< ::subxt::sp_core::crypto::AccountId32, u128, - u32, - u32, >, >, ::subxt::Error, > { - let entry = Funds(_0); + let entry = Class(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn new_raise( + pub async fn class_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = NewRaise; - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Class>, ::subxt::Error> + { + self.client.storage().iter(hash).await } - pub async fn endings_count( + pub async fn account( &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: u32, + _2: u32, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = EndingsCount; - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + { + let entry = Account(_0, _1, _2); + self.client.storage().fetch(&entry, hash).await } - pub async fn next_trie_index( + pub async fn account_iter( &self, hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = NextTrieIndex; - self.client.storage().fetch_or_default(&entry, hash).await + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn asset( + &self, + _0: u32, + _1: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::InstanceDetails< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + >, + ::subxt::Error, + > { + let entry = Asset(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn asset_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn class_metadata_of( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::ClassMetadata, + >, + ::subxt::Error, + > { + let entry = ClassMetadataOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn class_metadata_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ClassMetadataOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn instance_metadata_of( + &self, + _0: u32, + _1: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::InstanceMetadata, + >, + ::subxt::Error, + > { + let entry = InstanceMetadataOf(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn instance_metadata_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, InstanceMetadataOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn attribute( + &self, + _0: u32, + _1: Option, + _2: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + u128, + )>, + ::subxt::Error, + > { + let entry = Attribute(_0, _1, _2); + self.client.storage().fetch(&entry, hash).await + } + pub async fn attribute_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Attribute>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } } } - } - pub mod runtime_types { - use super::runtime_types; - pub mod bitvec { - use super::runtime_types; - pub mod order { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Lsb0 {} - } - } - pub mod finality_grandpa { + } + pub mod transaction_storage { + use super::runtime_types; + pub mod calls { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Equivocation<_0, _1, _2> { - pub round_number: u64, - pub identity: _0, - pub first: (_1, _2), - pub second: (_1, _2), + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Store { + pub data: Vec, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Precommit<_0, _1> { - pub target_hash: _0, - pub target_number: _1, + impl ::subxt::Call for Store { + const PALLET: &'static str = "TransactionStorage"; + const FUNCTION: &'static str = "store"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Prevote<_0, _1> { - pub target_hash: _0, - pub target_number: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Renew { + pub block: u32, + pub index: u32, } - } - pub mod frame_support { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub mod bounded_btree_map { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct BoundedBTreeMap<_0, _1>( - pub std::collections::BTreeMap<_0, _1>, - ); + impl ::subxt::Call for Renew { + const PALLET: &'static str = "TransactionStorage"; + const FUNCTION: &'static str = "renew"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CheckProof { + pub proof: + runtime_types::sp_transaction_storage_proof::TransactionStorageProof, + } + impl ::subxt::Call for CheckProof { + const PALLET: &'static str = "TransactionStorage"; + const FUNCTION: &'static str = "check_proof"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } } - pub mod bounded_vec { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct BoundedVec<_0>(pub Vec<_0>); + pub fn store( + &self, + data: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Store { data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub mod weak_bounded_vec { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct WeakBoundedVec<_0>(pub Vec<_0>); + pub fn renew( + &self, + block: u32, + index: u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Renew { block, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - pub mod traits { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct WrapperOpaque<_0>(u32, pub _0); + pub fn check_proof( + &self, + proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof, + ) -> ::subxt::SubmittableExtrinsic { + let call = CheckProof { proof }; + ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub mod tokens { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum BalanceStatus { - Free, - Reserved, - } - } + } + } + pub type Event = runtime_types::pallet_transaction_storage::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Stored(pub u32); + impl ::subxt::Event for Stored { + const PALLET: &'static str = "TransactionStorage"; + const EVENT: &'static str = "Stored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Renewed(pub u32); + impl ::subxt::Event for Renewed { + const PALLET: &'static str = "TransactionStorage"; + const EVENT: &'static str = "Renewed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProofChecked {} + impl ::subxt::Event for ProofChecked { + const PALLET: &'static str = "TransactionStorage"; + const EVENT: &'static str = "ProofChecked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Transactions(pub u32); + impl ::subxt::StorageEntry for Transactions { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "Transactions"; + type Value = + Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) } } - pub mod weights { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum DispatchClass { - Normal, - Operational, - Mandatory, + pub struct ChunkCount(pub u32); + impl ::subxt::StorageEntry for ChunkCount { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "ChunkCount"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct DispatchInfo { - pub weight: u64, - pub class: runtime_types::frame_support::weights::DispatchClass, - pub pays_fee: runtime_types::frame_support::weights::Pays, + } + pub struct ByteFee; + impl ::subxt::StorageEntry for ByteFee { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "ByteFee"; + type Value = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Pays { - Yes, - No, + } + pub struct EntryFee; + impl ::subxt::StorageEntry for EntryFee { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "EntryFee"; + type Value = u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct PerDispatchClass<_0> { - pub normal: _0, - pub operational: _0, - pub mandatory: _0, + } + pub struct MaxTransactionSize; + impl ::subxt::StorageEntry for MaxTransactionSize { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "MaxTransactionSize"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct RuntimeDbWeight { - pub read: u64, - pub write: u64, + } + pub struct MaxBlockTransactions; + impl ::subxt::StorageEntry for MaxBlockTransactions { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "MaxBlockTransactions"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct WeightToFeeCoefficient<_0> { - pub coeff_integer: _0, - pub coeff_frac: ::subxt::sp_arithmetic::per_things::Perbill, - pub negative: bool, - pub degree: u8, + } + pub struct StoragePeriod; + impl ::subxt::StorageEntry for StoragePeriod { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "StoragePeriod"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct PalletId(pub [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( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CheckGenesis {} + pub struct BlockTransactions; + impl ::subxt::StorageEntry for BlockTransactions { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "BlockTransactions"; + type Value = + Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - pub mod check_mortality { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CheckMortality( - pub runtime_types::sp_runtime::generic::era::Era, - ); + } + pub struct ProofChecked; + impl ::subxt::StorageEntry for ProofChecked { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "ProofChecked"; + type Value = bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - pub mod check_nonce { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CheckNonce(pub u32); + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } } - pub mod check_spec_version { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CheckSpecVersion {} + pub async fn transactions( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + Vec, + >, + ::subxt::Error, + > { + let entry = Transactions(_0); + self.client.storage().fetch(&entry, hash).await } - pub mod check_tx_version { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CheckTxVersion {} + pub async fn transactions_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Transactions>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } - pub mod check_weight { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CheckWeight {} + pub async fn chunk_count( + &self, + _0: u32, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ChunkCount(_0); + self.client.storage().fetch_or_default(&entry, hash).await } - } - pub mod limits { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct BlockLength { - pub max: runtime_types::frame_support::weights::PerDispatchClass, + pub async fn chunk_count_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ChunkCount>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct BlockWeights { - pub base_block: u64, - pub max_block: u64, - pub per_class: - runtime_types::frame_support::weights::PerDispatchClass< - runtime_types::frame_system::limits::WeightsPerClass, - >, + pub async fn byte_fee( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = ByteFee; + self.client.storage().fetch(&entry, hash).await } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct WeightsPerClass { - pub base_extrinsic: u64, - pub max_extrinsic: Option, - pub max_total: Option, - pub reserved: Option, + pub async fn entry_fee( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> + { + let entry = EntryFee; + self.client.storage().fetch(&entry, hash).await } - } - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : Vec < u8 > , } , set_heap_pages { pages : u64 , } , set_code { code : Vec < u8 > , } , set_code_without_checks { code : Vec < u8 > , } , set_changes_trie_config { changes_trie_config : Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : Vec < (Vec < u8 > , Vec < u8 > ,) > , } , kill_storage { keys : Vec < Vec < u8 > > , } , kill_prefix { prefix : Vec < u8 > , subkeys : u32 , } , remark_with_event { remark : Vec < u8 > , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InvalidSpecName, - SpecVersionNeedsToIncrease, - FailedToExtractRuntimeVersion, - NonDefaultComposite, - NonZeroRefCount, + pub async fn max_transaction_size( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = MaxTransactionSize; + self.client.storage().fetch_or_default(&entry, hash).await } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), - ExtrinsicFailed( - runtime_types::sp_runtime::DispatchError, - runtime_types::frame_support::weights::DispatchInfo, - ), - CodeUpdated, - NewAccount(::subxt::sp_core::crypto::AccountId32), - KilledAccount(::subxt::sp_core::crypto::AccountId32), - Remarked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ), + pub async fn max_block_transactions( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = MaxBlockTransactions; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_period( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = StoragePeriod; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn block_transactions( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = BlockTransactions; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proof_checked( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = ProofChecked; + self.client.storage().fetch_or_default(&entry, hash).await } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AccountInfo<_0, _1> { - pub nonce: _0, - pub consumers: _0, - pub providers: _0, - pub sufficients: _0, - pub data: _1, + } + } + pub mod bags_list { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Rebag { + pub dislocated: ::subxt::sp_core::crypto::AccountId32, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct EventRecord<_0, _1> { - pub phase: runtime_types::frame_system::Phase, - pub event: _0, - pub topics: Vec<_1>, + impl ::subxt::Call for Rebag { + const PALLET: &'static str = "BagsList"; + const FUNCTION: &'static str = "rebag"; } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct LastRuntimeUpgradeInfo { - #[codec(compact)] - pub spec_version: u32, - pub spec_name: String, + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Phase { - ApplyExtrinsic(u32), - Finalization, - Initialization, + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn rebag( + &self, + dislocated: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Rebag { dislocated }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum RawOrigin<_0> { - Root, - Signed(_0), - None, + } + pub type Event = runtime_types::pallet_bags_list::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Rebagged( + pub ::subxt::sp_core::crypto::AccountId32, + pub u64, + pub u64, + ); + impl ::subxt::Event for Rebagged { + const PALLET: &'static str = "BagsList"; + const EVENT: &'static str = "Rebagged"; } } - pub mod pallet_authorship { + pub mod storage { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - set_uncles { - new_uncles: Vec< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InvalidUncleParent, - UnclesAlreadySet, - TooManyUncles, - GenesisUncle, - TooHighUncle, - UncleAlreadyIncluded, - OldUncle, + pub struct CounterForListNodes; + impl ::subxt::StorageEntry for CounterForListNodes { + const PALLET: &'static str = "BagsList"; + const STORAGE: &'static str = "CounterForListNodes"; + type Value = u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum UncleEntryItem<_0, _1, _2> { - InclusionHeight(_0), - Uncle(_1, Option<_2>), + pub struct ListNodes(pub ::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 mod pallet_babe { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - report_equivocation { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , report_equivocation_unsigned { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InvalidEquivocationProof, - InvalidKeyOwnershipProof, - DuplicateOffenceReport, + pub struct ListBags(pub 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 mod pallet_balances { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - transfer { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: u128, - }, - set_balance { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - new_free: u128, - #[codec(compact)] - new_reserved: u128, - }, - 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: u128, - }, - transfer_keep_alive { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: u128, - }, - transfer_all { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - keep_alive: bool, - }, - force_unreserve { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - amount: u128, - }, + 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 } } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - VestingBalance, - LiquidityRestrictions, - InsufficientBalance, - ExistentialDeposit, - KeepAlive, - ExistingVestingSchedule, - DeadAccount, - TooManyReserves, + pub async fn counter_for_list_nodes( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result { + let entry = CounterForListNodes; + self.client.storage().fetch_or_default(&entry, hash).await } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - Endowed(::subxt::sp_core::crypto::AccountId32, u128), - DustLost(::subxt::sp_core::crypto::AccountId32, u128), - Transfer( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - BalanceSet(::subxt::sp_core::crypto::AccountId32, u128, u128), - Deposit(::subxt::sp_core::crypto::AccountId32, u128), - Reserved(::subxt::sp_core::crypto::AccountId32, u128), - Unreserved(::subxt::sp_core::crypto::AccountId32, u128), - ReserveRepatriated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, - ), + pub async fn list_nodes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ListNodes(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn list_nodes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ListNodes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn list_bags( + &self, + _0: u64, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ListBags(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn list_bags_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ListBags>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct AccountData<_0> { - pub free: _0, - pub reserved: _0, - pub misc_frozen: _0, - pub fee_frozen: _0, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BalanceLock<_0> { - pub id: [u8; 8usize], - pub amount: _0, - pub reasons: runtime_types::pallet_balances::Reasons, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Reasons { - Fee, - Misc, - All, + } + } + pub mod runtime_types { + use super::runtime_types; + pub mod finality_grandpa { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Equivocation<_0, _1, _2> { + pub round_number: u64, + pub identity: _0, + pub first: (_1, _2), + pub second: (_1, _2), } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Releases { - V1_0_0, - V2_0_0, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Precommit<_0, _1> { + pub target_hash: _0, + pub target_number: _1, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReserveData<_0, _1> { - pub id: _0, - pub amount: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Prevote<_0, _1> { + pub target_hash: _0, + pub target_number: _1, } } - pub mod pallet_bounties { + pub mod frame_support { use super::runtime_types; - pub mod pallet { + pub mod storage { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - propose_bounty { - #[codec(compact)] - value: u128, - description: Vec, - }, - approve_bounty { - #[codec(compact)] - bounty_id: u32, - }, - propose_curator { - #[codec(compact)] - bounty_id: u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - fee: u128, - }, - unassign_curator { - #[codec(compact)] - bounty_id: u32, - }, - accept_curator { - #[codec(compact)] - bounty_id: u32, - }, - award_bounty { - #[codec(compact)] - bounty_id: u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - claim_bounty { - #[codec(compact)] - bounty_id: u32, - }, - close_bounty { - #[codec(compact)] - bounty_id: u32, - }, - extend_bounty_expiry { - #[codec(compact)] - bounty_id: u32, - remark: Vec, - }, + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct BoundedBTreeMap<_0, _1>( + pub std::collections::BTreeMap<_0, _1>, + ); } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InsufficientProposersBalance, - InvalidIndex, - ReasonTooBig, - UnexpectedStatus, - RequireCurator, - InvalidValue, - InvalidFee, - PendingPayout, - Premature, + pub mod bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct BoundedVec<_0>(pub Vec<_0>); } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - BountyProposed(u32), - BountyRejected(u32, u128), - BountyBecameActive(u32), - BountyAwarded(u32, ::subxt::sp_core::crypto::AccountId32), - BountyClaimed(u32, u128, ::subxt::sp_core::crypto::AccountId32), - BountyCanceled(u32), - BountyExtended(u32), + pub mod weak_bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct WeakBoundedVec<_0>(pub Vec<_0>); } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum BountyStatus<_0, _1> { - Proposed, - Approved, - Funded, - CuratorProposed { - curator: _0, - }, - Active { - curator: _0, - update_due: _1, - }, - PendingPayout { - curator: _0, - beneficiary: _0, - unlock_at: _1, - }, + pub mod traits { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct WrapperKeepOpaque<_0>(u32, pub _0); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct WrapperOpaque<_0>(u32, pub _0); + } + pub mod tokens { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub enum BalanceStatus { + Free, + Reserved, + } + } + } + } + pub mod weights { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum DispatchClass { + Normal, + Operational, + Mandatory, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DispatchInfo { + pub weight: 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)] + pub enum Pays { + Yes, + No, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PerDispatchClass<_0> { + pub normal: _0, + pub operational: _0, + pub mandatory: _0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RuntimeDbWeight { + pub read: u64, + pub write: u64, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct WeightToFeeCoefficient<_0> { + pub coeff_integer: _0, + pub coeff_frac: ::subxt::sp_arithmetic::per_things::Perbill, + pub negative: bool, + pub degree: u8, + } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PalletId(pub [u8; 8usize]); } - pub mod pallet_collective { + 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, + )] + pub struct CheckGenesis {} + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckMortality( + pub runtime_types::sp_runtime::generic::era::Era, + ); + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckNonce(pub u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckSpecVersion {} + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckTxVersion {} + } + pub mod check_weight { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckWeight {} + } + } + pub mod limits { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BlockLength { + pub max: runtime_types::frame_support::weights::PerDispatchClass, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BlockWeights { + pub base_block: u64, + pub max_block: u64, + pub per_class: + runtime_types::frame_support::weights::PerDispatchClass< + runtime_types::frame_system::limits::WeightsPerClass, + >, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct WeightsPerClass { + pub base_extrinsic: u64, + pub max_extrinsic: Option, + pub max_total: Option, + pub reserved: Option, + } + } pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - set_members { - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, - prime: Option<::subxt::sp_core::crypto::AccountId32>, - old_count: u32, - }, - execute { - proposal: std::boxed::Box, - #[codec(compact)] - length_bound: u32, - }, - propose { - #[codec(compact)] - threshold: u32, - proposal: std::boxed::Box, - #[codec(compact)] - length_bound: u32, - }, - vote { - proposal: ::subxt::sp_core::H256, - #[codec(compact)] - index: u32, - approve: bool, - }, - close { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - index: u32, - #[codec(compact)] - proposal_weight_bound: u64, - #[codec(compact)] - length_bound: u32, - }, - disapprove_proposal { - proposal_hash: ::subxt::sp_core::H256, - }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : Vec < u8 > , } , set_heap_pages { pages : u64 , } , set_code { code : Vec < u8 > , } , set_code_without_checks { code : Vec < u8 > , } , set_changes_trie_config { changes_trie_config : Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : Vec < (Vec < u8 > , Vec < u8 > ,) > , } , kill_storage { keys : Vec < Vec < u8 > > , } , kill_prefix { prefix : Vec < u8 > , subkeys : u32 , } , remark_with_event { remark : Vec < u8 > , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - NotMember, - DuplicateProposal, - ProposalMissing, - WrongIndex, - DuplicateVote, - AlreadyInitialized, - TooEarly, - TooManyProposals, - WrongProposalWeight, - WrongProposalLength, + InvalidSpecName, + SpecVersionNeedsToIncrease, + FailedToExtractRuntimeVersion, + NonDefaultComposite, + NonZeroRefCount, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - Proposed( - ::subxt::sp_core::crypto::AccountId32, - u32, - ::subxt::sp_core::H256, - u32, + ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), + ExtrinsicFailed( + runtime_types::sp_runtime::DispatchError, + runtime_types::frame_support::weights::DispatchInfo, ), - Voted( + CodeUpdated, + NewAccount(::subxt::sp_core::crypto::AccountId32), + KilledAccount(::subxt::sp_core::crypto::AccountId32), + Remarked( ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::H256, - bool, - u32, - u32, - ), - Approved(::subxt::sp_core::H256), - Disapproved(::subxt::sp_core::H256), - Executed( - ::subxt::sp_core::H256, - Result<(), runtime_types::sp_runtime::DispatchError>, - ), - MemberExecuted( - ::subxt::sp_core::H256, - Result<(), runtime_types::sp_runtime::DispatchError>, ), - Closed(::subxt::sp_core::H256, u32, u32), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum RawOrigin<_0> { - Members(u32, u32), - Member(_0), - _Phantom, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AccountInfo<_0, _1> { + pub nonce: _0, + pub consumers: _0, + pub providers: _0, + pub sufficients: _0, + pub data: _1, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Votes<_0, _1> { - pub index: _1, - pub threshold: _1, - pub ayes: Vec<_0>, - pub nays: Vec<_0>, - pub end: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: Vec<_1>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: u32, + pub spec_name: String, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Phase { + ApplyExtrinsic(u32), + Finalization, + Initialization, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum RawOrigin<_0> { + Root, + Signed(_0), + None, } } - pub mod pallet_democracy { + pub mod node_runtime { use super::runtime_types; - pub mod conviction { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Conviction { - None, - Locked1x, - Locked2x, - Locked3x, - Locked4x, - Locked5x, - Locked6x, - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + System(runtime_types::frame_system::pallet::Call), + Utility(runtime_types::pallet_utility::pallet::Call), + Babe(runtime_types::pallet_babe::pallet::Call), + Timestamp(runtime_types::pallet_timestamp::pallet::Call), + Authorship(runtime_types::pallet_authorship::pallet::Call), + Indices(runtime_types::pallet_indices::pallet::Call), + Balances(runtime_types::pallet_balances::pallet::Call), + ElectionProviderMultiPhase( + runtime_types::pallet_election_provider_multi_phase::pallet::Call, + ), + Staking(runtime_types::pallet_staking::pallet::pallet::Call), + Session(runtime_types::pallet_session::pallet::Call), + Democracy(runtime_types::pallet_democracy::pallet::Call), + Council(runtime_types::pallet_collective::pallet::Call), + TechnicalCommittee(runtime_types::pallet_collective::pallet::Call), + Elections(runtime_types::pallet_elections_phragmen::pallet::Call), + TechnicalMembership(runtime_types::pallet_membership::pallet::Call), + Grandpa(runtime_types::pallet_grandpa::pallet::Call), + Treasury(runtime_types::pallet_treasury::pallet::Call), + Contracts(runtime_types::pallet_contracts::pallet::Call), + Sudo(runtime_types::pallet_sudo::pallet::Call), + ImOnline(runtime_types::pallet_im_online::pallet::Call), + Identity(runtime_types::pallet_identity::pallet::Call), + Society(runtime_types::pallet_society::pallet::Call), + Recovery(runtime_types::pallet_recovery::pallet::Call), + Vesting(runtime_types::pallet_vesting::pallet::Call), + Scheduler(runtime_types::pallet_scheduler::pallet::Call), + Proxy(runtime_types::pallet_proxy::pallet::Call), + Multisig(runtime_types::pallet_multisig::pallet::Call), + Bounties(runtime_types::pallet_bounties::pallet::Call), + Tips(runtime_types::pallet_tips::pallet::Call), + Assets(runtime_types::pallet_assets::pallet::Call), + Lottery(runtime_types::pallet_lottery::pallet::Call), + Gilt(runtime_types::pallet_gilt::pallet::Call), + Uniques(runtime_types::pallet_uniques::pallet::Call), + TransactionStorage( + runtime_types::pallet_transaction_storage::pallet::Call, + ), + BagsList(runtime_types::pallet_bags_list::pallet::Call), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + System(runtime_types::frame_system::pallet::Event), + Utility(runtime_types::pallet_utility::pallet::Event), + Indices(runtime_types::pallet_indices::pallet::Event), + Balances(runtime_types::pallet_balances::pallet::Event), + ElectionProviderMultiPhase( + runtime_types::pallet_election_provider_multi_phase::pallet::Event, + ), + Staking(runtime_types::pallet_staking::pallet::pallet::Event), + Session(runtime_types::pallet_session::pallet::Event), + Democracy(runtime_types::pallet_democracy::pallet::Event), + Council(runtime_types::pallet_collective::pallet::Event), + TechnicalCommittee(runtime_types::pallet_collective::pallet::Event), + Elections(runtime_types::pallet_elections_phragmen::pallet::Event), + TechnicalMembership(runtime_types::pallet_membership::pallet::Event), + Grandpa(runtime_types::pallet_grandpa::pallet::Event), + Treasury(runtime_types::pallet_treasury::pallet::Event), + Contracts(runtime_types::pallet_contracts::pallet::Event), + Sudo(runtime_types::pallet_sudo::pallet::Event), + ImOnline(runtime_types::pallet_im_online::pallet::Event), + Offences(runtime_types::pallet_offences::pallet::Event), + Identity(runtime_types::pallet_identity::pallet::Event), + Society(runtime_types::pallet_society::pallet::Event), + Recovery(runtime_types::pallet_recovery::pallet::Event), + Vesting(runtime_types::pallet_vesting::pallet::Event), + Scheduler(runtime_types::pallet_scheduler::pallet::Event), + Proxy(runtime_types::pallet_proxy::pallet::Event), + Multisig(runtime_types::pallet_multisig::pallet::Event), + Bounties(runtime_types::pallet_bounties::pallet::Event), + Tips(runtime_types::pallet_tips::pallet::Event), + Assets(runtime_types::pallet_assets::pallet::Event), + Lottery(runtime_types::pallet_lottery::pallet::Event), + Gilt(runtime_types::pallet_gilt::pallet::Event), + Uniques(runtime_types::pallet_uniques::pallet::Event), + TransactionStorage( + runtime_types::pallet_transaction_storage::pallet::Event, + ), + BagsList(runtime_types::pallet_bags_list::pallet::Event), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NposSolution16 { + votes1: Vec<(u32, u16)>, + votes2: Vec<( + u32, + (u16, runtime_types::sp_arithmetic::per_things::PerU16), + u16, + )>, + votes3: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 2usize], + u16, + )>, + votes4: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 3usize], + u16, + )>, + votes5: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 4usize], + u16, + )>, + votes6: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 5usize], + u16, + )>, + votes7: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 6usize], + u16, + )>, + votes8: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 7usize], + u16, + )>, + votes9: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 8usize], + u16, + )>, + votes10: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 9usize], + u16, + )>, + votes11: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 10usize], + u16, + )>, + votes12: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 11usize], + u16, + )>, + votes13: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 12usize], + u16, + )>, + votes14: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 13usize], + u16, + )>, + votes15: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 14usize], + u16, + )>, + votes16: Vec<( + u32, + [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 15usize], + u16, + )>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum OriginCaller { + system( + runtime_types::frame_system::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + Council( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + TechnicalCommittee( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + Void(runtime_types::sp_core::Void), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum ProxyType { + Any, + NonTransfer, + Governance, + Staking, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Runtime {} + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 authority_discovery: + runtime_types::sp_authority_discovery::app::Public, } + } + pub mod pallet_assets { + use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - propose { - proposal_hash: ::subxt::sp_core::H256, + create { #[codec(compact)] - value: u128, + id: u32, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + min_balance: u64, }, - second { + force_create { #[codec(compact)] - proposal: u32, + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + is_sufficient: bool, #[codec(compact)] - seconds_upper_bound: u32, + min_balance: u64, }, - vote { + destroy { #[codec(compact)] - ref_index: u32, - vote: runtime_types::pallet_democracy::vote::AccountVote, - }, - emergency_cancel { - ref_index: u32, - }, - external_propose { - proposal_hash: ::subxt::sp_core::H256, - }, - external_propose_majority { - proposal_hash: ::subxt::sp_core::H256, + id: u32, + witness: runtime_types::pallet_assets::types::DestroyWitness, }, - external_propose_default { - proposal_hash: ::subxt::sp_core::H256, + mint { + #[codec(compact)] + id: u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, }, - fast_track { - proposal_hash: ::subxt::sp_core::H256, - voting_period: u32, - delay: u32, + burn { + #[codec(compact)] + id: u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, }, - veto_external { - proposal_hash: ::subxt::sp_core::H256, + transfer { + #[codec(compact)] + id: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, }, - cancel_referendum { + transfer_keep_alive { #[codec(compact)] - ref_index: u32, + id: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, }, - cancel_queued { - which: u32, + force_transfer { + #[codec(compact)] + id: u32, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, }, - delegate { - to: ::subxt::sp_core::crypto::AccountId32, - conviction: - runtime_types::pallet_democracy::conviction::Conviction, - balance: u128, + freeze { + #[codec(compact)] + id: u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, }, - undelegate, - clear_public_proposals, - note_preimage { - encoded_proposal: Vec, + thaw { + #[codec(compact)] + id: u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, }, - note_preimage_operational { - encoded_proposal: Vec, + freeze_asset { + #[codec(compact)] + id: u32, }, - note_imminent_preimage { - encoded_proposal: Vec, + thaw_asset { + #[codec(compact)] + id: u32, }, - note_imminent_preimage_operational { - encoded_proposal: Vec, + transfer_ownership { + #[codec(compact)] + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, }, - reap_preimage { - proposal_hash: ::subxt::sp_core::H256, + set_team { #[codec(compact)] - proposal_len_upper_bound: u32, + id: u32, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, }, - unlock { - target: ::subxt::sp_core::crypto::AccountId32, + set_metadata { + #[codec(compact)] + id: u32, + name: Vec, + symbol: Vec, + decimals: u8, }, - remove_vote { - index: u32, + clear_metadata { + #[codec(compact)] + id: u32, }, - remove_other_vote { - target: ::subxt::sp_core::crypto::AccountId32, - index: u32, + force_set_metadata { + #[codec(compact)] + id: u32, + name: Vec, + symbol: Vec, + decimals: u8, + is_frozen: bool, }, - enact_proposal { - proposal_hash: ::subxt::sp_core::H256, - index: u32, + force_clear_metadata { + #[codec(compact)] + id: u32, }, - blacklist { - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: Option, + force_asset_status { + #[codec(compact)] + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + min_balance: u64, + is_sufficient: bool, + is_frozen: bool, }, - cancel_proposal { + approve_transfer { #[codec(compact)] - prop_index: u32, + id: u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, + }, + cancel_approval { + #[codec(compact)] + id: u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + }, + force_cancel_approval { + #[codec(compact)] + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + }, + transfer_approved { + #[codec(compact)] + id: u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + destination: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + amount: u64, }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - ValueLow, - ProposalMissing, - AlreadyCanceled, - DuplicateProposal, - ProposalBlacklisted, - NotSimpleMajority, - InvalidHash, - NoProposal, - AlreadyVetoed, - DuplicatePreimage, - NotImminent, - TooEarly, - Imminent, - PreimageMissing, - ReferendumInvalid, - PreimageInvalid, - NoneWaiting, - NotVoter, + BalanceLow, + BalanceZero, NoPermission, - AlreadyDelegating, - InsufficientFunds, - NotDelegating, - VotesExist, - InstantNotAllowed, - Nonsense, - WrongUpperBound, - MaxVotesReached, - TooManyProposals, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + Unknown, + Frozen, + InUse, + BadWitness, + MinBalanceZero, + NoProvider, + BadMetadata, + Unapproved, + WouldDie, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - Proposed(u32, u128), - Tabled(u32, u128, Vec<::subxt::sp_core::crypto::AccountId32>), - ExternalTabled, - Started( + Created( u32, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - ), - Passed(u32), - NotPassed(u32), - Cancelled(u32), - Executed(u32, Result<(), runtime_types::sp_runtime::DispatchError>), - Delegated( ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, ), - Undelegated(::subxt::sp_core::crypto::AccountId32), - Vetoed( + Issued(u32, ::subxt::sp_core::crypto::AccountId32, u64), + Transferred( + u32, ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u64, + ), + Burned(u32, ::subxt::sp_core::crypto::AccountId32, u64), + TeamChanged( u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, ), - PreimageNoted( - ::subxt::sp_core::H256, + OwnerChanged(u32, ::subxt::sp_core::crypto::AccountId32), + Frozen(u32, ::subxt::sp_core::crypto::AccountId32), + Thawed(u32, ::subxt::sp_core::crypto::AccountId32), + AssetFrozen(u32), + AssetThawed(u32), + Destroyed(u32), + ForceCreated(u32, ::subxt::sp_core::crypto::AccountId32), + MetadataSet(u32, Vec, Vec, u8, bool), + MetadataCleared(u32), + ApprovedTransfer( + u32, ::subxt::sp_core::crypto::AccountId32, - u128, + ::subxt::sp_core::crypto::AccountId32, + u64, ), - PreimageUsed( - ::subxt::sp_core::H256, + ApprovalCancelled( + u32, + ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, - u128, ), - PreimageInvalid(::subxt::sp_core::H256, u32), - PreimageMissing(::subxt::sp_core::H256, u32), - PreimageReaped( - ::subxt::sp_core::H256, + TransferredApproved( + u32, + ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, - u128, ::subxt::sp_core::crypto::AccountId32, + u64, ), - Blacklisted(::subxt::sp_core::H256), + AssetStatusChanged(u32), } } pub mod types { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Delegations<_0> { - pub votes: _0, - pub capital: _0, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum ReferendumInfo<_0, _1, _2> { - Ongoing( - runtime_types::pallet_democracy::types::ReferendumStatus< - _0, - _1, - _2, - >, - ), - Finished { - approved: bool, - end: _0, - }, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Approval<_0, _1> { + pub amount: _0, + pub deposit: _1, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - 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)] + pub struct AssetBalance<_0, _1> { + pub balance: _0, + pub is_frozen: bool, + pub sufficient: bool, + pub extra: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetDetails<_0, _1, _2> { + pub owner: _1, + pub issuer: _1, + pub admin: _1, + pub freezer: _1, + pub supply: _0, + pub deposit: _2, + pub min_balance: _0, + pub is_sufficient: bool, + pub accounts: u32, + pub sufficients: u32, + pub approvals: u32, + pub is_frozen: bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetMetadata<_0, _1> { + pub deposit: _0, + pub name: _1, + pub symbol: _1, + pub decimals: u8, + pub is_frozen: bool, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Tally<_0> { - pub ayes: _0, - pub nays: _0, - pub turnout: _0, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DestroyWitness { + #[codec(compact)] + pub accounts: u32, + #[codec(compact)] + pub sufficients: u32, + #[codec(compact)] + pub approvals: u32, } } - pub mod vote { + } + pub mod pallet_authorship { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum AccountVote<_0> { - Standard { - vote: runtime_types::pallet_democracy::vote::Vote, - balance: _0, - }, - Split { - aye: _0, - nay: _0, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + set_uncles { + new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct PriorLock<_0, _1>(pub _0, pub _1); - #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, - :: codec :: CompactAs, - )] - pub struct Vote(u8); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Voting<_0, _1, _2> { - Direct { - votes: 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>, - }, - 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>, - }, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidUncleParent, + UnclesAlreadySet, + TooManyUncles, + GenesisUncle, + TooHighUncle, + UncleAlreadyIncluded, + OldUncle, } } - pub mod vote_threshold { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum UncleEntryItem<_0, _1, _2> { + InclusionHeight(_0), + Uncle(_1, Option<_2>), + } + } + pub mod pallet_babe { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum VoteThreshold { - SuperMajorityApprove, - SuperMajorityAgainst, - SimpleMajority, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + report_equivocation { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , report_equivocation_unsigned { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidEquivocationProof, + InvalidKeyOwnershipProof, + DuplicateOffenceReport, } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum PreimageStatus<_0, _1, _2> { - Missing(_2), - Available { - data: Vec, - provider: _0, - deposit: _1, - since: _2, - expiry: Option<_2>, - }, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Releases { - V1, - } } - pub mod pallet_election_provider_multi_phase { + pub mod pallet_bags_list { use super::runtime_types; + pub mod list { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bag { + pub head: Option<::subxt::sp_core::crypto::AccountId32>, + pub tail: Option<::subxt::sp_core::crypto::AccountId32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Node { + pub id: ::subxt::sp_core::crypto::AccountId32, + pub prev: Option<::subxt::sp_core::crypto::AccountId32>, + pub next: Option<::subxt::sp_core::crypto::AccountId32>, + pub bag_upper: u64, + } + } pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - 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 , } , set_minimum_untrusted_score { maybe_next_score : Option < [u128 ; 3usize] > , } , set_emergency_election_result { supports : Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , num_signed_submissions : u32 , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - PreDispatchEarlySubmission, - PreDispatchWrongWinnerCount, - PreDispatchWeakSubmission, - SignedQueueFull, - SignedCannotPayDeposit, - SignedInvalidWitness, - SignedTooMuchWeight, - OcwCallWrongEra, - MissingSnapshotMetadata, - InvalidSubmissionIndex, - CallNotAllowed, + rebag { + dislocated: ::subxt::sp_core::crypto::AccountId32, + }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , bool ,) , ElectionFinalized (Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , SignedPhaseStarted (u32 ,) , UnsignedPhaseStarted (u32 ,) , } - } - pub mod signed { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - 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, + Rebagged(::subxt::sp_core::crypto::AccountId32, u64, u64), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum ElectionCompute { - OnChain, - Signed, - Unsigned, - Fallback, - Emergency, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Phase<_0> { - Off, - Signed, - Unsigned((bool, _0)), - Emergency, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RawSolution<_0> { - pub solution: _0, - pub score: [u128; 3usize], - pub round: u32, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ReadySolution<_0> { - pub supports: Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, - pub score: [u128; 3usize], - pub compute: - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct RoundSnapshot<_0> { - pub voters: Vec<(_0, u64, Vec<_0>)>, - pub targets: Vec<_0>, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SolutionOrSnapshotSize { - #[codec(compact)] - pub voters: u32, - #[codec(compact)] - pub targets: u32, - } } - pub mod pallet_elections_phragmen { + pub mod pallet_balances { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - vote { - votes: Vec<::subxt::sp_core::crypto::AccountId32>, + transfer { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, #[codec(compact)] value: u128, }, - remove_voter, - submit_candidacy { + set_balance { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, #[codec(compact)] - candidate_count: u32, + new_free: u128, + #[codec(compact)] + new_reserved: u128, }, - renounce_candidacy { - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + force_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + #[codec(compact)] + value: u128, }, - remove_member { - who: ::subxt::sp_runtime::MultiAddress< + transfer_keep_alive { + dest: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, - (), + u32, >, - has_replacement: bool, + #[codec(compact)] + value: u128, }, - clean_defunct_voters { - num_voters: u32, - num_defunct: u32, + transfer_all { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + keep_alive: bool, + }, + force_unreserve { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + amount: u128, }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - UnableToVote, - NoVotes, - TooManyVotes, - MaximumVotesExceeded, - LowBalance, - UnableToPayBond, - MustBeVoter, - ReportSelf, - DuplicatedCandidate, - MemberSubmit, - RunnerUpSubmit, - InsufficientCandidateFunds, - NotMember, - InvalidWitnessData, - InvalidVoteCount, - InvalidRenouncing, - InvalidReplacement, + VestingBalance, + LiquidityRestrictions, + InsufficientBalance, + ExistentialDeposit, + KeepAlive, + ExistingVestingSchedule, + DeadAccount, + TooManyReserves, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - NewTerm(Vec<(::subxt::sp_core::crypto::AccountId32, u128)>), - EmptyTerm, - ElectionError, - MemberKicked(::subxt::sp_core::crypto::AccountId32), - Renounced(::subxt::sp_core::crypto::AccountId32), - CandidateSlashed(::subxt::sp_core::crypto::AccountId32, u128), - SeatHolderSlashed(::subxt::sp_core::crypto::AccountId32, u128), + Endowed(::subxt::sp_core::crypto::AccountId32, u128), + DustLost(::subxt::sp_core::crypto::AccountId32, u128), + Transfer( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + BalanceSet(::subxt::sp_core::crypto::AccountId32, u128, u128), + Reserved(::subxt::sp_core::crypto::AccountId32, u128), + Unreserved(::subxt::sp_core::crypto::AccountId32, u128), + ReserveRepatriated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + ), + Deposit(::subxt::sp_core::crypto::AccountId32, u128), + Withdraw(::subxt::sp_core::crypto::AccountId32, u128), + Slashed(::subxt::sp_core::crypto::AccountId32, u128), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Renouncing { - Member, - RunnerUp, - Candidate(u32), + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AccountData<_0> { + pub free: _0, + pub reserved: _0, + pub misc_frozen: _0, + pub fee_frozen: _0, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct SeatHolder<_0, _1> { - pub who: _0, - pub stake: _1, - pub deposit: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BalanceLock<_0> { + pub id: [u8; 8usize], + pub amount: _0, + pub reasons: runtime_types::pallet_balances::Reasons, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Voter<_0, _1> { - pub votes: Vec<_0>, - pub stake: _1, - pub deposit: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Reasons { + Fee, + Misc, + All, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1_0_0, + V2_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReserveData<_0, _1> { + pub id: _0, + pub amount: _1, } } - pub mod pallet_grandpa { + pub mod pallet_bounties { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - report_equivocation { - equivocation_proof: std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - u32, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, + propose_bounty { + #[codec(compact)] + value: u128, + description: Vec, }, - report_equivocation_unsigned { - equivocation_proof: std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - u32, - >, + approve_bounty { + #[codec(compact)] + bounty_id: u32, + }, + propose_curator { + #[codec(compact)] + bounty_id: u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, >, - key_owner_proof: runtime_types::sp_session::MembershipProof, + #[codec(compact)] + fee: u128, }, - note_stalled { - delay: u32, - best_finalized_block_number: u32, + unassign_curator { + #[codec(compact)] + bounty_id: u32, + }, + accept_curator { + #[codec(compact)] + bounty_id: u32, + }, + award_bounty { + #[codec(compact)] + bounty_id: u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + }, + claim_bounty { + #[codec(compact)] + bounty_id: u32, + }, + close_bounty { + #[codec(compact)] + bounty_id: u32, + }, + extend_bounty_expiry { + #[codec(compact)] + bounty_id: u32, + remark: Vec, }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - PauseFailed, - ResumeFailed, - ChangePending, - TooSoon, - InvalidKeyOwnershipProof, - InvalidEquivocationProof, - DuplicateOffenceReport, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InsufficientProposersBalance, + InvalidIndex, + ReasonTooBig, + UnexpectedStatus, + RequireCurator, + InvalidValue, + InvalidFee, + PendingPayout, + Premature, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - NewAuthorities( - Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, - ), - Paused, - Resumed, + BountyProposed(u32), + BountyRejected(u32, u128), + BountyBecameActive(u32), + BountyAwarded(u32, ::subxt::sp_core::crypto::AccountId32), + BountyClaimed(u32, u128, ::subxt::sp_core::crypto::AccountId32), + BountyCanceled(u32), + BountyExtended(u32), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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 , u64 ,) > , pub forced : Option < _0 > , } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum StoredState<_0> { - Live, - PendingPause { scheduled_at: _0, delay: _0 }, - Paused, - PendingResume { scheduled_at: _0, delay: _0 }, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum BountyStatus<_0, _1> { + Proposed, + Approved, + Funded, + CuratorProposed { + curator: _0, + }, + Active { + curator: _0, + update_due: _1, + }, + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, } } - pub mod pallet_identity { + pub mod pallet_collective { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - add_registrar { - account: ::subxt::sp_core::crypto::AccountId32, - }, - set_identity { - info: std::boxed::Box< - runtime_types::pallet_identity::types::IdentityInfo, - >, - }, - set_subs { - subs: Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, + set_members { + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: Option<::subxt::sp_core::crypto::AccountId32>, + old_count: u32, }, - clear_identity, - request_judgement { - #[codec(compact)] - reg_index: u32, + execute { + proposal: std::boxed::Box, #[codec(compact)] - max_fee: u128, - }, - cancel_request { - reg_index: u32, + length_bound: u32, }, - set_fee { + propose { #[codec(compact)] - index: u32, + threshold: u32, + proposal: std::boxed::Box, #[codec(compact)] - fee: u128, + length_bound: u32, }, - set_account_id { + vote { + proposal: ::subxt::sp_core::H256, #[codec(compact)] index: u32, - new: ::subxt::sp_core::crypto::AccountId32, + approve: bool, }, - set_fields { + close { + proposal_hash: ::subxt::sp_core::H256, #[codec(compact)] index: u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - }, - provide_judgement { #[codec(compact)] - reg_index: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - judgement: runtime_types::pallet_identity::types::Judgement, - }, - kill_identity { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - add_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, - }, - rename_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - data: runtime_types::pallet_identity::types::Data, + proposal_weight_bound: u64, + #[codec(compact)] + length_bound: u32, }, - remove_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, + disapprove_proposal { + proposal_hash: ::subxt::sp_core::H256, }, - quit_sub, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - TooManySubAccounts, - NotFound, - NotNamed, - EmptyIndex, - FeeChanged, - NoIdentity, - StickyJudgement, - JudgementGiven, - InvalidJudgement, - InvalidIndex, - InvalidTarget, - TooManyFields, - TooManyRegistrars, - AlreadyClaimed, - NotSub, - NotOwned, + NotMember, + DuplicateProposal, + ProposalMissing, + WrongIndex, + DuplicateVote, + AlreadyInitialized, + TooEarly, + TooManyProposals, + WrongProposalWeight, + WrongProposalLength, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - IdentitySet(::subxt::sp_core::crypto::AccountId32), - IdentityCleared(::subxt::sp_core::crypto::AccountId32, u128), - IdentityKilled(::subxt::sp_core::crypto::AccountId32, u128), - JudgementRequested(::subxt::sp_core::crypto::AccountId32, u32), - JudgementUnrequested(::subxt::sp_core::crypto::AccountId32, u32), - JudgementGiven(::subxt::sp_core::crypto::AccountId32, u32), - RegistrarAdded(u32), - SubIdentityAdded( - ::subxt::sp_core::crypto::AccountId32, + Proposed( ::subxt::sp_core::crypto::AccountId32, - u128, + u32, + ::subxt::sp_core::H256, + u32, ), - SubIdentityRemoved( - ::subxt::sp_core::crypto::AccountId32, + Voted( ::subxt::sp_core::crypto::AccountId32, - u128, + ::subxt::sp_core::H256, + bool, + u32, + u32, ), - SubIdentityRevoked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, + Approved(::subxt::sp_core::H256), + Disapproved(::subxt::sp_core::H256), + Executed( + ::subxt::sp_core::H256, + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + MemberExecuted( + ::subxt::sp_core::H256, + Result<(), runtime_types::sp_runtime::DispatchError>, ), + Closed(::subxt::sp_core::H256, u32, u32), } } - pub mod types { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum RawOrigin<_0> { + Members(u32, u32), + Member(_0), + _Phantom, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Votes<_0, _1> { + pub index: _1, + pub threshold: _1, + pub ayes: Vec<_0>, + pub nays: Vec<_0>, + pub end: _1, + } + } + pub mod pallet_contracts { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, - :: codec :: CompactAs, - )] - pub struct BitFlags<_0>( - pub u64, - #[codec(skip)] pub ::core::marker::PhantomData<_0>, - ); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Data { - None, - Raw0([u8; 0usize]), - Raw1([u8; 1usize]), - Raw2([u8; 2usize]), - Raw3([u8; 3usize]), - Raw4([u8; 4usize]), - Raw5([u8; 5usize]), - Raw6([u8; 6usize]), - Raw7([u8; 7usize]), - Raw8([u8; 8usize]), - Raw9([u8; 9usize]), - Raw10([u8; 10usize]), - Raw11([u8; 11usize]), - Raw12([u8; 12usize]), - Raw13([u8; 13usize]), - Raw14([u8; 14usize]), - Raw15([u8; 15usize]), - Raw16([u8; 16usize]), - Raw17([u8; 17usize]), - Raw18([u8; 18usize]), - Raw19([u8; 19usize]), - Raw20([u8; 20usize]), - Raw21([u8; 21usize]), - Raw22([u8; 22usize]), - Raw23([u8; 23usize]), - Raw24([u8; 24usize]), - Raw25([u8; 25usize]), - Raw26([u8; 26usize]), - Raw27([u8; 27usize]), - Raw28([u8; 28usize]), - Raw29([u8; 29usize]), - Raw30([u8; 30usize]), - Raw31([u8; 31usize]), - Raw32([u8; 32usize]), - BlakeTwo256([u8; 32usize]), - Sha256([u8; 32usize]), - Keccak256([u8; 32usize]), - ShaThree256([u8; 32usize]), - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum IdentityField { - Display, - Legal, - Web, - Riot, - Email, - PgpFingerprint, - Image, - Twitter, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - 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: Option<[u8; 20usize]>, - pub image: runtime_types::pallet_identity::types::Data, - pub twitter: runtime_types::pallet_identity::types::Data, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Judgement<_0> { - Unknown, - FeePaid(_0), - Reasonable, - KnownGood, - OutOfDate, - LowQuality, - Erroneous, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - 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( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Registration<_0> { - pub judgements: - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + call { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, u32, - runtime_types::pallet_identity::types::Judgement<_0>, - )>, - pub deposit: _0, - pub info: runtime_types::pallet_identity::types::IdentityInfo, + >, + #[codec(compact)] + value: u128, + #[codec(compact)] + gas_limit: u64, + data: Vec, + }, + instantiate_with_code { + #[codec(compact)] + endowment: u128, + #[codec(compact)] + gas_limit: u64, + code: Vec, + data: Vec, + salt: Vec, + }, + instantiate { + #[codec(compact)] + endowment: u128, + #[codec(compact)] + gas_limit: u64, + code_hash: ::subxt::sp_core::H256, + data: Vec, + salt: Vec, + }, } - } - } - pub mod pallet_im_online { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - InvalidKey, - DuplicatedHeartbeat, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + InvalidScheduleVersion, + OutOfGas, + OutputBufferTooSmall, + BelowSubsistenceThreshold, + NewContractNotFunded, + TransferFailed, + MaxCallDepthReached, + ContractNotFound, + CodeTooLarge, + CodeNotFound, + OutOfBounds, + DecodingFailed, + ContractTrapped, + ValueTooLarge, + TerminatedWhileReentrant, + InputForwarded, + RandomSubjectTooLong, + TooManyTopics, + DuplicateTopics, + NoChainExtension, + DeletionQueueFull, + StorageExhausted, + DuplicateContract, + TerminatedInConstructor, + DebugMessageInvalidUTF8, + ReentranceDenied, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - HeartbeatReceived( - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - ), - AllGood, - SomeOffline( - Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - )>, - ), + Instantiated { + deployer: ::subxt::sp_core::crypto::AccountId32, + contract: ::subxt::sp_core::crypto::AccountId32, + }, + Terminated { + contract: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + CodeStored { + code_hash: ::subxt::sp_core::H256, + }, + ScheduleUpdated { + version: u32, + }, + ContractEmitted { + contract: ::subxt::sp_core::crypto::AccountId32, + data: Vec, + }, + CodeRemoved { + code_hash: ::subxt::sp_core::H256, + }, } } - pub mod sr25519 { + pub mod schedule { use super::runtime_types; - pub mod app_sr25519 { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct HostFnWeights { + pub caller: u64, + pub address: u64, + pub gas_left: u64, + pub balance: u64, + pub value_transferred: u64, + pub minimum_balance: u64, + pub contract_deposit: u64, + pub block_number: u64, + pub now: u64, + pub weight_to_fee: u64, + pub gas: u64, + pub input: u64, + pub input_per_byte: u64, + pub r#return: u64, + pub return_per_byte: u64, + pub terminate: u64, + pub random: u64, + pub deposit_event: u64, + pub deposit_event_per_topic: u64, + pub deposit_event_per_byte: u64, + pub debug_message: u64, + pub set_storage: u64, + pub set_storage_per_byte: u64, + pub clear_storage: u64, + pub get_storage: u64, + pub get_storage_per_byte: u64, + pub transfer: u64, + pub call: u64, + pub call_transfer_surcharge: u64, + pub call_per_input_byte: u64, + pub call_per_output_byte: u64, + pub instantiate: u64, + pub instantiate_per_input_byte: u64, + pub instantiate_per_output_byte: u64, + pub instantiate_per_salt_byte: u64, + pub hash_sha2_256: u64, + pub hash_sha2_256_per_byte: u64, + pub hash_keccak_256: u64, + pub hash_keccak_256_per_byte: u64, + pub hash_blake2_256: u64, + pub hash_blake2_256_per_byte: u64, + pub hash_blake2_128: u64, + pub hash_blake2_128_per_byte: u64, + pub ecdsa_recover: u64, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstructionWeights { + pub version: u32, + pub i64const: u32, + pub i64load: u32, + pub i64store: u32, + pub select: u32, + pub r#if: u32, + pub br: u32, + pub br_if: u32, + pub br_table: u32, + pub br_table_per_entry: u32, + pub call: u32, + pub call_indirect: u32, + pub call_indirect_per_param: u32, + pub local_get: u32, + pub local_set: u32, + pub local_tee: u32, + pub global_get: u32, + pub global_set: u32, + pub memory_current: u32, + pub memory_grow: u32, + pub i64clz: u32, + pub i64ctz: u32, + pub i64popcnt: u32, + pub i64eqz: u32, + pub i64extendsi32: u32, + pub i64extendui32: u32, + pub i32wrapi64: u32, + pub i64eq: u32, + pub i64ne: u32, + pub i64lts: u32, + pub i64ltu: u32, + pub i64gts: u32, + pub i64gtu: u32, + pub i64les: u32, + pub i64leu: u32, + pub i64ges: u32, + pub i64geu: u32, + pub i64add: u32, + pub i64sub: u32, + pub i64mul: u32, + pub i64divs: u32, + pub i64divu: u32, + pub i64rems: u32, + pub i64remu: u32, + pub i64and: u32, + pub i64or: u32, + pub i64xor: u32, + pub i64shl: u32, + pub i64shrs: u32, + pub i64shru: u32, + pub i64rotl: u32, + pub i64rotr: u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Limits { + pub event_topics: u32, + pub stack_height: u32, + pub globals: u32, + pub parameters: u32, + pub memory_pages: u32, + pub table_size: u32, + pub br_table_size: u32, + pub subject_len: u32, + pub call_depth: u32, + pub payload_len: u32, + pub code_len: u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Schedule { + pub limits: runtime_types::pallet_contracts::schedule::Limits, + pub instruction_weights: + runtime_types::pallet_contracts::schedule::InstructionWeights, + pub host_fn_weights: + runtime_types::pallet_contracts::schedule::HostFnWeights, } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct BoundedOpaqueNetworkState { pub peer_id : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > , pub external_addresses : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > > , } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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 { + pub mod storage { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - claim { - index: u32, - }, - transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: u32, - }, - free { - index: u32, - }, - force_transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: u32, - freeze: bool, - }, - freeze { - index: u32, - }, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DeletedContract { + pub trie_id: Vec, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - NotAssigned, - NotOwner, - InUse, - NotTransfer, - Permanent, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RawContractInfo<_0> { + pub trie_id: Vec, + pub code_hash: _0, + pub _reserved: Option<()>, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - IndexAssigned(::subxt::sp_core::crypto::AccountId32, u32), - IndexFreed(u32), - IndexFrozen(u32, ::subxt::sp_core::crypto::AccountId32), + } + pub mod wasm { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PrefabWasmModule { + #[codec(compact)] + pub instruction_weights_version: u32, + #[codec(compact)] + pub initial: u32, + #[codec(compact)] + pub maximum: u32, + #[codec(compact)] + pub refcount: u64, + pub _reserved: Option<()>, + pub code: Vec, + pub original_code_len: u32, } } } - pub mod pallet_membership { + pub mod pallet_democracy { use super::runtime_types; + pub mod conviction { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Conviction { + None, + Locked1x, + Locked2x, + Locked3x, + Locked4x, + Locked5x, + Locked6x, + } + } pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - add_member { - who: ::subxt::sp_core::crypto::AccountId32, + propose { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + value: u128, }, - remove_member { - who: ::subxt::sp_core::crypto::AccountId32, + second { + #[codec(compact)] + proposal: u32, + #[codec(compact)] + seconds_upper_bound: u32, }, - swap_member { - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, + vote { + #[codec(compact)] + ref_index: u32, + vote: runtime_types::pallet_democracy::vote::AccountVote, }, - reset_members { - members: Vec<::subxt::sp_core::crypto::AccountId32>, + emergency_cancel { + ref_index: u32, }, - change_key { - new: ::subxt::sp_core::crypto::AccountId32, + external_propose { + proposal_hash: ::subxt::sp_core::H256, }, - set_prime { - who: ::subxt::sp_core::crypto::AccountId32, + external_propose_majority { + proposal_hash: ::subxt::sp_core::H256, }, - clear_prime, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - AlreadyMember, - NotMember, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - MemberAdded, - MemberRemoved, - MembersSwapped, - MembersReset, - KeyChanged, - Dummy, - } - } - } - pub mod pallet_multisig { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - as_multi_threshold_1 { - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - call: std::boxed::Box, + external_propose_default { + proposal_hash: ::subxt::sp_core::H256, }, - as_multi { - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: - Option>, - call: Vec, - store_call: bool, - max_weight: u64, + fast_track { + proposal_hash: ::subxt::sp_core::H256, + voting_period: u32, + delay: u32, }, - approve_as_multi { - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: - Option>, - call_hash: [u8; 32usize], - max_weight: u64, + veto_external { + proposal_hash: ::subxt::sp_core::H256, }, - cancel_as_multi { - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: runtime_types::pallet_multisig::Timepoint, - call_hash: [u8; 32usize], + cancel_referendum { + #[codec(compact)] + ref_index: u32, + }, + cancel_queued { + which: u32, + }, + delegate { + to: ::subxt::sp_core::crypto::AccountId32, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + balance: u128, + }, + undelegate, + clear_public_proposals, + note_preimage { + encoded_proposal: Vec, + }, + note_preimage_operational { + encoded_proposal: Vec, + }, + note_imminent_preimage { + encoded_proposal: Vec, + }, + note_imminent_preimage_operational { + encoded_proposal: Vec, + }, + reap_preimage { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + proposal_len_upper_bound: u32, + }, + unlock { + target: ::subxt::sp_core::crypto::AccountId32, + }, + remove_vote { + index: u32, + }, + remove_other_vote { + target: ::subxt::sp_core::crypto::AccountId32, + index: u32, + }, + enact_proposal { + proposal_hash: ::subxt::sp_core::H256, + index: u32, + }, + blacklist { + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: Option, + }, + cancel_proposal { + #[codec(compact)] + prop_index: u32, }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - MinimumThreshold, - AlreadyApproved, - NoApprovalsNeeded, - TooFewSignatories, - TooManySignatories, - SignatoriesOutOfOrder, - SenderInSignatories, - NotFound, - NotOwner, - NoTimepoint, - WrongTimepoint, - UnexpectedTimepoint, - MaxWeightTooLow, - AlreadyStored, + ValueLow, + ProposalMissing, + AlreadyCanceled, + DuplicateProposal, + ProposalBlacklisted, + NotSimpleMajority, + InvalidHash, + NoProposal, + AlreadyVetoed, + DuplicatePreimage, + NotImminent, + TooEarly, + Imminent, + PreimageMissing, + ReferendumInvalid, + PreimageInvalid, + NoneWaiting, + NotVoter, + NoPermission, + AlreadyDelegating, + InsufficientFunds, + NotDelegating, + VotesExist, + InstantNotAllowed, + Nonsense, + WrongUpperBound, + MaxVotesReached, + TooManyProposals, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - NewMultisig( + Proposed(u32, u128), + Tabled(u32, u128, Vec<::subxt::sp_core::crypto::AccountId32>), + ExternalTabled, + Started( + u32, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ), + Passed(u32), + NotPassed(u32), + Cancelled(u32), + Executed(u32, Result<(), runtime_types::sp_runtime::DispatchError>), + Delegated( ::subxt::sp_core::crypto::AccountId32, ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], ), - MultisigApproval( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint, + Undelegated(::subxt::sp_core::crypto::AccountId32), + Vetoed( ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], + ::subxt::sp_core::H256, + u32, ), - MultisigExecuted( + PreimageNoted( + ::subxt::sp_core::H256, ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint, + u128, + ), + PreimageUsed( + ::subxt::sp_core::H256, ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], - Result<(), runtime_types::sp_runtime::DispatchError>, + u128, ), - MultisigCancelled( + PreimageInvalid(::subxt::sp_core::H256, u32), + PreimageMissing(::subxt::sp_core::H256, u32), + PreimageReaped( + ::subxt::sp_core::H256, ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint, + u128, ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], ), + Blacklisted(::subxt::sp_core::H256), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Multisig<_0, _1, _2> { - pub when: runtime_types::pallet_multisig::Timepoint<_0>, - pub deposit: _1, - pub depositor: _2, - pub approvals: Vec<_2>, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Timepoint<_0> { - pub height: _0, - pub index: _0, - } - } - pub mod pallet_offences { - use super::runtime_types; - pub mod pallet { + pub mod types { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - Offence([u8; 16usize], Vec), + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Delegations<_0> { + pub votes: _0, + pub capital: _0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum ReferendumInfo<_0, _1, _2> { + Ongoing( + runtime_types::pallet_democracy::types::ReferendumStatus< + _0, + _1, + _2, + >, + ), + Finished { + approved: bool, + end: _0, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct Tally<_0> { + pub ayes: _0, + pub nays: _0, + pub turnout: _0, } } - } - pub mod pallet_proxy { - use super::runtime_types; - pub mod pallet { + pub mod vote { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - proxy { - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: - Option, - call: std::boxed::Box, - }, - add_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: u32, - }, - remove_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: u32, - }, - remove_proxies, - anonymous { - proxy_type: runtime_types::polkadot_runtime::ProxyType, - delay: u32, - index: u16, - }, - kill_anonymous { - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::polkadot_runtime::ProxyType, - index: u16, - #[codec(compact)] - height: u32, - #[codec(compact)] - ext_index: u32, - }, - announce { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - remove_announcement { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - reject_announcement { - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum AccountVote<_0> { + Standard { + vote: runtime_types::pallet_democracy::vote::Vote, + balance: _0, }, - proxy_announced { - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: - Option, - call: std::boxed::Box, + Split { + aye: _0, + nay: _0, }, } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PriorLock<_0, _1>(pub _0, pub _1); #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] - pub enum Error { - TooMany, - NotFound, - NotProxy, - Unproxyable, - Duplicate, - NoPermission, - Unannounced, - NoSelfProxy, + pub struct Vote(u8); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Voting<_0, _1, _2> { + Direct { + votes: 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>, + }, + 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>, + }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - ProxyExecuted(Result<(), runtime_types::sp_runtime::DispatchError>), - AnonymousCreated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - u16, - ), - Announced( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ), - ProxyAdded( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_runtime::ProxyType, - u32, - ), + } + pub mod vote_threshold { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum VoteThreshold { + SuperMajorityApprove, + SuperMajorityAgainst, + SimpleMajority, } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Announcement<_0, _1, _2> { - pub real: _0, - pub call_hash: _1, - pub height: _2, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum PreimageStatus<_0, _1, _2> { + Missing(_2), + Available { + data: Vec, + provider: _0, + deposit: _1, + since: _2, + expiry: Option<_2>, + }, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ProxyDefinition<_0, _1, _2> { - pub delegate: _0, - pub proxy_type: _1, - pub delay: _2, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1, } } - pub mod pallet_scheduler { + pub mod pallet_election_provider_multi_phase { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - schedule { - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - cancel { - when: u32, - index: u32, - }, - schedule_named { - id: Vec, - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - cancel_named { - id: Vec, - }, - schedule_after { - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - schedule_named_after { - id: Vec, - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + submit_unsigned { raw_solution : std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , set_minimum_untrusted_score { maybe_next_score : Option < [u128 ; 3usize] > , } , set_emergency_election_result { supports : Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , num_signed_submissions : u32 , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - FailedToSchedule, - NotFound, - TargetBlockNumberInPast, - RescheduleNoChange, + PreDispatchEarlySubmission, + PreDispatchWrongWinnerCount, + PreDispatchWeakSubmission, + SignedQueueFull, + SignedCannotPayDeposit, + SignedInvalidWitness, + SignedTooMuchWeight, + OcwCallWrongEra, + MissingSnapshotMetadata, + InvalidSubmissionIndex, + CallNotAllowed, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - Scheduled(u32, u32), - Canceled(u32, u32), - Dispatched( - (u32, u32), - Option>, - Result<(), runtime_types::sp_runtime::DispatchError>, - ), + SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , bool ,) , ElectionFinalized (Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , SignedPhaseStarted (u32 ,) , UnsignedPhaseStarted (u32 ,) , } + } + pub mod signed { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Releases { - V1, - V2, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum ElectionCompute { + OnChain, + Signed, + Unsigned, + Fallback, + Emergency, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ScheduledV2<_0, _1, _2, _3> { - pub maybe_id: Option>, - pub priority: u8, - pub call: _0, - pub maybe_periodic: Option<(_1, _1)>, - pub origin: _2, - #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Phase<_0> { + Off, + Signed, + Unsigned((bool, _0)), + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RawSolution<_0> { + pub solution: _0, + pub score: [u128; 3usize], + pub round: u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReadySolution<_0> { + pub supports: Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub score: [u128; 3usize], + pub compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RoundSnapshot<_0> { + pub voters: Vec<(_0, u64, Vec<_0>)>, + pub targets: Vec<_0>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SolutionOrSnapshotSize { + #[codec(compact)] + pub voters: u32, + #[codec(compact)] + pub targets: u32, } } - pub mod pallet_session { + pub mod pallet_elections_phragmen { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - set_keys { - keys: runtime_types::polkadot_runtime::SessionKeys, - proof: Vec, + vote { + votes: Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + value: u128, }, - purge_keys, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InvalidProof, - NoAssociatedValidatorId, - DuplicatedKey, - NoKeys, - NoAccount, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - NewSession(u32), + remove_voter, + submit_candidacy { + #[codec(compact)] + candidate_count: u32, + }, + renounce_candidacy { + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + }, + remove_member { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + has_replacement: bool, + }, + clean_defunct_voters { + num_voters: u32, + num_defunct: u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + UnableToVote, + NoVotes, + TooManyVotes, + MaximumVotesExceeded, + LowBalance, + UnableToPayBond, + MustBeVoter, + ReportSelf, + DuplicatedCandidate, + MemberSubmit, + RunnerUpSubmit, + InsufficientCandidateFunds, + NotMember, + InvalidWitnessData, + InvalidVoteCount, + InvalidRenouncing, + InvalidReplacement, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewTerm(Vec<(::subxt::sp_core::crypto::AccountId32, u128)>), + EmptyTerm, + ElectionError, + MemberKicked(::subxt::sp_core::crypto::AccountId32), + Renounced(::subxt::sp_core::crypto::AccountId32), + CandidateSlashed(::subxt::sp_core::crypto::AccountId32, u128), + SeatHolderSlashed(::subxt::sp_core::crypto::AccountId32, u128), } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Renouncing { + Member, + RunnerUp, + Candidate(u32), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SeatHolder<_0, _1> { + pub who: _0, + pub stake: _1, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Voter<_0, _1> { + pub votes: Vec<_0>, + pub stake: _1, + pub deposit: _1, + } } - pub mod pallet_staking { + pub mod pallet_gilt { use super::runtime_types; pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - bond { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - #[codec(compact)] - value: u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - bond_extra { - #[codec(compact)] - max_additional: u128, - }, - unbond { - #[codec(compact)] - value: u128, - }, - withdraw_unbonded { - num_slashing_spans: u32, - }, - validate { - prefs: runtime_types::pallet_staking::ValidatorPrefs, - }, - nominate { - targets: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - }, - chill, - set_payee { - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - set_controller { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - }, - set_validator_count { - #[codec(compact)] - new: u32, - }, - increase_validator_count { - #[codec(compact)] - additional: u32, - }, - scale_validator_count { - factor: runtime_types::sp_arithmetic::per_things::Percent, - }, - force_no_eras, - force_new_era, - set_invulnerables { - invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, - }, - force_unstake { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: u32, - }, - force_new_era_always, - cancel_deferred_slash { - era: u32, - slash_indices: Vec, - }, - payout_stakers { - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: u32, - }, - rebond { - #[codec(compact)] - value: u128, - }, - set_history_depth { - #[codec(compact)] - new_history_depth: u32, - #[codec(compact)] - era_items_deleted: u32, - }, - reap_stash { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: u32, - }, - kick { - who: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - >, - }, - set_staking_limits { - min_nominator_bond: u128, - min_validator_bond: u128, - max_nominator_count: Option, - max_validator_count: Option, - threshold: - Option, - }, - chill_other { - controller: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - NotController, - NotStash, - AlreadyBonded, - AlreadyPaired, - EmptyTargets, - DuplicateIndex, - InvalidSlashIndex, - InsufficientBond, - NoMoreChunks, - NoUnlockChunk, - FundedTarget, - InvalidEraToReward, - InvalidNumberOfNominations, - NotSortedAndUnique, - AlreadyClaimed, - IncorrectHistoryDepth, - IncorrectSlashingSpans, - BadState, - TooManyTargets, - BadTarget, - CannotChillOther, - TooManyNominators, - TooManyValidators, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - EraPaid(u32, u128, u128), - Rewarded(::subxt::sp_core::crypto::AccountId32, u128), - Slashed(::subxt::sp_core::crypto::AccountId32, u128), - OldSlashingReportDiscarded(u32), - StakersElected, - Bonded(::subxt::sp_core::crypto::AccountId32, u128), - Unbonded(::subxt::sp_core::crypto::AccountId32, u128), - Withdrawn(::subxt::sp_core::crypto::AccountId32, u128), - Kicked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - StakingElectionFailed, - Chilled(::subxt::sp_core::crypto::AccountId32), - PayoutStarted(u32, ::subxt::sp_core::crypto::AccountId32), - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveGilt<_0, _1, _2> { + pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, + pub amount: _0, + pub who: _1, + pub expiry: _2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveGiltsTotal<_0> { + pub frozen: _0, + pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, + pub index: u32, + pub target: ::subxt::sp_arithmetic::per_things::Perquintill, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + place_bid { + #[codec(compact)] + amount: u128, + duration: u32, + }, + retract_bid { + #[codec(compact)] + amount: u128, + duration: u32, + }, + set_target { + #[codec(compact)] + target: ::subxt::sp_arithmetic::per_things::Perquintill, + }, + thaw { + #[codec(compact)] + index: u32, + }, } - } - pub mod slashing { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct SlashingSpans { - pub span_index: u32, - pub last_start: u32, - pub last_nonzero_slash: u32, - pub prior: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + DurationTooSmall, + DurationTooBig, + AmountTooSmall, + BidTooLow, + Unknown, + NotOwner, + NotExpired, + NotFound, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct SpanRecord<_0> { - pub slashed: _0, - pub paid_out: _0, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + BidPlaced(::subxt::sp_core::crypto::AccountId32, u128, u32), + BidRetracted(::subxt::sp_core::crypto::AccountId32, u128, u32), + GiltIssued(u32, u32, ::subxt::sp_core::crypto::AccountId32, u128), + GiltThawed(u32, ::subxt::sp_core::crypto::AccountId32, u128, u128), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct GiltBid<_0, _1> { + pub amount: _0, + pub who: _1, } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ActiveEraInfo { - pub index: u32, - pub start: Option, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct EraRewardPoints<_0> { - pub total: u32, - pub individual: std::collections::BTreeMap<_0, u32>, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Exposure<_0, _1> { - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub own: _1, - pub others: - Vec>, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Forcing { - NotForcing, - ForceNew, - ForceNone, - ForceAlways, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct IndividualExposure<_0, _1> { - pub who: _0, - #[codec(compact)] - pub value: _1, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Nominations<_0> { - pub targets: Vec<_0>, - pub submitted_in: u32, - pub suppressed: bool, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Releases { - V1_0_0Ancient, - V2_0_0, - V3_0_0, - V4_0_0, - V5_0_0, - V6_0_0, - V7_0_0, - V8_0_0, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum RewardDestination<_0> { - Staked, - Stash, - Controller, - Account(_0), - None, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct StakingLedger<_0, _1> { - pub stash: _0, - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub active: _1, - pub unlocking: Vec>, - pub claimed_rewards: Vec, + } + pub mod pallet_grandpa { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + report_equivocation { + equivocation_proof: std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + report_equivocation_unsigned { + equivocation_proof: std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::sp_core::H256, + u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + note_stalled { + delay: u32, + best_finalized_block_number: u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + PauseFailed, + ResumeFailed, + ChangePending, + TooSoon, + InvalidKeyOwnershipProof, + InvalidEquivocationProof, + DuplicateOffenceReport, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewAuthorities( + Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, + ), + Paused, + Resumed, + } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct UnappliedSlash<_0, _1> { - pub validator: _0, - pub own: _1, - pub others: Vec<(_0, _1)>, - pub reporters: Vec<_0>, - pub payout: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 , u64 ,) > , pub forced : Option < _0 > , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum StoredState<_0> { + Live, + PendingPause { scheduled_at: _0, delay: _0 }, + Paused, + PendingResume { scheduled_at: _0, delay: _0 }, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct UnlockChunk<_0> { - #[codec(compact)] - pub value: _0, - #[codec(compact)] - pub era: u32, + } + pub mod pallet_identity { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + add_registrar { + account: ::subxt::sp_core::crypto::AccountId32, + }, + set_identity { + info: std::boxed::Box< + runtime_types::pallet_identity::types::IdentityInfo, + >, + }, + set_subs { + subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + }, + clear_identity, + request_judgement { + #[codec(compact)] + reg_index: u32, + #[codec(compact)] + max_fee: u128, + }, + cancel_request { + reg_index: u32, + }, + set_fee { + #[codec(compact)] + index: u32, + #[codec(compact)] + fee: u128, + }, + set_account_id { + #[codec(compact)] + index: u32, + new: ::subxt::sp_core::crypto::AccountId32, + }, + set_fields { + #[codec(compact)] + index: u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + }, + provide_judgement { + #[codec(compact)] + reg_index: u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + judgement: runtime_types::pallet_identity::types::Judgement, + }, + kill_identity { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + }, + add_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + data: runtime_types::pallet_identity::types::Data, + }, + rename_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + data: runtime_types::pallet_identity::types::Data, + }, + remove_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + }, + quit_sub, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + TooManySubAccounts, + NotFound, + NotNamed, + EmptyIndex, + FeeChanged, + NoIdentity, + StickyJudgement, + JudgementGiven, + InvalidJudgement, + InvalidIndex, + InvalidTarget, + TooManyFields, + TooManyRegistrars, + AlreadyClaimed, + NotSub, + NotOwned, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + IdentitySet(::subxt::sp_core::crypto::AccountId32), + IdentityCleared(::subxt::sp_core::crypto::AccountId32, u128), + IdentityKilled(::subxt::sp_core::crypto::AccountId32, u128), + JudgementRequested(::subxt::sp_core::crypto::AccountId32, u32), + JudgementUnrequested(::subxt::sp_core::crypto::AccountId32, u32), + JudgementGiven(::subxt::sp_core::crypto::AccountId32, u32), + RegistrarAdded(u32), + SubIdentityAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + SubIdentityRemoved( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + SubIdentityRevoked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ValidatorPrefs { - #[codec(compact)] - pub commission: ::subxt::sp_arithmetic::per_things::Perbill, - pub blocked: bool, + pub mod types { + use super::runtime_types; + #[derive( + :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct BitFlags<_0>( + pub u64, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Data { + None, + Raw0([u8; 0usize]), + Raw1([u8; 1usize]), + Raw2([u8; 2usize]), + Raw3([u8; 3usize]), + Raw4([u8; 4usize]), + Raw5([u8; 5usize]), + Raw6([u8; 6usize]), + Raw7([u8; 7usize]), + Raw8([u8; 8usize]), + Raw9([u8; 9usize]), + Raw10([u8; 10usize]), + Raw11([u8; 11usize]), + Raw12([u8; 12usize]), + Raw13([u8; 13usize]), + Raw14([u8; 14usize]), + Raw15([u8; 15usize]), + Raw16([u8; 16usize]), + Raw17([u8; 17usize]), + Raw18([u8; 18usize]), + Raw19([u8; 19usize]), + Raw20([u8; 20usize]), + Raw21([u8; 21usize]), + Raw22([u8; 22usize]), + Raw23([u8; 23usize]), + Raw24([u8; 24usize]), + Raw25([u8; 25usize]), + Raw26([u8; 26usize]), + Raw27([u8; 27usize]), + Raw28([u8; 28usize]), + Raw29([u8; 29usize]), + Raw30([u8; 30usize]), + Raw31([u8; 31usize]), + Raw32([u8; 32usize]), + BlakeTwo256([u8; 32usize]), + Sha256([u8; 32usize]), + Keccak256([u8; 32usize]), + ShaThree256([u8; 32usize]), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum IdentityField { + Display, + Legal, + Web, + Riot, + Email, + PgpFingerprint, + Image, + Twitter, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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: Option<[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)] + pub enum Judgement<_0> { + Unknown, + FeePaid(_0), + Reasonable, + KnownGood, + OutOfDate, + LowQuality, + Erroneous, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct Registration<_0> { + pub judgements: + runtime_types::frame_support::storage::bounded_vec::BoundedVec<( + u32, + runtime_types::pallet_identity::types::Judgement<_0>, + )>, + pub deposit: _0, + pub info: runtime_types::pallet_identity::types::IdentityInfo, + } } } - pub mod pallet_timestamp { + pub mod pallet_im_online { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - set { - #[codec(compact)] - now: u64, - }, + heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidKey, + DuplicatedHeartbeat, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + HeartbeatReceived( + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + ), + AllGood, + SomeOffline( + Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + u128, + >, + )>, + ), + } + } + pub mod sr25519 { + use super::runtime_types; + pub mod app_sr25519 { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BoundedOpaqueNetworkState { pub peer_id : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > , pub external_addresses : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > > , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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_tips { + pub mod pallet_indices { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - report_awesome { - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - }, - retract_tip { - hash: ::subxt::sp_core::H256, + claim { + index: u32, }, - tip_new { - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - tip_value: u128, + transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: u32, }, - tip { - hash: ::subxt::sp_core::H256, - #[codec(compact)] - tip_value: u128, + free { + index: u32, }, - close_tip { - hash: ::subxt::sp_core::H256, + force_transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: u32, + freeze: bool, }, - slash_tip { - hash: ::subxt::sp_core::H256, + freeze { + index: u32, }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - ReasonTooBig, - AlreadyKnown, - UnknownTip, - NotFinder, - StillOpen, - Premature, + NotAssigned, + NotOwner, + InUse, + NotTransfer, + Permanent, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - NewTip(::subxt::sp_core::H256), - TipClosing(::subxt::sp_core::H256), - TipClosed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - TipRetracted(::subxt::sp_core::H256), - TipSlashed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), + IndexAssigned(::subxt::sp_core::crypto::AccountId32, u32), + IndexFreed(u32), + IndexFrozen(u32, ::subxt::sp_core::crypto::AccountId32), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct OpenTip<_0, _1, _2, _3> { - pub reason: _3, - pub who: _0, - pub finder: _0, - pub deposit: _1, - pub closes: Option<_2>, - pub tips: Vec<(_0, _1)>, - pub finders_fee: bool, - } - } - pub mod pallet_transaction_payment { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct ChargeTransactionPayment(pub u128); - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Releases { - V1Ancient, - V2, - } } - pub mod pallet_treasury { + pub mod pallet_lottery { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - propose_spend { - #[codec(compact)] - value: u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, + buy_ticket { + call: std::boxed::Box, }, - reject_proposal { - #[codec(compact)] - proposal_id: u32, + set_calls { + calls: Vec, }, - approve_proposal { - #[codec(compact)] - proposal_id: u32, + start_lottery { + price: u128, + length: u32, + delay: u32, + repeat: bool, }, + stop_repeat, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - InsufficientProposersBalance, - InvalidIndex, - TooManyApprovals, + NotConfigured, + InProgress, + AlreadyEnded, + InvalidCall, + AlreadyParticipating, + TooManyCalls, + EncodingFailed, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - Proposed(u32), - Spending(u128), - Awarded(u32, u128, ::subxt::sp_core::crypto::AccountId32), - Rejected(u32, u128), - Burnt(u128), - Rollover(u128), - Deposit(u128), + LotteryStarted, + CallsUpdated, + Winner(::subxt::sp_core::crypto::AccountId32, u128), + TicketBought(::subxt::sp_core::crypto::AccountId32, (u8, u8)), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Proposal<_0, _1> { - pub proposer: _0, - pub value: _1, - pub beneficiary: _0, - pub bond: _1, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct LotteryConfig<_0, _1> { + pub price: _1, + pub start: _0, + pub length: _0, + pub delay: _0, + pub repeat: bool, } } - pub mod pallet_utility { + pub mod pallet_membership { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - batch { - calls: Vec, + add_member { + who: ::subxt::sp_core::crypto::AccountId32, }, - as_derivative { - index: u16, - call: std::boxed::Box, + remove_member { + who: ::subxt::sp_core::crypto::AccountId32, }, - batch_all { - calls: Vec, + swap_member { + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + }, + reset_members { + members: Vec<::subxt::sp_core::crypto::AccountId32>, + }, + change_key { + new: ::subxt::sp_core::crypto::AccountId32, }, + set_prime { + who: ::subxt::sp_core::crypto::AccountId32, + }, + clear_prime, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - TooManyCalls, + AlreadyMember, + NotMember, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - BatchInterrupted(u32, runtime_types::sp_runtime::DispatchError), - BatchCompleted, - ItemCompleted, + MemberAdded, + MemberRemoved, + MembersSwapped, + MembersReset, + KeyChanged, + Dummy, } } } - pub mod pallet_vesting { + pub mod pallet_multisig { use super::runtime_types; pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - vest, - vest_other { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, + as_multi_threshold_1 { + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + call: std::boxed::Box, }, - vested_transfer { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - (), - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - u128, - u32, + as_multi { + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: + Option>, + call: + runtime_types::frame_support::traits::misc::WrapperKeepOpaque< + runtime_types::node_runtime::Call, >, + store_call: bool, + max_weight: u64, }, - 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< - u128, - u32, - >, + approve_as_multi { + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: + Option>, + call_hash: [u8; 32usize], + max_weight: u64, }, - merge_schedules { - schedule1_index: u32, - schedule2_index: u32, + cancel_as_multi { + threshold: u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint, + call_hash: [u8; 32usize], }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { - NotVesting, - AtMaxVestingSchedules, - AmountLow, - ScheduleIndexOutOfBounds, - InvalidScheduleParams, + MinimumThreshold, + AlreadyApproved, + NoApprovalsNeeded, + TooFewSignatories, + TooManySignatories, + SignatoriesOutOfOrder, + SenderInSignatories, + NotFound, + NotOwner, + NoTimepoint, + WrongTimepoint, + UnexpectedTimepoint, + MaxWeightTooLow, + AlreadyStored, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - VestingUpdated(::subxt::sp_core::crypto::AccountId32, u128), - VestingCompleted(::subxt::sp_core::crypto::AccountId32), - } - } - pub mod vesting_info { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct VestingInfo<_0, _1> { - pub locked: _0, - pub per_block: _0, - pub starting_block: _1, + NewMultisig( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + ), + MultisigApproval( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + ), + MultisigExecuted( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + MultisigCancelled( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint, + ::subxt::sp_core::crypto::AccountId32, + [u8; 32usize], + ), } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Releases { - V0, - V1, - } - } - pub mod polkadot_core_primitives { - use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct CandidateHash(pub ::subxt::sp_core::H256); - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct InboundDownwardMessage<_0> { - pub sent_at: _0, - pub msg: Vec, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct InboundHrmpMessage<_0> { - pub sent_at: _0, - pub data: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Multisig<_0, _1, _2> { + pub when: runtime_types::pallet_multisig::Timepoint<_0>, + pub deposit: _1, + pub depositor: _2, + pub approvals: Vec<_2>, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct OutboundHrmpMessage<_0> { - pub recipient: _0, - pub data: Vec, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Timepoint<_0> { + pub height: _0, + pub index: _0, } } - pub mod polkadot_parachain { + pub mod pallet_offences { use super::runtime_types; - pub mod primitives { + pub mod pallet { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct HeadData(pub Vec); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - 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)] + pub enum Event { + Offence([u8; 16usize], Vec), } - #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, - :: codec :: CompactAs, - )] - pub struct Id(pub u32); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ValidationCode(pub Vec); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ValidationCodeHash(pub ::subxt::sp_core::H256); } } - pub mod polkadot_primitives { + pub mod pallet_proxy { use super::runtime_types; - pub mod v0 { - use super::runtime_types; - pub mod collator_app { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - pub mod validator_app { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, - :: codec :: CompactAs, - )] - pub struct ValidatorIndex(pub u32); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum ValidityAttestation { - Implicit( - runtime_types::polkadot_primitives::v0::validator_app::Signature, - ), - Explicit( - runtime_types::polkadot_primitives::v0::validator_app::Signature, - ), - } - } - pub mod v1 { + pub mod pallet { use super::runtime_types; - pub mod assignment_app { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod signed { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > , } - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct AvailabilityBitfield( - pub ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, - ); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct BackedCandidate<_0> { - pub candidate: - runtime_types::polkadot_primitives::v1::CommittedCandidateReceipt< - _0, - >, - pub validity_votes: - Vec, - pub validator_indices: - ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CandidateCommitments<_0> { - pub upward_messages: Vec>, - pub horizontal_messages: Vec< - runtime_types::polkadot_core_primitives::OutboundHrmpMessage< - runtime_types::polkadot_parachain::primitives::Id, - >, - >, - pub new_validation_code: 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( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CandidateDescriptor<_0> { - pub para_id: runtime_types::polkadot_parachain::primitives::Id, - pub relay_parent: _0, - pub collator: - runtime_types::polkadot_primitives::v0::collator_app::Public, - pub persisted_validation_data_hash: _0, - pub pov_hash: _0, - pub erasure_root: _0, - pub signature: - runtime_types::polkadot_primitives::v0::collator_app::Signature, - pub para_head: _0, - pub validation_code_hash: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CandidateReceipt<_0> { - pub descriptor: - runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, - pub commitments_hash: _0, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CommittedCandidateReceipt<_0> { - pub descriptor: - runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, - pub commitments: - runtime_types::polkadot_primitives::v1::CandidateCommitments, - } - #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, - :: codec :: CompactAs, - )] - pub struct CoreIndex(pub u32); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum CoreOccupied { - Parathread(runtime_types::polkadot_primitives::v1::ParathreadEntry), - Parachain, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum DisputeStatement { - Valid (runtime_types :: polkadot_primitives :: v1 :: ValidDisputeStatementKind ,) , Invalid (runtime_types :: polkadot_primitives :: v1 :: InvalidDisputeStatementKind ,) , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct DisputeStatementSet { - pub candidate_hash: - runtime_types::polkadot_core_primitives::CandidateHash, - pub session: u32, - pub statements: Vec<( - runtime_types::polkadot_primitives::v1::DisputeStatement, - runtime_types::polkadot_primitives::v0::ValidatorIndex, - runtime_types::polkadot_primitives::v0::validator_app::Signature, - )>, - } - #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, - :: codec :: CompactAs, - )] - pub struct GroupIndex(pub u32); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct InherentData<_0> { - pub bitfields: Vec< - runtime_types::polkadot_primitives::v1::signed::UncheckedSigned< - runtime_types::polkadot_primitives::v1::AvailabilityBitfield, - runtime_types::polkadot_primitives::v1::AvailabilityBitfield, - >, - >, - pub backed_candidates: Vec< - runtime_types::polkadot_primitives::v1::BackedCandidate< - ::subxt::sp_core::H256, - >, - >, - pub disputes: - Vec, - pub parent_header: _0, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum InvalidDisputeStatementKind { - Explicit, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ParathreadClaim( - pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_primitives::v0::collator_app::Public, - ); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ParathreadEntry { - pub claim: runtime_types::polkadot_primitives::v1::ParathreadClaim, - pub retries: u32, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct SessionInfo { - pub validators: Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, - >, - pub discovery_keys: - Vec, - pub assignment_keys: Vec< - runtime_types::polkadot_primitives::v1::assignment_app::Public, - >, - pub validator_groups: - Vec>, - pub n_cores: u32, - pub zeroth_delay_tranche_width: u32, - pub relay_vrf_modulo_samples: u32, - pub n_delay_tranches: u32, - pub no_show_slots: u32, - pub needed_approvals: u32, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum UpgradeGoAhead { - Abort, - GoAhead, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + proxy { + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: Option, + call: std::boxed::Box, + }, + add_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: u32, + }, + remove_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: u32, + }, + remove_proxies, + anonymous { + proxy_type: runtime_types::node_runtime::ProxyType, + delay: u32, + index: u16, + }, + kill_anonymous { + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + index: u16, + #[codec(compact)] + height: u32, + #[codec(compact)] + ext_index: u32, + }, + announce { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + remove_announcement { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + reject_announcement { + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + proxy_announced { + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: Option, + call: std::boxed::Box, + }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum UpgradeRestriction { - Present, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + TooMany, + NotFound, + NotProxy, + Unproxyable, + Duplicate, + NoPermission, + Unannounced, + NoSelfProxy, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum ValidDisputeStatementKind { - Explicit, - BackingSeconded(::subxt::sp_core::H256), - BackingValid(::subxt::sp_core::H256), - ApprovalChecking, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + ProxyExecuted(Result<(), runtime_types::sp_runtime::DispatchError>), + AnonymousCreated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + runtime_types::node_runtime::ProxyType, + u16, + ), + Announced( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ), + ProxyAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + runtime_types::node_runtime::ProxyType, + u32, + ), } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Announcement<_0, _1, _2> { + pub real: _0, + pub call_hash: _1, + pub height: _2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProxyDefinition<_0, _1, _2> { + pub delegate: _0, + pub proxy_type: _1, + pub delay: _2, + } } - pub mod polkadot_runtime { + pub mod pallet_recovery { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Call { - System (runtime_types :: frame_system :: pallet :: Call ,) , Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , Session (runtime_types :: pallet_session :: pallet :: Call ,) , Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , Council (runtime_types :: pallet_collective :: pallet :: Call ,) , TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum Event { - System (runtime_types :: frame_system :: pallet :: Event ,) , Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , Session (runtime_types :: pallet_session :: pallet :: Event ,) , Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , Council (runtime_types :: pallet_collective :: pallet :: Event ,) , TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct NposCompactSolution16 { - votes1: Vec<(u32, u16)>, - votes2: Vec<( - u32, - (u16, runtime_types::sp_arithmetic::per_things::PerU16), - u16, - )>, - votes3: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 2usize], - u16, - )>, - votes4: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 3usize], - u16, - )>, - votes5: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 4usize], - u16, - )>, - votes6: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 5usize], - u16, - )>, - votes7: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 6usize], - u16, - )>, - votes8: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 7usize], - u16, - )>, - votes9: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 8usize], - u16, - )>, - votes10: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 9usize], - u16, - )>, - votes11: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 10usize], - u16, - )>, - votes12: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 11usize], - u16, - )>, - votes13: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 12usize], - u16, - )>, - votes14: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 13usize], - u16, - )>, - votes15: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 14usize], - u16, - )>, - votes16: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 15usize], - u16, - )>, - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum OriginCaller { - system( - runtime_types::frame_system::RawOrigin< + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + as_recovered { + account: ::subxt::sp_core::crypto::AccountId32, + call: std::boxed::Box, + }, + set_recovered { + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + }, + create_recovery { + friends: Vec<::subxt::sp_core::crypto::AccountId32>, + threshold: u16, + delay_period: u32, + }, + initiate_recovery { + account: ::subxt::sp_core::crypto::AccountId32, + }, + vouch_recovery { + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + }, + claim_recovery { + account: ::subxt::sp_core::crypto::AccountId32, + }, + close_recovery { + rescuer: ::subxt::sp_core::crypto::AccountId32, + }, + remove_recovery, + cancel_recovered { + account: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotAllowed, + ZeroThreshold, + NotEnoughFriends, + MaxFriends, + NotSorted, + NotRecoverable, + AlreadyRecoverable, + AlreadyStarted, + NotStarted, + NotFriend, + DelayPeriod, + AlreadyVouched, + Threshold, + StillActive, + AlreadyProxy, + BadState, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + RecoveryCreated(::subxt::sp_core::crypto::AccountId32), + RecoveryInitiated( ::subxt::sp_core::crypto::AccountId32, - >, - ), - Council( - runtime_types::pallet_collective::RawOrigin< ::subxt::sp_core::crypto::AccountId32, - >, - ), - TechnicalCommittee( - runtime_types::pallet_collective::RawOrigin< + ), + RecoveryVouched( ::subxt::sp_core::crypto::AccountId32, - >, - ), - ParachainsOrigin( - runtime_types::polkadot_runtime_parachains::origin::pallet::Origin, - ), - Void(runtime_types::sp_core::Void), + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + RecoveryClosed( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + AccountRecovered( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + RecoveryRemoved(::subxt::sp_core::crypto::AccountId32), + } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum ProxyType { - Any, - NonTransfer, - Governance, - Staking, - IdentityJudgement, - CancelProxy, - Auction, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveRecovery<_0, _1, _2> { + pub created: _0, + pub deposit: _1, + pub friends: Vec<_2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryConfig<_0, _1, _2> { + pub delay_period: _0, + pub deposit: _1, + pub friends: Vec<_2>, + pub threshold: u16, + } + } + pub mod pallet_scheduler { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + schedule { + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + cancel { + when: u32, + index: u32, + }, + schedule_named { + id: Vec, + when: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + cancel_named { + id: Vec, + }, + schedule_after { + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + schedule_named_after { + id: Vec, + after: u32, + maybe_periodic: Option<(u32, u32)>, + priority: u8, + call: std::boxed::Box, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + FailedToSchedule, + NotFound, + TargetBlockNumberInPast, + RescheduleNoChange, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Scheduled(u32, u32), + Canceled(u32, u32), + Dispatched( + (u32, u32), + Option>, + Result<(), runtime_types::sp_runtime::DispatchError>, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1, + V2, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub struct Runtime {} - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - 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::v0::validator_app::Public, - pub para_assignment: - runtime_types::polkadot_primitives::v1::assignment_app::Public, - pub authority_discovery: - runtime_types::sp_authority_discovery::app::Public, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduledV2<_0, _1, _2, _3> { + pub maybe_id: Option>, + pub priority: u8, + pub call: _0, + pub maybe_periodic: Option<(_1, _1)>, + pub origin: _2, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, } } - pub mod polkadot_runtime_common { + pub mod pallet_session { use super::runtime_types; - pub mod auctions { + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - new_auction { - #[codec(compact)] - duration: u32, - #[codec(compact)] - lease_period_index: u32, - }, - bid { - #[codec(compact)] - para: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - auction_index: u32, - #[codec(compact)] - first_slot: u32, - #[codec(compact)] - last_slot: u32, - #[codec(compact)] - amount: u128, - }, - cancel_auction, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - AuctionInProgress, - LeasePeriodInPast, - ParaNotRegistered, - NotCurrentAuction, - NotAuction, - AuctionEnded, - AlreadyLeasedOut, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - AuctionStarted(u32, u32, u32), - AuctionClosed(u32), - Reserved(::subxt::sp_core::crypto::AccountId32, u128, u128), - Unreserved(::subxt::sp_core::crypto::AccountId32, u128), - ReserveConfiscated( - runtime_types::polkadot_parachain::primitives::Id, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - BidAccepted( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - u128, - u32, - u32, - ), - WinningOffset(u32, u32), - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + set_keys { + keys: runtime_types::node_runtime::SessionKeys, + proof: Vec, + }, + purge_keys, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidProof, + NoAssociatedValidatorId, + DuplicatedKey, + NoKeys, + NoAccount, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewSession(u32), } } - pub mod claims { + } + pub mod pallet_society { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - claim { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , } , mint_claim { who : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , value : u128 , vesting_schedule : Option < (u128 , u128 , u32 ,) > , statement : Option < runtime_types :: polkadot_runtime_common :: claims :: StatementKind > , } , claim_attest { dest : :: subxt :: sp_core :: crypto :: AccountId32 , ethereum_signature : runtime_types :: polkadot_runtime_common :: claims :: EcdsaSignature , statement : Vec < u8 > , } , attest { statement : Vec < u8 > , } , move_claim { old : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , new : runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , maybe_preclaim : Option < :: subxt :: sp_core :: crypto :: AccountId32 > , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InvalidEthereumSignature, - SignerHasNoClaim, - SenderHasNoClaim, - PotUnderflow, - InvalidStatement, - VestedBalanceExists, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - Claimed (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: polkadot_runtime_common :: claims :: EthereumAddress , u128 ,) , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + bid { + value: u128, + }, + unbid { + pos: u32, + }, + vouch { + who: ::subxt::sp_core::crypto::AccountId32, + value: u128, + tip: u128, + }, + unvouch { + pos: u32, + }, + vote { + candidate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + approve: bool, + }, + defender_vote { + approve: bool, + }, + payout, + found { + founder: ::subxt::sp_core::crypto::AccountId32, + max_members: u32, + rules: Vec, + }, + unfound, + judge_suspended_member { + who: ::subxt::sp_core::crypto::AccountId32, + forgive: bool, + }, + judge_suspended_candidate { + who: ::subxt::sp_core::crypto::AccountId32, + judgement: runtime_types::pallet_society::Judgement, + }, + set_max_members { + max: u32, + }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct EcdsaSignature(pub [u8; 65usize]); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct EthereumAddress(pub [u8; 20usize]); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct PrevalidateAttests {} - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum StatementKind { - Regular, - Saft, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + BadPosition, + NotMember, + AlreadyMember, + Suspended, + NotSuspended, + NoPayout, + AlreadyFounded, + InsufficientPot, + AlreadyVouching, + NotVouching, + Head, + Founder, + AlreadyBid, + AlreadyCandidate, + NotCandidate, + MaxMembers, + NotFounder, + NotHead, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Founded(::subxt::sp_core::crypto::AccountId32), + Bid(::subxt::sp_core::crypto::AccountId32, u128), + Vouch( + ::subxt::sp_core::crypto::AccountId32, + u128, + ::subxt::sp_core::crypto::AccountId32, + ), + AutoUnbid(::subxt::sp_core::crypto::AccountId32), + Unbid(::subxt::sp_core::crypto::AccountId32), + Unvouch(::subxt::sp_core::crypto::AccountId32), + Inducted( + ::subxt::sp_core::crypto::AccountId32, + Vec<::subxt::sp_core::crypto::AccountId32>, + ), + SuspendedMemberJudgement(::subxt::sp_core::crypto::AccountId32, bool), + CandidateSuspended(::subxt::sp_core::crypto::AccountId32), + MemberSuspended(::subxt::sp_core::crypto::AccountId32), + Challenged(::subxt::sp_core::crypto::AccountId32), + Vote( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + bool, + ), + DefenderVote(::subxt::sp_core::crypto::AccountId32, bool), + NewMaxMembers(u32), + Unfounded(::subxt::sp_core::crypto::AccountId32), + Deposit(u128), } } - pub mod crowdloan { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bid<_0, _1> { + pub who: _0, + pub kind: runtime_types::pallet_society::BidKind<_0, _1>, + pub value: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum BidKind<_0, _1> { + Deposit(_1), + Vouch(_0, _1), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Judgement { + Rebid, + Reject, + Approve, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Vote { + Skeptic, + Reject, + Approve, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum VouchingStatus { + Vouching, + Banned, + } + } + pub mod pallet_staking { + use super::runtime_types; + pub mod pallet { use super::runtime_types; pub mod pallet { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub enum Call { - create { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, - #[codec(compact)] - cap: u128, - #[codec(compact)] - first_period: u32, - #[codec(compact)] - last_period: u32, + bond { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, #[codec(compact)] - end: u32, - verifier: Option, + value: u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, }, - contribute { + bond_extra { #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, + max_additional: u128, + }, + unbond { #[codec(compact)] value: u128, - signature: Option, }, - withdraw { - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, + withdraw_unbonded { + num_slashing_spans: u32, }, - refund { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, + validate { + prefs: runtime_types::pallet_staking::ValidatorPrefs, }, - dissolve { - #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, + nominate { + targets: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, + }, + chill, + set_payee { + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + set_controller { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, }, - edit { + set_validator_count { #[codec(compact)] - index: runtime_types::polkadot_parachain::primitives::Id, + new: u32, + }, + increase_validator_count { #[codec(compact)] - cap: u128, + additional: u32, + }, + scale_validator_count { + factor: runtime_types::sp_arithmetic::per_things::Percent, + }, + force_no_eras, + force_new_era, + set_invulnerables { + invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + }, + force_unstake { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: u32, + }, + force_new_era_always, + cancel_deferred_slash { + era: u32, + slash_indices: Vec, + }, + payout_stakers { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: u32, + }, + rebond { #[codec(compact)] - first_period: u32, + value: u128, + }, + set_history_depth { #[codec(compact)] - last_period: u32, + new_history_depth: u32, #[codec(compact)] - end: u32, - verifier: Option, + era_items_deleted: u32, }, - add_memo { - index: runtime_types::polkadot_parachain::primitives::Id, - memo: Vec, + reap_stash { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: u32, }, - poke { - index: runtime_types::polkadot_parachain::primitives::Id, + kick { + who: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + >, }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - FirstPeriodInPast, - FirstPeriodTooFarInFuture, - LastPeriodBeforeFirstPeriod, - LastPeriodTooFarInFuture, - CannotEndInPast, - EndTooFarInFuture, - Overflow, - ContributionTooSmall, - InvalidParaId, - CapExceeded, - ContributionPeriodOver, - InvalidOrigin, - NotParachain, - LeaseActive, - BidOrLeaseActive, - FundNotEnded, - NoContributions, - NotReadyToDissolve, - InvalidSignature, - MemoTooLarge, - AlreadyInNewRaise, - VrfDelayInProgress, - NoLeasePeriod, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - Created(runtime_types::polkadot_parachain::primitives::Id), - Contributed( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - u128, - ), - Withdrew( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - u128, - ), - PartiallyRefunded( - runtime_types::polkadot_parachain::primitives::Id, - ), - AllRefunded(runtime_types::polkadot_parachain::primitives::Id), - Dissolved(runtime_types::polkadot_parachain::primitives::Id), - HandleBidResult( - runtime_types::polkadot_parachain::primitives::Id, - Result<(), runtime_types::sp_runtime::DispatchError>, - ), - Edited(runtime_types::polkadot_parachain::primitives::Id), - MemoUpdated( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::polkadot_parachain::primitives::Id, - Vec, - ), - AddedToNewRaise( - runtime_types::polkadot_parachain::primitives::Id, - ), - } - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : 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 trie_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum LastContribution<_0> { - Never, - PreEnding(_0), - Ending(_0), - } - } - pub mod paras_registrar { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , force_register { who : :: subxt :: sp_core :: crypto :: AccountId32 , deposit : u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , reserve , } + set_staking_limits { + min_nominator_bond: u128, + min_validator_bond: u128, + max_nominator_count: Option, + max_validator_count: Option, + threshold: + Option, + }, + chill_other { + controller: ::subxt::sp_core::crypto::AccountId32, + }, + } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub enum Error { - NotRegistered, - AlreadyRegistered, - NotOwner, - CodeTooLarge, - HeadDataTooLarge, - NotParachain, - NotParathread, - CannotDeregister, - CannotDowngrade, - CannotUpgrade, - ParaLocked, - NotReserved, + NotController, + NotStash, + AlreadyBonded, + AlreadyPaired, + EmptyTargets, + DuplicateIndex, + InvalidSlashIndex, + InsufficientBond, + NoMoreChunks, + NoUnlockChunk, + FundedTarget, + InvalidEraToReward, + InvalidNumberOfNominations, + NotSortedAndUnique, + AlreadyClaimed, + IncorrectHistoryDepth, + IncorrectSlashingSpans, + BadState, + TooManyTargets, + BadTarget, + CannotChillOther, + TooManyNominators, + TooManyValidators, } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub enum Event { - Registered( - runtime_types::polkadot_parachain::primitives::Id, + EraPaid(u32, u128, u128), + Rewarded(::subxt::sp_core::crypto::AccountId32, u128), + Slashed(::subxt::sp_core::crypto::AccountId32, u128), + OldSlashingReportDiscarded(u32), + StakersElected, + Bonded(::subxt::sp_core::crypto::AccountId32, u128), + Unbonded(::subxt::sp_core::crypto::AccountId32, u128), + Withdrawn(::subxt::sp_core::crypto::AccountId32, u128), + Kicked( ::subxt::sp_core::crypto::AccountId32, - ), - Deregistered(runtime_types::polkadot_parachain::primitives::Id), - Reserved( - runtime_types::polkadot_parachain::primitives::Id, ::subxt::sp_core::crypto::AccountId32, ), + StakingElectionFailed, + Chilled(::subxt::sp_core::crypto::AccountId32), + PayoutStarted(u32, ::subxt::sp_core::crypto::AccountId32), } } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ParaInfo<_0, _1> { - pub manager: _0, - pub deposit: _1, - pub locked: bool, + } + pub mod slashing { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SlashingSpans { + pub span_index: u32, + pub last_start: u32, + pub last_nonzero_slash: u32, + pub prior: Vec, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SpanRecord<_0> { + pub slashed: _0, + pub paid_out: _0, } } - pub mod slots { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveEraInfo { + pub index: u32, + pub start: Option, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct EraRewardPoints<_0> { + pub total: u32, + pub individual: std::collections::BTreeMap<_0, u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Exposure<_0, _1> { + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub own: _1, + pub others: + Vec>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Forcing { + NotForcing, + ForceNew, + ForceNone, + ForceAlways, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct IndividualExposure<_0, _1> { + pub who: _0, + #[codec(compact)] + pub value: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Nominations<_0> { + pub targets: Vec<_0>, + pub submitted_in: u32, + pub suppressed: bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1_0_0Ancient, + V2_0_0, + V3_0_0, + V4_0_0, + V5_0_0, + V6_0_0, + V7_0_0, + V8_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum RewardDestination<_0> { + Staked, + Stash, + Controller, + Account(_0), + None, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct StakingLedger<_0, _1> { + pub stash: _0, + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub active: _1, + pub unlocking: Vec>, + pub claimed_rewards: Vec, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct UnappliedSlash<_0, _1> { + pub validator: _0, + pub own: _1, + pub others: Vec<(_0, _1)>, + pub reporters: Vec<_0>, + pub payout: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct UnlockChunk<_0> { + #[codec(compact)] + pub value: _0, + #[codec(compact)] + pub era: u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ValidatorPrefs { + #[codec(compact)] + pub commission: ::subxt::sp_arithmetic::per_things::Perbill, + pub blocked: bool, + } + } + pub mod pallet_sudo { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - force_lease { - para: runtime_types::polkadot_parachain::primitives::Id, - leaser: ::subxt::sp_core::crypto::AccountId32, - amount: u128, - period_begin: u32, - period_count: u32, - }, - clear_all_leases { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - trigger_onboard { - para: runtime_types::polkadot_parachain::primitives::Id, - }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - ParaNotOnboarding, - LeaseError, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - NewLeasePeriod(u32), - Leased( - runtime_types::polkadot_parachain::primitives::Id, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + sudo { + call: std::boxed::Box, + }, + sudo_unchecked_weight { + call: std::boxed::Box, + weight: u64, + }, + set_key { + new: ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, u32, + >, + }, + sudo_as { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, u32, - u128, - u128, - ), - } + >, + call: std::boxed::Box, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + RequireSudo, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Sudid(Result<(), runtime_types::sp_runtime::DispatchError>), + KeyChanged(::subxt::sp_core::crypto::AccountId32), + SudoAsDone(Result<(), runtime_types::sp_runtime::DispatchError>), + } + } + } + pub mod pallet_timestamp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + set { + #[codec(compact)] + now: u64, + }, + } + } + } + pub mod pallet_tips { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + report_awesome { + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + }, + retract_tip { + hash: ::subxt::sp_core::H256, + }, + tip_new { + reason: Vec, + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + tip_value: u128, + }, + tip { + hash: ::subxt::sp_core::H256, + #[codec(compact)] + tip_value: u128, + }, + close_tip { + hash: ::subxt::sp_core::H256, + }, + slash_tip { + hash: ::subxt::sp_core::H256, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + ReasonTooBig, + AlreadyKnown, + UnknownTip, + NotFinder, + StillOpen, + Premature, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewTip(::subxt::sp_core::H256), + TipClosing(::subxt::sp_core::H256), + TipClosed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), + TipRetracted(::subxt::sp_core::H256), + TipSlashed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + u128, + ), } } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OpenTip<_0, _1, _2, _3> { + pub reason: _3, + pub who: _0, + pub finder: _0, + pub deposit: _1, + pub closes: Option<_2>, + pub tips: Vec<(_0, _1)>, + pub finders_fee: bool, + } + } + pub mod pallet_transaction_payment { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ChargeTransactionPayment(pub u128); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1Ancient, + V2, + } } - pub mod polkadot_runtime_parachains { + pub mod pallet_transaction_storage { use super::runtime_types; - pub mod configuration { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - set_validation_upgrade_frequency { new: u32 }, - set_validation_upgrade_delay { new: u32 }, - set_code_retention_period { new: u32 }, - set_max_code_size { new: u32 }, - set_max_pov_size { new: u32 }, - set_max_head_data_size { new: u32 }, - set_parathread_cores { new: u32 }, - set_parathread_retries { new: u32 }, - set_group_rotation_frequency { new: u32 }, - set_chain_availability_period { new: u32 }, - set_thread_availability_period { new: u32 }, - set_scheduling_lookahead { new: u32 }, - set_max_validators_per_core { new: Option }, - set_max_validators { new: Option }, - set_dispute_period { new: u32 }, - set_dispute_post_conclusion_acceptance_period { new: u32 }, - set_dispute_max_spam_slots { new: u32 }, - set_dispute_conclusion_by_time_out_period { new: u32 }, - set_no_show_slots { new: u32 }, - set_n_delay_tranches { new: u32 }, - set_zeroth_delay_tranche_width { new: u32 }, - set_needed_approvals { new: u32 }, - set_relay_vrf_modulo_samples { new: u32 }, - set_max_upward_queue_count { new: u32 }, - set_max_upward_queue_size { new: u32 }, - set_max_downward_message_size { new: u32 }, - set_ump_service_total_weight { new: u64 }, - set_max_upward_message_size { new: u32 }, - set_max_upward_message_num_per_candidate { new: u32 }, - set_hrmp_open_request_ttl { new: u32 }, - set_hrmp_sender_deposit { new: u128 }, - set_hrmp_recipient_deposit { new: u128 }, - set_hrmp_channel_max_capacity { new: u32 }, - set_hrmp_channel_max_total_size { new: u32 }, - set_hrmp_max_parachain_inbound_channels { new: u32 }, - set_hrmp_max_parathread_inbound_channels { new: u32 }, - set_hrmp_channel_max_message_size { new: u32 }, - set_hrmp_max_parachain_outbound_channels { new: u32 }, - set_hrmp_max_parathread_outbound_channels { new: u32 }, - set_hrmp_max_message_num_per_candidate { new: u32 }, - set_ump_max_individual_weight { new: u64 }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - InvalidNewValue, - } - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - 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: u64, - pub hrmp_max_parachain_outbound_channels: _0, - pub hrmp_max_parathread_outbound_channels: _0, - pub hrmp_sender_deposit: u128, - pub hrmp_recipient_deposit: 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: Option<_0>, - pub max_validators: 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: u64, - } - } - pub mod dmp { + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call {} + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + store { data : Vec < u8 > , } , renew { block : u32 , index : u32 , } , check_proof { proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InsufficientFunds, + NotConfigured, + RenewedNotFound, + EmptyTransaction, + UnexpectedProof, + InvalidProof, + MissingProof, + MissingStateData, + DoubleCheck, + ProofNotChecked, + TransactionTooLarge, + TooManyTransactions, + BadContext, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Stored(u32), + Renewed(u32), + ProofChecked, } } - pub mod hrmp { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransactionInfo { + pub chunk_root: ::subxt::sp_core::H256, + pub content_hash: ::subxt::sp_core::H256, + pub size: u32, + pub block_chunks: u32, + } + } + pub mod pallet_treasury { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : u32 , proposed_max_message_size : u32 , } , hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , force_process_hrmp_open , force_process_hrmp_close , hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - OpenHrmpChannelToSelf, - OpenHrmpChannelInvalidRecipient, - OpenHrmpChannelZeroCapacity, - OpenHrmpChannelCapacityExceedsLimit, - OpenHrmpChannelZeroMessageSize, - OpenHrmpChannelMessageSizeExceedsLimit, - OpenHrmpChannelAlreadyExists, - OpenHrmpChannelAlreadyRequested, - OpenHrmpChannelLimitExceeded, - AcceptHrmpChannelDoesntExist, - AcceptHrmpChannelAlreadyConfirmed, - AcceptHrmpChannelLimitExceeded, - CloseHrmpChannelUnauthorized, - CloseHrmpChannelDoesntExist, - CloseHrmpChannelAlreadyUnderway, - CancelHrmpOpenChannelUnauthorized, - OpenHrmpChannelDoesntExist, - OpenHrmpChannelAlreadyConfirmed, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - OpenChannelRequested( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::Id, - u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + propose_spend { + #[codec(compact)] + value: u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, u32, - ), - OpenChannelCanceled( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ), - OpenChannelAccepted( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::Id, - ), - ChannelClosed( - runtime_types::polkadot_parachain::primitives::Id, - runtime_types::polkadot_parachain::primitives::HrmpChannelId, - ), - } + >, + }, + reject_proposal { + #[codec(compact)] + proposal_id: u32, + }, + approve_proposal { + #[codec(compact)] + proposal_id: u32, + }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct HrmpChannel { - pub max_capacity: u32, - pub max_total_size: u32, - pub max_message_size: u32, - pub msg_count: u32, - pub total_size: u32, - pub mqc_head: Option<::subxt::sp_core::H256>, - pub sender_deposit: u128, - pub recipient_deposit: u128, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InsufficientProposersBalance, + InvalidIndex, + TooManyApprovals, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct HrmpOpenChannelRequest { - pub confirmed: bool, - pub _age: u32, - pub sender_deposit: u128, - pub max_message_size: u32, - pub max_capacity: u32, - pub max_total_size: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Proposed(u32), + Spending(u128), + Awarded(u32, u128, ::subxt::sp_core::crypto::AccountId32), + Rejected(u32, u128), + Burnt(u128), + Rollover(u128), + Deposit(u128), } } - pub mod inclusion { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call {} - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - WrongBitfieldSize, - BitfieldDuplicateOrUnordered, - ValidatorIndexOutOfBounds, - InvalidBitfieldSignature, - UnscheduledCandidate, - CandidateScheduledBeforeParaFree, - WrongCollator, - ScheduledOutOfOrder, - HeadDataTooLarge, - PrematureCodeUpgrade, - NewCodeTooLarge, - CandidateNotInParentContext, - UnoccupiedBitInBitfield, - InvalidGroupIndex, - InsufficientBacking, - InvalidBacking, - NotCollatorSigned, - ValidationDataHashMismatch, - InternalError, - IncorrectDownwardMessageHandling, - InvalidUpwardMessages, - HrmpWatermarkMishandling, - InvalidOutboundHrmp, - InvalidValidationCodeHash, - ParaHeadMismatch, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - CandidateBacked( - runtime_types::polkadot_primitives::v1::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v1::CoreIndex, - runtime_types::polkadot_primitives::v1::GroupIndex, - ), - CandidateIncluded( - runtime_types::polkadot_primitives::v1::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v1::CoreIndex, - runtime_types::polkadot_primitives::v1::GroupIndex, - ), - CandidateTimedOut( - runtime_types::polkadot_primitives::v1::CandidateReceipt< - ::subxt::sp_core::H256, - >, - runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v1::CoreIndex, - ), - } - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct AvailabilityBitfieldRecord<_0> { - pub bitfield: - runtime_types::polkadot_primitives::v1::AvailabilityBitfield, - pub submitted_at: _0, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CandidatePendingAvailability<_0, _1> { - pub core: runtime_types::polkadot_primitives::v1::CoreIndex, - pub hash: runtime_types::polkadot_core_primitives::CandidateHash, - pub descriptor: - runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, - pub availability_votes: - ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, - pub backers: - ::subxt::bitvec::vec::BitVec<::subxt::bitvec::order::Lsb0, u8>, - pub relay_parent_number: _1, - pub backed_in_number: _1, - pub backing_group: runtime_types::polkadot_primitives::v1::GroupIndex, - } - } - pub mod initializer { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposal<_0, _1> { + pub proposer: _0, + pub value: _1, + pub beneficiary: _0, + pub bond: _1, + } + } + pub mod pallet_uniques { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - force_approve { up_to: u32 }, - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + create { # [codec (compact)] class : u32 , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , force_create { # [codec (compact)] class : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , free_holding : bool , } , destroy { # [codec (compact)] class : u32 , witness : runtime_types :: pallet_uniques :: types :: DestroyWitness , } , mint { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , burn { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , check_owner : Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > > , } , transfer { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , dest : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , redeposit { # [codec (compact)] class : u32 , instances : Vec < u32 > , } , freeze { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , } , thaw { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , } , freeze_class { # [codec (compact)] class : u32 , } , thaw_class { # [codec (compact)] class : u32 , } , transfer_ownership { # [codec (compact)] class : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , set_team { # [codec (compact)] class : u32 , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , approve_transfer { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , delegate : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , cancel_approval { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , maybe_check_delegate : Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > > , } , force_asset_status { # [codec (compact)] class : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , free_holding : bool , is_frozen : bool , } , set_attribute { # [codec (compact)] class : u32 , maybe_instance : Option < u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , value : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , } , clear_attribute { # [codec (compact)] class : u32 , maybe_instance : Option < u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , } , set_metadata { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , is_frozen : bool , } , clear_metadata { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , } , set_class_metadata { # [codec (compact)] class : u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , is_frozen : bool , } , clear_class_metadata { # [codec (compact)] class : u32 , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NoPermission, + Unknown, + AlreadyExists, + WrongOwner, + BadWitness, + InUse, + Frozen, + WrongDelegate, + NoDelegate, + Unapproved, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct BufferedSessionChange { - pub validators: Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, - >, - pub queued: Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, - >, - pub session_index: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Created( + u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + ForceCreated(u32, ::subxt::sp_core::crypto::AccountId32), + Destroyed(u32), + Issued(u32, u32, ::subxt::sp_core::crypto::AccountId32), + Transferred( + u32, + u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + Burned(u32, u32, ::subxt::sp_core::crypto::AccountId32), + Frozen(u32, u32), + Thawed(u32, u32), + ClassFrozen(u32), + ClassThawed(u32), + OwnerChanged(u32, ::subxt::sp_core::crypto::AccountId32), + TeamChanged( + u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + ApprovedTransfer( + u32, + u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + ApprovalCancelled( + u32, + u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + AssetStatusChanged(u32), + ClassMetadataSet( + u32, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + bool, + ), + ClassMetadataCleared(u32), + MetadataSet( + u32, + u32, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + bool, + ), + MetadataCleared(u32, u32), + Redeposited(u32, Vec), + AttributeSet( + u32, + Option, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + ), + AttributeCleared( + u32, + Option, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + ), } } - pub mod origin { + pub mod types { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Origin { - Parachain(runtime_types::polkadot_parachain::primitives::Id), - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassDetails<_0, _1> { + pub owner: _0, + pub issuer: _0, + pub admin: _0, + pub freezer: _0, + pub total_deposit: _1, + pub free_holding: bool, + pub instances: u32, + pub instance_metadatas: u32, + pub attributes: u32, + pub is_frozen: bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassMetadata<_0> { + pub deposit: _0, + pub data: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + pub is_frozen: bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DestroyWitness { + #[codec(compact)] + pub instances: u32, + #[codec(compact)] + pub instance_metadatas: u32, + #[codec(compact)] + pub attributes: u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstanceDetails<_0, _1> { + pub owner: _0, + pub approved: Option<_0>, + pub is_frozen: bool, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstanceMetadata<_0> { + pub deposit: _0, + pub data: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + u8, + >, + pub is_frozen: bool, } } - pub mod paras { + } + pub mod pallet_utility { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : u32 , } , force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - NotRegistered, - CannotOnboard, - CannotOffboard, - CannotUpgrade, - CannotDowngrade, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - CurrentCodeUpdated( - runtime_types::polkadot_parachain::primitives::Id, - ), - CurrentHeadUpdated( - runtime_types::polkadot_parachain::primitives::Id, - ), - CodeUpgradeScheduled( - runtime_types::polkadot_parachain::primitives::Id, - ), - NewHeadNoted(runtime_types::polkadot_parachain::primitives::Id), - ActionQueued( - runtime_types::polkadot_parachain::primitives::Id, - u32, - ), - } - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ParaGenesisArgs { - pub genesis_head: - runtime_types::polkadot_parachain::primitives::HeadData, - pub validation_code: - runtime_types::polkadot_parachain::primitives::ValidationCode, - pub parachain: bool, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + batch { + calls: Vec, + }, + as_derivative { + index: u16, + call: std::boxed::Box, + }, + batch_all { + calls: Vec, + }, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum ParaLifecycle { - Onboarding, - Parathread, - Parachain, - UpgradingParathread, - DowngradingParachain, - OffboardingParathread, - OffboardingParachain, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + TooManyCalls, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ParaPastCodeMeta < _0 > { pub upgrade_times : Vec < runtime_types :: polkadot_runtime_parachains :: paras :: ReplacementTimes < _0 > > , pub last_pruned : Option < _0 > , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ReplacementTimes<_0> { - pub expected_at: _0, - pub activated_at: _0, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + BatchInterrupted(u32, runtime_types::sp_runtime::DispatchError), + BatchCompleted, + ItemCompleted, } } - pub mod paras_inherent { + } + pub mod pallet_vesting { + use super::runtime_types; + pub mod pallet { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - enter { - data: runtime_types::polkadot_primitives::v1::InherentData< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + vest, + vest_other { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + }, + vested_transfer { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, >, - }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - TooManyInclusionInherents, - InvalidParentHeader, - CandidateConcludedInvalid, - } + }, + force_vested_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + u32, + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + u128, + u32, + >, + }, + merge_schedules { + schedule1_index: u32, + schedule2_index: u32, + }, } - } - pub mod scheduler { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum AssignmentKind { - Parachain, - Parathread( - runtime_types::polkadot_primitives::v0::collator_app::Public, - u32, - ), + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotVesting, + AtMaxVestingSchedules, + AmountLow, + ScheduleIndexOutOfBounds, + InvalidScheduleParams, } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v1 :: 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 :: v1 :: GroupIndex , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct ParathreadClaimQueue { pub queue : Vec < runtime_types :: polkadot_runtime_parachains :: scheduler :: QueuedParathread > , pub next_core_offset : u32 , } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct QueuedParathread { - pub claim: runtime_types::polkadot_primitives::v1::ParathreadEntry, - pub core_offset: u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + VestingUpdated(::subxt::sp_core::crypto::AccountId32, u128), + VestingCompleted(::subxt::sp_core::crypto::AccountId32), } } - pub mod shared { + pub mod vesting_info { use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call {} + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestingInfo<_0, _1> { + pub locked: _0, + pub per_block: _0, + pub starting_block: _1, } } - pub mod ump { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Call { - service_overweight { index: u64, weight_limit: u64 }, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - UnknownMessageIndex, - WeightOverLimit, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Event { - InvalidFormat([u8; 32usize]), - UnsupportedVersion([u8; 32usize]), - ExecutedUpward( - [u8; 32usize], - runtime_types::xcm::v2::traits::Outcome, - ), - WeightExhausted([u8; 32usize], u64, u64), - UpwardMessagesReceived( - runtime_types::polkadot_parachain::primitives::Id, - u32, - u32, - ), - OverweightEnqueued( - runtime_types::polkadot_parachain::primitives::Id, - [u8; 32usize], - u64, - u64, - ), - OverweightServiced(u64, u64), - } - } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V0, + V1, } } pub mod primitive_types { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct H256(pub [u8; 32usize]); } pub mod sp_arithmetic { @@ -16701,62 +17948,51 @@ pub mod api { pub mod fixed_point { use super::runtime_types; #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] pub struct FixedU128(pub u128); } pub mod per_things { use super::runtime_types; #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] pub struct PerU16(pub u16); #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] pub struct Perbill(pub u32); #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] pub struct Percent(pub u8); #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] pub struct Permill(pub u32); + #[derive( + :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Perquintill(pub u64); } } pub mod sp_authority_discovery { use super::runtime_types; pub mod app { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } } @@ -16764,16 +18000,12 @@ pub mod api { use super::runtime_types; pub mod app { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Public(pub runtime_types::sp_core::sr25519::Public); } pub mod digests { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum NextConfigDescriptor { V1 { c: (u64, u64), @@ -16781,13 +18013,13 @@ pub mod api { }, } } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum AllowedSlots { PrimarySlots, PrimaryAndSecondaryPlainSlots, PrimaryAndSecondaryVRFSlots, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct BabeEpochConfiguration { pub c: (u64, u64), pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, @@ -16795,7 +18027,7 @@ pub mod api { } pub mod sp_consensus_slots { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct EquivocationProof<_0, _1> { pub offender: _1, pub slot: runtime_types::sp_consensus_slots::Slot, @@ -16803,12 +18035,9 @@ pub mod api { pub second_header: _0, } #[derive( - Debug, - Eq, - PartialEq, - :: codec :: Encode, - :: codec :: Decode, :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, )] pub struct Slot(pub u64); } @@ -16816,9 +18045,7 @@ pub mod api { use super::runtime_types; pub mod changes_trie { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ChangesTrieConfiguration { pub digest_interval: u32, pub digest_levels: u32, @@ -16826,46 +18053,28 @@ pub mod api { } pub mod crypto { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct AccountId32(pub [u8; 32usize]); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KeyTypeId(pub [u8; 4usize]); } pub mod ecdsa { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub struct Public(pub [u8; 33usize]); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Signature(pub [u8; 65usize]); } pub mod ed25519 { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Public(pub [u8; 32usize]); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Signature(pub [u8; 64usize]); } pub mod offchain { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OpaqueMultiaddr(pub Vec); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OpaqueNetworkState { pub peer_id: runtime_types::sp_core::OpaquePeerId, pub external_addresses: @@ -16874,34 +18083,26 @@ pub mod api { } pub mod sr25519 { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Public(pub [u8; 32usize]); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Signature(pub [u8; 64usize]); } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OpaquePeerId(pub Vec); - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Void {} } pub mod sp_finality_grandpa { use super::runtime_types; pub mod app { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Public(pub runtime_types::sp_core::ed25519::Public); - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Equivocation<_0, _1> { Prevote( runtime_types::finality_grandpa::Equivocation< @@ -16918,7 +18119,7 @@ pub mod api { >, ), } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct EquivocationProof<_0, _1> { pub set_id: u64, pub equivocation: @@ -16927,7 +18128,7 @@ pub mod api { } pub mod sp_npos_elections { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Support<_0> { pub total: u128, pub voters: Vec<(_0, u128)>, @@ -16940,12 +18141,12 @@ pub mod api { pub mod digest { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub enum ChangesTrieSignal { NewConfiguration (Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > ,) , } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub struct Digest<_0> { pub logs: Vec< @@ -16953,7 +18154,7 @@ pub mod api { >, } #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub enum DigestItem<_0> { ChangesTrieRoot(_0), @@ -16970,7 +18171,7 @@ pub mod api { pub mod era { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub enum Era { Immortal, @@ -17234,7 +18435,7 @@ pub mod api { pub mod header { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub struct Header<_0, _1> { pub parent_hash: ::subxt::sp_core::H256, @@ -17252,7 +18453,7 @@ pub mod api { pub mod unchecked_extrinsic { use super::runtime_types; #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub struct UncheckedExtrinsic<_0, _1, _2, _3>( Vec, @@ -17262,9 +18463,7 @@ pub mod api { } pub mod multiaddress { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum MultiAddress<_0, _1> { Id(_0), Index(_1), @@ -17275,18 +18474,16 @@ pub mod api { } pub mod traits { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct BlakeTwo256 {} } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum ArithmeticError { Underflow, Overflow, DivisionByZero, } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum DispatchError { Other, CannotLookup, @@ -17297,19 +18494,13 @@ pub mod api { Token(runtime_types::sp_runtime::TokenError), Arithmetic(runtime_types::sp_runtime::ArithmeticError), } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum MultiSignature { Ed25519(runtime_types::sp_core::ed25519::Signature), Sr25519(runtime_types::sp_core::sr25519::Signature), Ecdsa(runtime_types::sp_core::ecdsa::Signature), } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] - pub enum MultiSigner { - Ed25519(runtime_types::sp_core::ed25519::Public), - Sr25519(runtime_types::sp_core::sr25519::Public), - Ecdsa(runtime_types::sp_core::ecdsa::Public), - } - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum TokenError { NoFunds, WouldDie, @@ -17322,7 +18513,7 @@ pub mod api { } pub mod sp_session { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MembershipProof { pub session: u32, pub trie_nodes: Vec>, @@ -17333,18 +18524,24 @@ pub mod api { use super::runtime_types; pub mod offence { use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OffenceDetails<_0, _1> { pub offender: _1, pub reporters: Vec<_0>, } } } + pub mod sp_transaction_storage_proof { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransactionStorageProof { + pub chunk: Vec, + pub proof: Vec>, + } + } pub mod sp_version { use super::runtime_types; - #[derive(Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode)] + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RuntimeVersion { pub spec_name: String, pub impl_name: String, @@ -17355,54 +18552,6 @@ pub mod api { pub transaction_version: u32, } } - pub mod xcm { - use super::runtime_types; - pub mod v2 { - use super::runtime_types; - pub mod traits { - use super::runtime_types; - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Error { - Overflow, - Unimplemented, - UntrustedReserveLocation, - UntrustedTeleportLocation, - MultiLocationFull, - MultiLocationNotInvertible, - BadOrigin, - InvalidLocation, - AssetNotFound, - FailedToTransactAsset, - NotWithdrawable, - LocationCannotHold, - ExceedsMaxMessageSize, - DestinationUnsupported, - Transport, - Unroutable, - UnknownClaim, - FailedToDecode, - TooMuchWeightRequired, - NotHoldingFees, - TooExpensive, - Trap(u64), - UnhandledXcmVersion, - WeightLimitReached(u64), - Barrier, - WeightNotComputable, - } - #[derive( - Debug, Eq, PartialEq, :: codec :: Encode, :: codec :: Decode, - )] - pub enum Outcome { - Complete(u64), - Incomplete(u64, runtime_types::xcm::v2::traits::Error), - Error(runtime_types::xcm::v2::traits::Error), - } - } - } - } } #[doc = r" Default configuration of common types for a target Substrate runtime."] #[derive(Clone, Debug, Default, Eq, PartialEq)] @@ -17477,15 +18626,15 @@ pub mod api { 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 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 authorship(&self) -> authorship::storage::StorageApi<'a, T> { + authorship::storage::StorageApi::new(self.client) + } pub fn indices(&self) -> indices::storage::StorageApi<'a, T> { indices::storage::StorageApi::new(self.client) } @@ -17497,24 +18646,17 @@ pub mod api { ) -> 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 election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { + election_provider_multi_phase::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) } @@ -17526,26 +18668,52 @@ pub mod api { ) -> 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 elections(&self) -> elections::storage::StorageApi<'a, T> { + elections::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 grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { + grandpa::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 contracts(&self) -> contracts::storage::StorageApi<'a, T> { + contracts::storage::StorageApi::new(self.client) } - pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { - vesting::storage::StorageApi::new(self.client) + pub fn sudo(&self) -> sudo::storage::StorageApi<'a, T> { + sudo::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 offences(&self) -> offences::storage::StorageApi<'a, T> { + offences::storage::StorageApi::new(self.client) + } + pub fn randomness_collective_flip( + &self, + ) -> randomness_collective_flip::storage::StorageApi<'a, T> { + randomness_collective_flip::storage::StorageApi::new(self.client) } pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { identity::storage::StorageApi::new(self.client) } + pub fn society(&self) -> society::storage::StorageApi<'a, T> { + society::storage::StorageApi::new(self.client) + } + pub fn recovery(&self) -> recovery::storage::StorageApi<'a, T> { + recovery::storage::StorageApi::new(self.client) + } + pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { + vesting::storage::StorageApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { + scheduler::storage::StorageApi::new(self.client) + } pub fn proxy(&self) -> proxy::storage::StorageApi<'a, T> { proxy::storage::StorageApi::new(self.client) } @@ -17558,55 +18726,28 @@ pub mod api { 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 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 assets(&self) -> assets::storage::StorageApi<'a, T> { + assets::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 mmr(&self) -> mmr::storage::StorageApi<'a, T> { + mmr::storage::StorageApi::new(self.client) } - pub fn paras(&self) -> paras::storage::StorageApi<'a, T> { - paras::storage::StorageApi::new(self.client) + pub fn lottery(&self) -> lottery::storage::StorageApi<'a, T> { + lottery::storage::StorageApi::new(self.client) } - pub fn initializer(&self) -> initializer::storage::StorageApi<'a, T> { - initializer::storage::StorageApi::new(self.client) + pub fn gilt(&self) -> gilt::storage::StorageApi<'a, T> { + gilt::storage::StorageApi::new(self.client) } - pub fn dmp(&self) -> dmp::storage::StorageApi<'a, T> { - dmp::storage::StorageApi::new(self.client) + pub fn uniques(&self) -> uniques::storage::StorageApi<'a, T> { + uniques::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 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 transaction_storage( + &self, + ) -> transaction_storage::storage::StorageApi<'a, T> { + transaction_storage::storage::StorageApi::new(self.client) } - pub fn crowdloan(&self) -> crowdloan::storage::StorageApi<'a, T> { - crowdloan::storage::StorageApi::new(self.client) + pub fn bags_list(&self) -> bags_list::storage::StorageApi<'a, T> { + bags_list::storage::StorageApi::new(self.client) } } pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { @@ -17619,8 +18760,8 @@ pub mod api { pub fn system(&self) -> system::calls::TransactionApi<'a, T> { system::calls::TransactionApi::new(self.client) } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T> { - scheduler::calls::TransactionApi::new(self.client) + pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { + utility::calls::TransactionApi::new(self.client) } pub fn babe(&self) -> babe::calls::TransactionApi<'a, T> { babe::calls::TransactionApi::new(self.client) @@ -17628,14 +18769,19 @@ pub mod api { pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T> { timestamp::calls::TransactionApi::new(self.client) } + pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { + authorship::calls::TransactionApi::new(self.client) + } pub fn indices(&self) -> indices::calls::TransactionApi<'a, T> { indices::calls::TransactionApi::new(self.client) } pub fn balances(&self) -> balances::calls::TransactionApi<'a, T> { balances::calls::TransactionApi::new(self.client) } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { - authorship::calls::TransactionApi::new(self.client) + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::calls::TransactionApi<'a, T> { + election_provider_multi_phase::calls::TransactionApi::new(self.client) } pub fn staking(&self) -> staking::calls::TransactionApi<'a, T> { staking::calls::TransactionApi::new(self.client) @@ -17643,12 +18789,6 @@ pub mod api { pub fn session(&self) -> session::calls::TransactionApi<'a, T> { session::calls::TransactionApi::new(self.client) } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { - grandpa::calls::TransactionApi::new(self.client) - } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { - im_online::calls::TransactionApi::new(self.client) - } pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T> { democracy::calls::TransactionApi::new(self.client) } @@ -17660,31 +18800,44 @@ pub mod api { ) -> technical_committee::calls::TransactionApi<'a, T> { technical_committee::calls::TransactionApi::new(self.client) } - pub fn phragmen_election( - &self, - ) -> phragmen_election::calls::TransactionApi<'a, T> { - phragmen_election::calls::TransactionApi::new(self.client) + pub fn elections(&self) -> elections::calls::TransactionApi<'a, T> { + elections::calls::TransactionApi::new(self.client) } pub fn technical_membership( &self, ) -> technical_membership::calls::TransactionApi<'a, T> { technical_membership::calls::TransactionApi::new(self.client) } + pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { + grandpa::calls::TransactionApi::new(self.client) + } pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T> { treasury::calls::TransactionApi::new(self.client) } - pub fn claims(&self) -> claims::calls::TransactionApi<'a, T> { - claims::calls::TransactionApi::new(self.client) + pub fn contracts(&self) -> contracts::calls::TransactionApi<'a, T> { + contracts::calls::TransactionApi::new(self.client) } - pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T> { - vesting::calls::TransactionApi::new(self.client) + pub fn sudo(&self) -> sudo::calls::TransactionApi<'a, T> { + sudo::calls::TransactionApi::new(self.client) } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { - utility::calls::TransactionApi::new(self.client) + pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { + im_online::calls::TransactionApi::new(self.client) } pub fn identity(&self) -> identity::calls::TransactionApi<'a, T> { identity::calls::TransactionApi::new(self.client) } + pub fn society(&self) -> society::calls::TransactionApi<'a, T> { + society::calls::TransactionApi::new(self.client) + } + pub fn recovery(&self) -> recovery::calls::TransactionApi<'a, T> { + recovery::calls::TransactionApi::new(self.client) + } + pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T> { + vesting::calls::TransactionApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T> { + scheduler::calls::TransactionApi::new(self.client) + } pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T> { proxy::calls::TransactionApi::new(self.client) } @@ -17697,49 +18850,25 @@ pub mod api { pub fn tips(&self) -> tips::calls::TransactionApi<'a, T> { tips::calls::TransactionApi::new(self.client) } - pub fn election_provider_multi_phase( - &self, - ) -> election_provider_multi_phase::calls::TransactionApi<'a, T> { - election_provider_multi_phase::calls::TransactionApi::new(self.client) - } - pub fn configuration(&self) -> configuration::calls::TransactionApi<'a, T> { - configuration::calls::TransactionApi::new(self.client) + pub fn assets(&self) -> assets::calls::TransactionApi<'a, T> { + assets::calls::TransactionApi::new(self.client) } - pub fn paras_shared(&self) -> paras_shared::calls::TransactionApi<'a, T> { - paras_shared::calls::TransactionApi::new(self.client) + pub fn lottery(&self) -> lottery::calls::TransactionApi<'a, T> { + lottery::calls::TransactionApi::new(self.client) } - pub fn para_inclusion(&self) -> para_inclusion::calls::TransactionApi<'a, T> { - para_inclusion::calls::TransactionApi::new(self.client) + pub fn gilt(&self) -> gilt::calls::TransactionApi<'a, T> { + gilt::calls::TransactionApi::new(self.client) } - pub fn para_inherent(&self) -> para_inherent::calls::TransactionApi<'a, T> { - para_inherent::calls::TransactionApi::new(self.client) + pub fn uniques(&self) -> uniques::calls::TransactionApi<'a, T> { + uniques::calls::TransactionApi::new(self.client) } - pub fn paras(&self) -> paras::calls::TransactionApi<'a, T> { - paras::calls::TransactionApi::new(self.client) - } - pub fn initializer(&self) -> initializer::calls::TransactionApi<'a, T> { - initializer::calls::TransactionApi::new(self.client) - } - pub fn dmp(&self) -> dmp::calls::TransactionApi<'a, T> { - dmp::calls::TransactionApi::new(self.client) - } - pub fn ump(&self) -> ump::calls::TransactionApi<'a, T> { - ump::calls::TransactionApi::new(self.client) - } - pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T> { - hrmp::calls::TransactionApi::new(self.client) - } - pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T> { - registrar::calls::TransactionApi::new(self.client) - } - pub fn slots(&self) -> slots::calls::TransactionApi<'a, T> { - slots::calls::TransactionApi::new(self.client) - } - pub fn auctions(&self) -> auctions::calls::TransactionApi<'a, T> { - auctions::calls::TransactionApi::new(self.client) + pub fn transaction_storage( + &self, + ) -> transaction_storage::calls::TransactionApi<'a, T> { + transaction_storage::calls::TransactionApi::new(self.client) } - pub fn crowdloan(&self) -> crowdloan::calls::TransactionApi<'a, T> { - crowdloan::calls::TransactionApi::new(self.client) + pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T> { + bags_list::calls::TransactionApi::new(self.client) } } } From 43f59e41ce1eb327623c555fb9bf76a9ec5da296 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 28 Oct 2021 11:39:29 +0200 Subject: [PATCH 177/216] Add generated type derives for test runtime api --- tests/integration/runtime.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index c3c368bced..1c1af2e044 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -14,5 +14,8 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -#[subxt::subxt(runtime_metadata_path = "tests/integration/node_runtime.scale")] +#[subxt::subxt( + runtime_metadata_path = "tests/integration/node_runtime.scale", + generated_type_derives = "Debug, Eq, PartialEq", +)] pub mod node_runtime {} From c19d2e6a2ce9b0e7ebf51a534ec8c3735bb4fe04 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Thu, 28 Oct 2021 11:41:29 +0200 Subject: [PATCH 178/216] Fmt --- codegen/src/api/mod.rs | 22 ++++-- codegen/src/derives.rs | 8 +- codegen/src/struct_def.rs | 2 +- codegen/src/types.rs | 107 ++++++++++++++++++++++---- examples/custom_type_derives.rs | 2 +- macro/src/lib.rs | 6 +- tests/integration/codegen/polkadot.rs | 16 ++++ 7 files changed, 132 insertions(+), 31 deletions(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 001282ab22..f993639b04 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -18,6 +18,7 @@ mod calls; mod events; mod storage; +use super::GeneratedTypeDerives; use crate::{ ir, struct_def::StructDef, @@ -47,9 +48,12 @@ use syn::{ parse_quote, punctuated::Punctuated, }; -use super::GeneratedTypeDerives; -pub fn generate_runtime_api

(item_mod: syn::ItemMod, path: P, generated_type_derives: Option>) -> TokenStream2 +pub fn generate_runtime_api

( + item_mod: syn::ItemMod, + path: P, + generated_type_derives: Option>, +) -> TokenStream2 where P: AsRef, { @@ -85,7 +89,11 @@ impl RuntimeGenerator { } } - pub fn generate_runtime(&self, item_mod: syn::ItemMod, derives: GeneratedTypeDerives) -> TokenStream2 { + pub fn generate_runtime( + &self, + item_mod: syn::ItemMod, + derives: GeneratedTypeDerives, + ) -> TokenStream2 { let item_mod_ir = ir::ItemMod::from(item_mod); // some hardcoded default type substitutes, can be overridden by user @@ -130,8 +138,12 @@ impl RuntimeGenerator { type_substitutes.insert(path.to_string(), substitute.clone()); } - let type_gen = - TypeGenerator::new(&self.metadata.types, "runtime_types", type_substitutes, derives.clone()); + let type_gen = TypeGenerator::new( + &self.metadata.types, + "runtime_types", + type_substitutes, + derives.clone(), + ); let types_mod = type_gen.generate_types_mod(); let types_mod_ident = types_mod.ident(); let pallets_with_mod_names = self diff --git a/codegen/src/derives.rs b/codegen/src/derives.rs index 5468315f55..a27319b923 100644 --- a/codegen/src/derives.rs +++ b/codegen/src/derives.rs @@ -18,7 +18,7 @@ use syn::punctuated::Punctuated; #[derive(Debug, Clone)] pub struct GeneratedTypeDerives { - derives: Punctuated + derives: Punctuated, } impl GeneratedTypeDerives { @@ -36,8 +36,8 @@ impl GeneratedTypeDerives { impl Default for GeneratedTypeDerives { fn default() -> Self { let mut derives = Punctuated::new(); - derives.push(syn::parse_quote!( ::subxt::codec::Encode )); - derives.push(syn::parse_quote!( ::subxt::codec::Decode )); + derives.push(syn::parse_quote!(::subxt::codec::Encode)); + derives.push(syn::parse_quote!(::subxt::codec::Decode)); Self::new(derives) } } @@ -49,4 +49,4 @@ impl quote::ToTokens for GeneratedTypeDerives { #[derive(#derives)] }) } -} \ No newline at end of file +} diff --git a/codegen/src/struct_def.rs b/codegen/src/struct_def.rs index 146badcef8..1db6c02b13 100644 --- a/codegen/src/struct_def.rs +++ b/codegen/src/struct_def.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use super::GeneratedTypeDerives; use crate::types::{ TypeGenerator, TypePath, @@ -26,7 +27,6 @@ use quote::{ quote, }; use scale_info::form::PortableForm; -use super::GeneratedTypeDerives; #[derive(Debug)] pub struct StructDef { diff --git a/codegen/src/types.rs b/codegen/src/types.rs index 0a8b622e0e..45a65ce85e 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types.rs @@ -14,6 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +use super::GeneratedTypeDerives; use proc_macro2::{ Ident, Span, @@ -38,7 +39,6 @@ use std::collections::{ HashMap, HashSet, }; -use super::GeneratedTypeDerives; #[derive(Debug)] pub struct TypeGenerator<'a> { @@ -772,7 +772,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -813,7 +818,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -853,7 +863,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -930,7 +945,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -989,7 +1009,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1022,7 +1047,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1054,7 +1084,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1091,7 +1126,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1126,7 +1166,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1159,7 +1204,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1198,7 +1248,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1241,7 +1296,12 @@ mod tests { registry.register_type(&meta_type::>()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1287,7 +1347,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1335,7 +1400,12 @@ mod tests { registry.register_type(&meta_type::>()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); @@ -1390,7 +1460,12 @@ mod tests { registry.register_type(&meta_type::()); let portable_types: PortableRegistry = registry.into(); - let type_gen = TypeGenerator::new(&portable_types, "root", Default::default(), Default::default()); + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); let types = type_gen.generate_types_mod(); let tests_mod = get_mod(&types, MOD_PATH).unwrap(); diff --git a/examples/custom_type_derives.rs b/examples/custom_type_derives.rs index 8555703165..ee3d25788f 100644 --- a/examples/custom_type_derives.rs +++ b/examples/custom_type_derives.rs @@ -16,7 +16,7 @@ #[subxt::subxt( runtime_metadata_path = "examples/polkadot_metadata.scale", - generated_type_derives = "Clone, Debug", + generated_type_derives = "Clone, Debug" )] pub mod polkadot {} diff --git a/macro/src/lib.rs b/macro/src/lib.rs index 36c723e684..41706634cf 100644 --- a/macro/src/lib.rs +++ b/macro/src/lib.rs @@ -21,7 +21,7 @@ use proc_macro::TokenStream; use proc_macro_error::proc_macro_error; use syn::{ parse_macro_input, - punctuated::Punctuated + punctuated::Punctuated, }; #[derive(Debug, FromMeta)] @@ -32,9 +32,7 @@ struct RuntimeMetadataArgs { } #[derive(Debug, FromMeta)] -struct GeneratedTypeDerives ( - Punctuated, -); +struct GeneratedTypeDerives(Punctuated); #[proc_macro_attribute] #[proc_macro_error] diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index 1bcd054774..aa45e82c68 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -1,3 +1,19 @@ +// Copyright 2019-2021 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 . + #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] From 1fd0d5f382a42828c9348b20027cd476588e8240 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 11:12:05 +0200 Subject: [PATCH 179/216] Copy WrapperTypeOpaque from substrate, add Encode/Decode --- codegen/src/api/mod.rs | 4 + src/lib.rs | 56 +- tests/integration/codegen/polkadot.rs | 18889 ------------------------ tests/integration/node_runtime.scale | Bin 301517 -> 302446 bytes 4 files changed, 52 insertions(+), 18897 deletions(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index f993639b04..3576fb37c6 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -127,6 +127,10 @@ impl RuntimeGenerator { "sp_arithmetic::per_things::Perquintill", parse_quote!(::subxt::sp_arithmetic::per_things::Perquintill), ), + ( + "frame_support::traits::misc::WrapperKeepOpaque", + parse_quote!(::subxt::WrapperKeepOpaque), + ), ] .iter() .map(|(path, substitute): &(&str, syn::TypePath)| { diff --git a/src/lib.rs b/src/lib.rs index e55c0bcbb0..d3e218da3a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,9 +51,13 @@ pub use sp_runtime; use codec::{ Decode, + DecodeAll, Encode, }; -use core::fmt::Debug; +use core::{ + marker::PhantomData, + fmt::Debug, +}; mod client; mod config; @@ -139,6 +143,17 @@ pub trait Event: Decode { } } +/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of +/// the transaction payload +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Encoded(pub Vec); + +impl codec::Encode for Encoded { + fn encode(&self) -> Vec { + self.0.to_owned() + } +} + /// A phase of a block's execution. #[derive(Clone, Debug, Eq, PartialEq, Decode)] pub enum Phase { @@ -150,13 +165,38 @@ pub enum Phase { Initialization, } -/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of -/// the transaction payload -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct Encoded(pub Vec); +/// A wrapper for any type `T` which implement encode/decode in a way compatible with `Vec`. +/// +/// This type is similar to [`WrapperOpaque`], but it differs in the way it stores the type `T`. +/// While [`WrapperOpaque`] stores the decoded type, the [`WrapperKeepOpaque`] stores the type only +/// in its opaque format, aka as a `Vec`. To access the real type `T` [`Self::try_decode`] needs +/// to be used. +#[derive(Debug, Eq, PartialEq, Default, Clone, Decode, Encode)] +pub struct WrapperKeepOpaque { + data: Vec, + _phantom: PhantomData, +} -impl codec::Encode for Encoded { - fn encode(&self) -> Vec { - self.0.to_owned() +impl WrapperKeepOpaque { + /// Try to decode the wrapped type from the inner `data`. + /// + /// Returns `None` if the decoding failed. + pub fn try_decode(&self) -> Option { + T::decode_all(&mut &self.data[..]).ok() + } + + /// Returns the length of the encoded `T`. + pub fn encoded_len(&self) -> usize { + self.data.len() + } + + /// Returns the encoded data. + pub fn encoded(&self) -> &[u8] { + &self.data + } + + /// Create from the given encoded `data`. + pub fn from_encoded(data: Vec) -> Self { + Self { data, _phantom: PhantomData } } } diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index aa45e82c68..8b13789179 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -1,18890 +1 @@ -// Copyright 2019-2021 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 . -#[allow(dead_code, unused_imports, non_camel_case_types)] -pub mod api { - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - #[codec(index = 0)] - System(system::Event), - #[codec(index = 1)] - Utility(utility::Event), - #[codec(index = 5)] - Indices(indices::Event), - #[codec(index = 6)] - Balances(balances::Event), - #[codec(index = 8)] - ElectionProviderMultiPhase(election_provider_multi_phase::Event), - #[codec(index = 9)] - Staking(staking::Event), - #[codec(index = 10)] - Session(session::Event), - #[codec(index = 11)] - Democracy(democracy::Event), - #[codec(index = 12)] - Council(council::Event), - #[codec(index = 13)] - TechnicalCommittee(technical_committee::Event), - #[codec(index = 14)] - Elections(elections::Event), - #[codec(index = 15)] - TechnicalMembership(technical_membership::Event), - #[codec(index = 16)] - Grandpa(grandpa::Event), - #[codec(index = 17)] - Treasury(treasury::Event), - #[codec(index = 18)] - Contracts(contracts::Event), - #[codec(index = 19)] - Sudo(sudo::Event), - #[codec(index = 20)] - ImOnline(im_online::Event), - #[codec(index = 22)] - Offences(offences::Event), - #[codec(index = 25)] - Identity(identity::Event), - #[codec(index = 26)] - Society(society::Event), - #[codec(index = 27)] - Recovery(recovery::Event), - #[codec(index = 28)] - Vesting(vesting::Event), - #[codec(index = 29)] - Scheduler(scheduler::Event), - #[codec(index = 30)] - Proxy(proxy::Event), - #[codec(index = 31)] - Multisig(multisig::Event), - #[codec(index = 32)] - Bounties(bounties::Event), - #[codec(index = 33)] - Tips(tips::Event), - #[codec(index = 34)] - Assets(assets::Event), - #[codec(index = 36)] - Lottery(lottery::Event), - #[codec(index = 37)] - Gilt(gilt::Event), - #[codec(index = 38)] - Uniques(uniques::Event), - #[codec(index = 39)] - TransactionStorage(transaction_storage::Event), - #[codec(index = 40)] - BagsList(bags_list::Event), - } - pub mod system { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct FillBlock { - pub ratio: ::subxt::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)] - pub struct Remark { - pub remark: Vec, - } - impl ::subxt::Call for Remark { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetHeapPages { - pub pages: 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)] - pub struct SetCode { - pub code: Vec, - } - impl ::subxt::Call for SetCode { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetCodeWithoutChecks { - pub code: Vec, - } - 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)] - pub struct SetChangesTrieConfig { - pub changes_trie_config: Option< - runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, - >, - } - impl ::subxt::Call for SetChangesTrieConfig { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_changes_trie_config"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetStorage { - pub items: Vec<(Vec, Vec)>, - } - impl ::subxt::Call for SetStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_storage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KillStorage { - pub keys: Vec>, - } - impl ::subxt::Call for KillStorage { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_storage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KillPrefix { - pub prefix: Vec, - pub subkeys: u32, - } - impl ::subxt::Call for KillPrefix { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "kill_prefix"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemarkWithEvent { - pub remark: Vec, - } - impl ::subxt::Call for RemarkWithEvent { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "remark_with_event"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn fill_block( - &self, - ratio: ::subxt::sp_arithmetic::per_things::Perbill, - ) -> ::subxt::SubmittableExtrinsic { - let call = FillBlock { ratio }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remark( - &self, - remark: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Remark { remark }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_heap_pages( - &self, - pages: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetHeapPages { pages }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_code( - &self, - code: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetCode { code }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_code_without_checks( - &self, - code: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetCodeWithoutChecks { code }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_changes_trie_config( - &self, - changes_trie_config: Option< - runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetChangesTrieConfig { - changes_trie_config, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_storage( - &self, - items: Vec<(Vec, Vec)>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetStorage { items }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_storage( - &self, - keys: Vec>, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillStorage { keys }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_prefix( - &self, - prefix: Vec, - subkeys: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillPrefix { prefix, subkeys }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remark_with_event( - &self, - remark: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemarkWithEvent { remark }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::frame_system::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ExtrinsicSuccess( - pub 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)] - pub struct ExtrinsicFailed( - pub runtime_types::sp_runtime::DispatchError, - pub 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)] - 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)] - pub struct NewAccount(pub ::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)] - pub struct KilledAccount(pub ::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)] - pub struct Remarked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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(pub ::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< - u32, - runtime_types::pallet_balances::AccountData, - >; - 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 = 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; - 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockHash(pub 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(pub u32); - impl ::subxt::StorageEntry for ExtrinsicData { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExtrinsicData"; - type Value = Vec; - 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 = 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< - ::subxt::sp_core::H256, - >; - 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 = Vec< - runtime_types::frame_system::EventRecord< - runtime_types::node_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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EventTopics(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for EventTopics { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventTopics"; - type Value = Vec<(u32, 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 = 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 = bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ExecutionPhase; - impl ::subxt::StorageEntry for ExecutionPhase { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExecutionPhase"; - type Value = runtime_types::frame_system::Phase; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn account( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_system::AccountInfo< - u32, - runtime_types::pallet_balances::AccountData, - >, - ::subxt::Error, - > { - let entry = Account(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn extrinsic_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = ExtrinsicCount; - self.client.storage().fetch(&entry, hash).await - } - pub async fn block_weight( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::PerDispatchClass, - ::subxt::Error, - > { - let entry = BlockWeight; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn all_extrinsics_len( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = AllExtrinsicsLen; - self.client.storage().fetch(&entry, hash).await - } - pub async fn block_hash( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = BlockHash(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn block_hash_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BlockHash>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn extrinsic_data( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> { - let entry = ExtrinsicData(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn extrinsic_data_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ExtrinsicData>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn number( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Number; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn parent_hash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = ParentHash; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn digest( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_runtime::generic::digest::Digest< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Digest; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn events( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::frame_system::EventRecord< - runtime_types::node_runtime::Event, - ::subxt::sp_core::H256, - >, - >, - ::subxt::Error, - > { - let entry = Events; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn event_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = EventCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn event_topics( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = EventTopics(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn event_topics_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, EventTopics>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn last_runtime_upgrade( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_system::LastRuntimeUpgradeInfo, - >, - ::subxt::Error, - > { - let entry = LastRuntimeUpgrade; - self.client.storage().fetch(&entry, hash).await - } - pub async fn upgraded_to_u32_ref_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = UpgradedToU32RefCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn upgraded_to_triple_ref_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = UpgradedToTripleRefCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn execution_phase( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ExecutionPhase; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod utility { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Batch { - pub calls: Vec, - } - impl ::subxt::Call for Batch { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsDerivative { - pub index: u16, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchAll { - pub calls: Vec, - } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn batch( - &self, - calls: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Batch { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn as_derivative( - &self, - index: u16, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsDerivative { index, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn batch_all( - &self, - calls: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = BatchAll { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_utility::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchInterrupted( - pub u32, - pub 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)] - 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)] - pub struct ItemCompleted {} - impl ::subxt::Event for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; - } - } - } - pub mod babe { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReportEquivocation { - pub equivocation_proof: - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - 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)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: - runtime_types::sp_consensus_slots::EquivocationProof< - runtime_types::sp_runtime::generic::header::Header< - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn report_equivocation( - &self, - equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocation { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn report_equivocation_unsigned( - &self, - equivocation_proof : runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocationUnsigned { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn plan_config_change( - &self, - config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, - ) -> ::subxt::SubmittableExtrinsic { - let call = PlanConfigChange { config }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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 = 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 , 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 = [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 = [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 , 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnderConstruction(pub 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< - [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 = Option<[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 = Option<[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 = (u32, 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EpochConfig; - impl ::subxt::StorageEntry for EpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "EpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextEpochConfig; - impl ::subxt::StorageEntry for NextEpochConfig { - const PALLET: &'static str = "Babe"; - const STORAGE: &'static str = "NextEpochConfig"; - type Value = runtime_types::sp_consensus_babe::BabeEpochConfiguration; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn epoch_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = EpochIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn authorities (& self , 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 , u64 ,) > , :: subxt :: Error >{ - let entry = Authorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn genesis_slot( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::Error, - > { - let entry = GenesisSlot; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_slot( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::Error, - > { - let entry = CurrentSlot; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn randomness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<[u8; 32usize], ::subxt::Error> - { - let entry = Randomness; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn pending_epoch_config_change( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - >, - ::subxt::Error, - > { - let entry = PendingEpochConfigChange; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_randomness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<[u8; 32usize], ::subxt::Error> - { - let entry = NextRandomness; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn next_authorities (& self , 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 , u64 ,) > , :: subxt :: Error >{ - let entry = NextAuthorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn segment_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = SegmentIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn under_construction( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [u8; 32usize], - >, - ::subxt::Error, - > { - let entry = UnderConstruction(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn under_construction_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnderConstruction>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn initialized( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option>, - ::subxt::Error, - > { - let entry = Initialized; - self.client.storage().fetch(&entry, hash).await - } - pub async fn author_vrf_randomness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = AuthorVrfRandomness; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn epoch_start( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<(u32, u32), ::subxt::Error> { - let entry = EpochStart; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lateness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Lateness; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn epoch_config( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::Error, - > { - let entry = EpochConfig; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_epoch_config( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::Error, - > { - let entry = NextEpochConfig; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod timestamp { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Set { - #[codec(compact)] - pub now: u64, - } - impl ::subxt::Call for Set { - const PALLET: &'static str = "Timestamp"; - const FUNCTION: &'static str = "set"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set(&self, now: u64) -> ::subxt::SubmittableExtrinsic { - let call = Set { now }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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 = 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 = bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn now( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Now; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn did_update( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = DidUpdate; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod authorship { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetUncles { - pub new_uncles: Vec< - runtime_types::sp_runtime::generic::header::Header< - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set_uncles( - &self, - new_uncles: Vec< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetUncles { new_uncles }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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 = Vec< - runtime_types::pallet_authorship::UncleEntryItem< - 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 = bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn uncles( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_authorship::UncleEntryItem< - u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Uncles; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn author( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Author; - self.client.storage().fetch(&entry, hash).await - } - pub async fn did_set_uncles( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = DidSetUncles; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod indices { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Claim { - pub index: u32, - } - impl ::subxt::Call for Claim { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "claim"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - pub new: ::subxt::sp_core::crypto::AccountId32, - pub index: u32, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Free { - pub index: u32, - } - impl ::subxt::Call for Free { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "free"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceTransfer { - pub new: ::subxt::sp_core::crypto::AccountId32, - pub index: u32, - pub freeze: bool, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Freeze { - pub index: u32, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Indices"; - const FUNCTION: &'static str = "freeze"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn claim( - &self, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Claim { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { new, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn free(&self, index: u32) -> ::subxt::SubmittableExtrinsic { - let call = Free { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: u32, - freeze: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceTransfer { new, index, freeze }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze( - &self, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Freeze { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_indices::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IndexAssigned(pub ::subxt::sp_core::crypto::AccountId32, pub u32); - impl ::subxt::Event for IndexAssigned { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexAssigned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IndexFreed(pub u32); - impl ::subxt::Event for IndexFreed { - const PALLET: &'static str = "Indices"; - const EVENT: &'static str = "IndexFreed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IndexFrozen(pub u32, pub ::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(pub u32); - impl ::subxt::StorageEntry for Accounts { - const PALLET: &'static str = "Indices"; - const STORAGE: &'static str = "Accounts"; - type Value = (::subxt::sp_core::crypto::AccountId32, u128, bool); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn accounts( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - u128, - bool, - )>, - ::subxt::Error, - > { - let entry = Accounts(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn accounts_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Accounts>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod balances { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetBalance { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub new_free: u128, - #[codec(compact)] - pub new_reserved: u128, - } - impl ::subxt::Call for SetBalance { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "set_balance"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferKeepAlive { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub value: 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)] - pub struct TransferAll { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub keep_alive: bool, - } - impl ::subxt::Call for TransferAll { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "transfer_all"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceUnreserve { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub amount: u128, - } - impl ::subxt::Call for ForceUnreserve { - const PALLET: &'static str = "Balances"; - const FUNCTION: &'static str = "force_unreserve"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn transfer( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { dest, value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_balance( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - new_free: u128, - new_reserved: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetBalance { - who, - new_free, - new_reserved, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceTransfer { - source, - dest, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_keep_alive( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferKeepAlive { dest, value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_all( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - keep_alive: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferAll { dest, keep_alive }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_unreserve( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceUnreserve { who, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_balances::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Endowed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Endowed { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Endowed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DustLost(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for DustLost { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "DustLost"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for Transfer { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BalanceSet( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub u128, - ); - impl ::subxt::Event for BalanceSet { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "BalanceSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Reserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Reserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Reserved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unreserved(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Unreserved { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Unreserved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReserveRepatriated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub 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)] - pub struct Deposit(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Deposit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Withdraw(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Withdraw { - const PALLET: &'static str = "Balances"; - const EVENT: &'static str = "Withdraw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub 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 = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Account(pub ::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; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Locks(pub ::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 < u128 > > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Reserves(pub ::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<[u8; 8usize], u128>, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Balances"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_balances::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn total_issuance( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = TotalIssuance; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::AccountData, - ::subxt::Error, - > { - let entry = Account(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: pallet_balances :: BalanceLock < u128 > > , :: subxt :: Error >{ - let entry = Locks(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn locks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn reserves( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - runtime_types::pallet_balances::ReserveData<[u8; 8usize], u128>, - >, - ::subxt::Error, - > { - let entry = Reserves(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn reserves_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reserves>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod transaction_payment { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct NextFeeMultiplier; - impl ::subxt::StorageEntry for NextFeeMultiplier { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "NextFeeMultiplier"; - type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_transaction_payment::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn next_fee_multiplier( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::Error, - > { - let entry = NextFeeMultiplier; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_transaction_payment::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod election_provider_multi_phase { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubmitUnsigned { pub raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > , 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)] - pub struct SetMinimumUntrustedScore { - pub maybe_next_score: Option<[u128; 3usize]>, - } - 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)] - pub struct SetEmergencyElectionResult { - pub supports: 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)] - pub struct Submit { - pub raw_solution: - runtime_types::pallet_election_provider_multi_phase::RawSolution< - runtime_types::node_runtime::NposSolution16, - >, - pub num_signed_submissions: u32, - } - impl ::subxt::Call for Submit { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn submit_unsigned( - &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, - witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, - ) -> ::subxt::SubmittableExtrinsic { - let call = SubmitUnsigned { - raw_solution, - witness, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_minimum_untrusted_score( - &self, - maybe_next_score: Option<[u128; 3usize]>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMinimumUntrustedScore { maybe_next_score }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_emergency_election_result( - &self, - supports: Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetEmergencyElectionResult { supports }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn submit( - &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, - num_signed_submissions: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Submit { - raw_solution, - num_signed_submissions, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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)] - pub struct SolutionStored( - pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - pub bool, - ); - impl ::subxt::Event for SolutionStored { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SolutionStored"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ElectionFinalized( - pub 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)] - pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Rewarded { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Rewarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Slashed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SignedPhaseStarted(pub u32); - impl ::subxt::Event for SignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SignedPhaseStarted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct UnsignedPhaseStarted(pub 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 = 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; - 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< - ::subxt::sp_core::crypto::AccountId32, - >; - 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 = 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 = 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 < [u128 ; 3usize] , u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionsMap(pub 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 , u128 , runtime_types :: node_runtime :: NposSolution16 > ; - 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 = [u128; 3usize]; - 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 round( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Round; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_phase( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_election_provider_multi_phase::Phase, - ::subxt::Error, - > { - let entry = CurrentPhase; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn queued_solution (& self , 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 :: Error >{ - let entry = QueuedSolution; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: Error >{ - let entry = Snapshot; - self.client.storage().fetch(&entry, hash).await - } - pub async fn desired_targets( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = DesiredTargets; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: Error >{ - let entry = SnapshotMetadata; - self.client.storage().fetch(&entry, hash).await - } - pub async fn signed_submission_next_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = SignedSubmissionNextIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [u128 ; 3usize] , u32 > , :: subxt :: Error >{ - let entry = SignedSubmissionIndices; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submissions_map (& self , _0 : u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , u128 , runtime_types :: node_runtime :: NposSolution16 > , :: subxt :: Error >{ - let entry = SignedSubmissionsMap(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn signed_submissions_map_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SignedSubmissionsMap>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn minimum_untrusted_score( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<[u128; 3usize]>, - ::subxt::Error, - > { - let entry = MinimumUntrustedScore; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod staking { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bond { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub value: 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)] - pub struct BondExtra { - #[codec(compact)] - pub max_additional: u128, - } - impl ::subxt::Call for BondExtra { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "bond_extra"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unbond { - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for Unbond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "unbond"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct WithdrawUnbonded { - pub num_slashing_spans: u32, - } - impl ::subxt::Call for WithdrawUnbonded { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "withdraw_unbonded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Nominate { - pub targets: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - } - impl ::subxt::Call for Nominate { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "nominate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub struct SetController { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for SetController { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_controller"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetValidatorCount { - #[codec(compact)] - pub new: 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)] - pub struct IncreaseValidatorCount { - #[codec(compact)] - pub additional: 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)] - 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)] - 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)] - 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)] - pub struct SetInvulnerables { - pub invulnerables: 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)] - pub struct ForceUnstake { - pub stash: ::subxt::sp_core::crypto::AccountId32, - pub num_slashing_spans: u32, - } - impl ::subxt::Call for ForceUnstake { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "force_unstake"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct CancelDeferredSlash { - pub era: u32, - pub slash_indices: Vec, - } - impl ::subxt::Call for CancelDeferredSlash { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "cancel_deferred_slash"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PayoutStakers { - pub validator_stash: ::subxt::sp_core::crypto::AccountId32, - pub era: u32, - } - impl ::subxt::Call for PayoutStakers { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "payout_stakers"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Rebond { - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for Rebond { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "rebond"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetHistoryDepth { - #[codec(compact)] - pub new_history_depth: u32, - #[codec(compact)] - pub era_items_deleted: 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)] - pub struct ReapStash { - pub stash: ::subxt::sp_core::crypto::AccountId32, - pub num_slashing_spans: u32, - } - impl ::subxt::Call for ReapStash { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "reap_stash"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Kick { - pub who: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - } - impl ::subxt::Call for Kick { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "kick"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetStakingLimits { - pub min_nominator_bond: u128, - pub min_validator_bond: u128, - pub max_nominator_count: Option, - pub max_validator_count: Option, - pub threshold: Option, - } - impl ::subxt::Call for SetStakingLimits { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_staking_limits"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ChillOther { - pub controller: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChillOther { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "chill_other"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn bond( - &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - value: u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Bond { - controller, - value, - payee, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn bond_extra( - &self, - max_additional: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = BondExtra { max_additional }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unbond( - &self, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unbond { value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn withdraw_unbonded( - &self, - num_slashing_spans: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = WithdrawUnbonded { num_slashing_spans }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn validate( - &self, - prefs: runtime_types::pallet_staking::ValidatorPrefs, - ) -> ::subxt::SubmittableExtrinsic { - let call = Validate { prefs }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn nominate( - &self, - targets: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Nominate { targets }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn chill(&self) -> ::subxt::SubmittableExtrinsic { - let call = Chill {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_payee( - &self, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetPayee { payee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_controller( - &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetController { controller }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_validator_count( - &self, - new: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetValidatorCount { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn increase_validator_count( - &self, - additional: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = IncreaseValidatorCount { additional }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn scale_validator_count( - &self, - factor: runtime_types::sp_arithmetic::per_things::Percent, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ScaleValidatorCount { factor }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_no_eras( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNoEras {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_new_era( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNewEra {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_invulnerables( - &self, - invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetInvulnerables { invulnerables }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_unstake( - &self, - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceUnstake { - stash, - num_slashing_spans, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_new_era_always( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNewEraAlways {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_deferred_slash( - &self, - era: u32, - slash_indices: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = CancelDeferredSlash { era, slash_indices }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn payout_stakers( - &self, - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = PayoutStakers { - validator_stash, - era, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn rebond( - &self, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Rebond { value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_history_depth( - &self, - new_history_depth: u32, - era_items_deleted: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetHistoryDepth { - new_history_depth, - era_items_deleted, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reap_stash( - &self, - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReapStash { - stash, - num_slashing_spans, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kick( - &self, - who: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Kick { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_staking_limits( - &self, - min_nominator_bond: u128, - min_validator_bond: u128, - max_nominator_count: Option, - max_validator_count: Option, - threshold: Option, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetStakingLimits { - min_nominator_bond, - min_validator_bond, - max_nominator_count, - max_validator_count, - threshold, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn chill_other( - &self, - controller: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ChillOther { controller }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct EraPaid(pub u32, pub u128, pub u128); - impl ::subxt::Event for EraPaid { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "EraPaid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Rewarded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Rewarded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Rewarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Slashed(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Slashed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OldSlashingReportDiscarded(pub u32); - impl ::subxt::Event for OldSlashingReportDiscarded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "OldSlashingReportDiscarded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Bonded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Bonded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Bonded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unbonded(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Unbonded { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Unbonded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Withdrawn(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Withdrawn { - const PALLET: &'static str = "Staking"; - const EVENT: &'static str = "Withdrawn"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - pub struct PayoutStarted(pub 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 = 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 = 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 = 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 = Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bonded(pub ::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 = 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 = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Ledger(pub ::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, - u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Payee(pub ::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(pub ::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 = 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Nominators(pub ::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< - ::subxt::sp_core::crypto::AccountId32, - >; - 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 = 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 = 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 = 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(pub u32); - impl ::subxt::StorageEntry for ErasStartSessionIndex { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasStartSessionIndex"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasStakers(u32, ::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, - 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(u32, ::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, - 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(u32, ::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(pub u32); - impl ::subxt::StorageEntry for ErasValidatorReward { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasValidatorReward"; - type Value = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ErasRewardPoints(pub 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(pub u32); - impl ::subxt::StorageEntry for ErasTotalStake { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ErasTotalStake"; - type Value = 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 = ::subxt::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 = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UnappliedSlashes(pub u32); - impl ::subxt::StorageEntry for UnappliedSlashes { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "UnappliedSlashes"; - type Value = Vec< - runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, - 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 = Vec<(u32, u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ValidatorSlashInEra(u32, ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for ValidatorSlashInEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ValidatorSlashInEra"; - type Value = (::subxt::sp_arithmetic::per_things::Perbill, 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(u32, ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for NominatorSlashInEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "NominatorSlashInEra"; - type Value = 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(pub ::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(::subxt::sp_core::crypto::AccountId32, u32); - impl ::subxt::StorageEntry for SpanSlash { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "SpanSlash"; - type Value = runtime_types::pallet_staking::slashing::SpanRecord; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct EarliestUnappliedSlash; - impl ::subxt::StorageEntry for EarliestUnappliedSlash { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "EarliestUnappliedSlash"; - type Value = 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 = 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 = Vec<(u32, bool)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_staking::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ChillThreshold; - impl ::subxt::StorageEntry for ChillThreshold { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ChillThreshold"; - type Value = runtime_types::sp_arithmetic::per_things::Percent; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn history_depth( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = HistoryDepth; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validator_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ValidatorCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn minimum_validator_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = MinimumValidatorCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn invulnerables( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Invulnerables; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn bonded( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Bonded(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn bonded_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Bonded>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn min_nominator_bond( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = MinNominatorBond; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn min_validator_bond( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = MinValidatorBond; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn ledger( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::StakingLedger< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Ledger(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn ledger_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Ledger>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn payee( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::Error, - > { - let entry = Payee(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn payee_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Payee>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn validators( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::Error, - > { - let entry = Validators(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validators_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Validators>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn counter_for_validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CounterForValidators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn max_validators_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = MaxValidatorsCount; - self.client.storage().fetch(&entry, hash).await - } - pub async fn nominators( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::Nominations< - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Nominators(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nominators_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Nominators>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn counter_for_nominators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CounterForNominators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn max_nominators_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = MaxNominatorsCount; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_era( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = CurrentEra; - self.client.storage().fetch(&entry, hash).await - } - pub async fn active_era( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ActiveEra; - self.client.storage().fetch(&entry, hash).await - } - pub async fn eras_start_session_index( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = ErasStartSessionIndex(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn eras_start_session_index_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStartSessionIndex>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_stakers( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - ::subxt::Error, - > { - let entry = ErasStakers(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_stakers_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakers>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_stakers_clipped( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - ::subxt::Error, - > { - let entry = ErasStakersClipped(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_stakers_clipped_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakersClipped>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_validator_prefs( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::Error, - > { - let entry = ErasValidatorPrefs(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_validator_prefs_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorPrefs>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_validator_reward( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = ErasValidatorReward(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn eras_validator_reward_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorReward>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_reward_points( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::Error, - > { - let entry = ErasRewardPoints(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_reward_points_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasRewardPoints>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_total_stake( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ErasTotalStake(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_total_stake_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasTotalStake>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn force_era( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Forcing, - ::subxt::Error, - > { - let entry = ForceEra; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn slash_reward_fraction( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::sp_arithmetic::per_things::Perbill, - ::subxt::Error, - > { - let entry = SlashRewardFraction; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn canceled_slash_payout( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CanceledSlashPayout; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn unapplied_slashes( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = UnappliedSlashes(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn unapplied_slashes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnappliedSlashes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bonded_eras( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = BondedEras; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validator_slash_in_era( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_arithmetic::per_things::Perbill, - u128, - )>, - ::subxt::Error, - > { - let entry = ValidatorSlashInEra(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn validator_slash_in_era_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ValidatorSlashInEra>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn nominator_slash_in_era( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = NominatorSlashInEra(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nominator_slash_in_era_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NominatorSlashInEra>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn slashing_spans( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::slashing::SlashingSpans, - >, - ::subxt::Error, - > { - let entry = SlashingSpans(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn slashing_spans_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SlashingSpans>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn span_slash( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::slashing::SpanRecord, - ::subxt::Error, - > { - let entry = SpanSlash(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn span_slash_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpanSlash>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn earliest_unapplied_slash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = EarliestUnappliedSlash; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_planned_session( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CurrentPlannedSession; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn offending_validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = OffendingValidators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn chill_threshold( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - ::subxt::Error, - > { - let entry = ChillThreshold; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod session { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetKeys { - pub keys: runtime_types::node_runtime::SessionKeys, - pub proof: Vec, - } - impl ::subxt::Call for SetKeys { - const PALLET: &'static str = "Session"; - const FUNCTION: &'static str = "set_keys"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set_keys( - &self, - keys: runtime_types::node_runtime::SessionKeys, - proof: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetKeys { keys, proof }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn purge_keys(&self) -> ::subxt::SubmittableExtrinsic { - let call = PurgeKeys {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_session::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewSession(pub 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 = 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 = 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 = 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 = Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_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 = Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NextKeys(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for NextKeys { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::node_runtime::SessionKeys; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct KeyOwner(runtime_types::sp_core::crypto::KeyTypeId, Vec); - 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, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Validators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CurrentIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queued_changed( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = QueuedChanged; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queued_keys( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_runtime::SessionKeys, - )>, - ::subxt::Error, - > { - let entry = QueuedKeys; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn disabled_validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> { - let entry = DisabledValidators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn next_keys( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = NextKeys(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_keys_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NextKeys>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn key_owner( - &self, - _0: runtime_types::sp_core::crypto::KeyTypeId, - _1: Vec, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = KeyOwner(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn key_owner_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, KeyOwner>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod democracy { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Propose { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Second { - #[codec(compact)] - pub proposal: u32, - #[codec(compact)] - pub seconds_upper_bound: u32, - } - impl ::subxt::Call for Second { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "second"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote { - #[codec(compact)] - pub ref_index: u32, - pub vote: runtime_types::pallet_democracy::vote::AccountVote, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct EmergencyCancel { - pub ref_index: u32, - } - impl ::subxt::Call for EmergencyCancel { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "emergency_cancel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - pub struct FastTrack { - pub proposal_hash: ::subxt::sp_core::H256, - pub voting_period: u32, - pub delay: u32, - } - impl ::subxt::Call for FastTrack { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "fast_track"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct CancelReferendum { - #[codec(compact)] - pub ref_index: u32, - } - impl ::subxt::Call for CancelReferendum { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_referendum"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelQueued { - pub which: u32, - } - impl ::subxt::Call for CancelQueued { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_queued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Delegate { - pub to: ::subxt::sp_core::crypto::AccountId32, - pub conviction: runtime_types::pallet_democracy::conviction::Conviction, - pub balance: u128, - } - impl ::subxt::Call for Delegate { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "delegate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub struct NotePreimage { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NotePreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NotePreimageOperational { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NotePreimageOperational { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_preimage_operational"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NoteImminentPreimage { - pub encoded_proposal: Vec, - } - impl ::subxt::Call for NoteImminentPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "note_imminent_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NoteImminentPreimageOperational { - pub encoded_proposal: Vec, - } - 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)] - pub struct ReapPreimage { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub proposal_len_upper_bound: u32, - } - impl ::subxt::Call for ReapPreimage { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "reap_preimage"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct RemoveVote { - pub index: u32, - } - impl ::subxt::Call for RemoveVote { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "remove_vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveOtherVote { - pub target: ::subxt::sp_core::crypto::AccountId32, - pub index: 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)] - pub struct EnactProposal { - pub proposal_hash: ::subxt::sp_core::H256, - pub index: u32, - } - impl ::subxt::Call for EnactProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "enact_proposal"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Blacklist { - pub proposal_hash: ::subxt::sp_core::H256, - pub maybe_ref_index: Option, - } - impl ::subxt::Call for Blacklist { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "blacklist"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelProposal { - #[codec(compact)] - pub prop_index: u32, - } - impl ::subxt::Call for CancelProposal { - const PALLET: &'static str = "Democracy"; - const FUNCTION: &'static str = "cancel_proposal"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - proposal_hash, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn second( - &self, - proposal: u32, - seconds_upper_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Second { - proposal, - seconds_upper_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - ref_index: u32, - vote: runtime_types::pallet_democracy::vote::AccountVote, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { ref_index, vote }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn emergency_cancel( - &self, - ref_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = EmergencyCancel { ref_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = ExternalPropose { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose_majority( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExternalProposeMajority { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose_default( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExternalProposeDefault { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn fast_track( - &self, - proposal_hash: ::subxt::sp_core::H256, - voting_period: u32, - delay: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FastTrack { - proposal_hash, - voting_period, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn veto_external( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = VetoExternal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_referendum( - &self, - ref_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelReferendum { ref_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_queued( - &self, - which: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelQueued { which }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn delegate( - &self, - to: ::subxt::sp_core::crypto::AccountId32, - conviction: runtime_types::pallet_democracy::conviction::Conviction, - balance: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Delegate { - to, - conviction, - balance, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn undelegate(&self) -> ::subxt::SubmittableExtrinsic { - let call = Undelegate {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_public_proposals( - &self, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ClearPublicProposals {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_preimage( - &self, - encoded_proposal: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = NotePreimage { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_preimage_operational( - &self, - encoded_proposal: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = NotePreimageOperational { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_imminent_preimage( - &self, - encoded_proposal: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = NoteImminentPreimage { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_imminent_preimage_operational( - &self, - encoded_proposal: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = NoteImminentPreimageOperational { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reap_preimage( - &self, - proposal_hash: ::subxt::sp_core::H256, - proposal_len_upper_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReapPreimage { - proposal_hash, - proposal_len_upper_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unlock( - &self, - target: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unlock { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_vote( - &self, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveVote { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_other_vote( - &self, - target: ::subxt::sp_core::crypto::AccountId32, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveOtherVote { target, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn enact_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = EnactProposal { - proposal_hash, - index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn blacklist( - &self, - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: Option, - ) -> ::subxt::SubmittableExtrinsic { - let call = Blacklist { - proposal_hash, - maybe_ref_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_proposal( - &self, - prop_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelProposal { prop_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_democracy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed(pub u32, pub u128); - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Tabled( - pub u32, - pub u128, - pub 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)] - 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)] - pub struct Started( - pub u32, - pub 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)] - pub struct Passed(pub u32); - impl ::subxt::Event for Passed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Passed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NotPassed(pub u32); - impl ::subxt::Event for NotPassed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "NotPassed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Cancelled(pub u32); - impl ::subxt::Event for Cancelled { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Cancelled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Executed( - pub u32, - pub 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)] - pub struct Delegated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Undelegated(pub ::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)] - pub struct Vetoed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub u32, - ); - impl ::subxt::Event for Vetoed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Vetoed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PreimageNoted( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for PreimageNoted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageNoted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PreimageUsed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for PreimageUsed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageUsed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PreimageInvalid(pub ::subxt::sp_core::H256, pub u32); - impl ::subxt::Event for PreimageInvalid { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageInvalid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PreimageMissing(pub ::subxt::sp_core::H256, pub u32); - impl ::subxt::Event for PreimageMissing { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageMissing"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PreimageReaped( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub ::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)] - pub struct Blacklisted(pub ::subxt::sp_core::H256); - impl ::subxt::Event for Blacklisted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Blacklisted"; - } - } - 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 = 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 = Vec<( - u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - )>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DepositOf(pub u32); - impl ::subxt::StorageEntry for DepositOf { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "DepositOf"; - type Value = (Vec<::subxt::sp_core::crypto::AccountId32>, u128); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Preimages(pub ::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, - u128, - 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 = 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ReferendumInfoOf(pub u32); - impl ::subxt::StorageEntry for ReferendumInfoOf { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "ReferendumInfoOf"; - type Value = runtime_types::pallet_democracy::types::ReferendumInfo< - u32, - ::subxt::sp_core::H256, - u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct VotingOf(pub ::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< - u128, - ::subxt::sp_core::crypto::AccountId32, - u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Locks(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Locks"; - type Value = 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 = 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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Blacklist { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Blacklist"; - type Value = (u32, 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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Cancellations { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Cancellations"; - type Value = bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_democracy::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn public_prop_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = PublicPropCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn public_props( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<( - u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - )>, - ::subxt::Error, - > { - let entry = PublicProps; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn deposit_of( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - Vec<::subxt::sp_core::crypto::AccountId32>, - u128, - )>, - ::subxt::Error, - > { - let entry = DepositOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn deposit_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DepositOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn preimages( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_democracy::PreimageStatus< - ::subxt::sp_core::crypto::AccountId32, - u128, - u32, - >, - >, - ::subxt::Error, - > { - let entry = Preimages(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn preimages_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Preimages>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn referendum_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ReferendumCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lowest_unbaked( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = LowestUnbaked; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn referendum_info_of( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_democracy::types::ReferendumInfo< - u32, - ::subxt::sp_core::H256, - u128, - >, - >, - ::subxt::Error, - > { - let entry = ReferendumInfoOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn referendum_info_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReferendumInfoOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_democracy::vote::Voting< - u128, - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ::subxt::Error, - > { - let entry = VotingOf(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn voting_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VotingOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn locks( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = Locks(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn locks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn last_tabled_was_external( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = LastTabledWasExternal; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn next_external( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::H256, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - )>, - ::subxt::Error, - > { - let entry = NextExternal; - self.client.storage().fetch(&entry, hash).await - } - pub async fn blacklist( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - u32, - Vec<::subxt::sp_core::crypto::AccountId32>, - )>, - ::subxt::Error, - > { - let entry = Blacklist(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn blacklist_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Blacklist>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn cancellations( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Cancellations(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn cancellations_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Cancellations>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod council { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMembers { - pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: Option<::subxt::sp_core::crypto::AccountId32>, - pub old_count: u32, - } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Execute { - pub proposal: runtime_types::node_runtime::Call, - #[codec(compact)] - pub length_bound: u32, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Propose { - #[codec(compact)] - pub threshold: u32, - pub proposal: runtime_types::node_runtime::Call, - #[codec(compact)] - pub length_bound: u32, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote { - pub proposal: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: u32, - pub approve: bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: u32, - #[codec(compact)] - pub proposal_weight_bound: u64, - #[codec(compact)] - pub length_bound: u32, - } - impl ::subxt::Call for Close { - const PALLET: &'static str = "Council"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set_members( - &self, - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, - prime: Option<::subxt::sp_core::crypto::AccountId32>, - old_count: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMembers { - new_members, - prime, - old_count, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn execute( - &self, - proposal: runtime_types::node_runtime::Call, - length_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Execute { - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose( - &self, - threshold: u32, - proposal: runtime_types::node_runtime::Call, - length_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - threshold, - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: u32, - approve: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { - proposal, - index, - approve, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: u32, - proposal_weight_bound: u64, - length_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = DisapproveProposal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed( - pub ::subxt::sp_core::crypto::AccountId32, - pub u32, - pub ::subxt::sp_core::H256, - pub u32, - ); - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Voted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub bool, - pub u32, - pub u32, - ); - impl ::subxt::Event for Voted { - const PALLET: &'static str = "Council"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Approved(pub ::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)] - pub struct Disapproved(pub ::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)] - pub struct Executed( - pub ::subxt::sp_core::H256, - pub 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)] - pub struct MemberExecuted( - pub ::subxt::sp_core::H256, - pub 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)] - pub struct Closed(pub ::subxt::sp_core::H256, pub u32, pub 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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::node_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting(pub ::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, - 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 = 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 = Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn proposals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Proposals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposal_of( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposal_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod technical_committee { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMembers { - pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, - pub prime: Option<::subxt::sp_core::crypto::AccountId32>, - pub old_count: u32, - } - impl ::subxt::Call for SetMembers { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "set_members"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Execute { - pub proposal: runtime_types::node_runtime::Call, - #[codec(compact)] - pub length_bound: u32, - } - impl ::subxt::Call for Execute { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "execute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Propose { - #[codec(compact)] - pub threshold: u32, - pub proposal: runtime_types::node_runtime::Call, - #[codec(compact)] - pub length_bound: u32, - } - impl ::subxt::Call for Propose { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "propose"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote { - pub proposal: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: u32, - pub approve: bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Close { - pub proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub index: u32, - #[codec(compact)] - pub proposal_weight_bound: u64, - #[codec(compact)] - pub length_bound: u32, - } - impl ::subxt::Call for Close { - const PALLET: &'static str = "TechnicalCommittee"; - const FUNCTION: &'static str = "close"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set_members( - &self, - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, - prime: Option<::subxt::sp_core::crypto::AccountId32>, - old_count: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMembers { - new_members, - prime, - old_count, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn execute( - &self, - proposal: runtime_types::node_runtime::Call, - length_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Execute { - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose( - &self, - threshold: u32, - proposal: runtime_types::node_runtime::Call, - length_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - threshold, - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: u32, - approve: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { - proposal, - index, - approve, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: u32, - proposal_weight_bound: u64, - length_bound: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = DisapproveProposal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed( - pub ::subxt::sp_core::crypto::AccountId32, - pub u32, - pub ::subxt::sp_core::H256, - pub u32, - ); - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Voted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub bool, - pub u32, - pub u32, - ); - impl ::subxt::Event for Voted { - const PALLET: &'static str = "TechnicalCommittee"; - const EVENT: &'static str = "Voted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Approved(pub ::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)] - pub struct Disapproved(pub ::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)] - pub struct Executed( - pub ::subxt::sp_core::H256, - pub 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)] - pub struct MemberExecuted( - pub ::subxt::sp_core::H256, - pub 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)] - pub struct Closed(pub ::subxt::sp_core::H256, pub u32, pub 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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::node_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting(pub ::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, - 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 = 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 = Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn proposals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Proposals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposal_of( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposal_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod elections { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote { - pub votes: Vec<::subxt::sp_core::crypto::AccountId32>, - #[codec(compact)] - pub value: u128, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveVoter {} - impl ::subxt::Call for RemoveVoter { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "remove_voter"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubmitCandidacy { - #[codec(compact)] - pub candidate_count: u32, - } - impl ::subxt::Call for SubmitCandidacy { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "submit_candidacy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RenounceCandidacy { - pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - } - impl ::subxt::Call for RenounceCandidacy { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "renounce_candidacy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveMember { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub has_replacement: bool, - } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "remove_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CleanDefunctVoters { - pub num_voters: u32, - pub num_defunct: u32, - } - impl ::subxt::Call for CleanDefunctVoters { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "clean_defunct_voters"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn vote( - &self, - votes: Vec<::subxt::sp_core::crypto::AccountId32>, - value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { votes, value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_voter( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveVoter {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn submit_candidacy( - &self, - candidate_count: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SubmitCandidacy { candidate_count }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn renounce_candidacy( - &self, - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - ) -> ::subxt::SubmittableExtrinsic { - let call = RenounceCandidacy { renouncing }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_member( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - has_replacement: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveMember { - who, - has_replacement, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clean_defunct_voters( - &self, - num_voters: u32, - num_defunct: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = CleanDefunctVoters { - num_voters, - num_defunct, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewTerm(pub Vec<(::subxt::sp_core::crypto::AccountId32, u128)>); - impl ::subxt::Event for NewTerm { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "NewTerm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct EmptyTerm {} - impl ::subxt::Event for EmptyTerm { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "EmptyTerm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ElectionError {} - impl ::subxt::Event for ElectionError { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "ElectionError"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberKicked(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for MemberKicked { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "MemberKicked"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Renounced(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Renounced { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "Renounced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CandidateSlashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for CandidateSlashed { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "CandidateSlashed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SeatHolderSlashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for SeatHolderSlashed { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "SeatHolderSlashed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Elections"; - const STORAGE: &'static str = "Members"; - type Value = Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct RunnersUp; - impl ::subxt::StorageEntry for RunnersUp { - const PALLET: &'static str = "Elections"; - const STORAGE: &'static str = "RunnersUp"; - type Value = Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Candidates; - impl ::subxt::StorageEntry for Candidates { - const PALLET: &'static str = "Elections"; - const STORAGE: &'static str = "Candidates"; - type Value = Vec<(::subxt::sp_core::crypto::AccountId32, u128)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ElectionRounds; - impl ::subxt::StorageEntry for ElectionRounds { - const PALLET: &'static str = "Elections"; - const STORAGE: &'static str = "ElectionRounds"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Voting(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Voting { - const PALLET: &'static str = "Elections"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn runners_up( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_elections_phragmen::SeatHolder< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = RunnersUp; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn candidates( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<(::subxt::sp_core::crypto::AccountId32, u128)>, - ::subxt::Error, - > { - let entry = Candidates; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn election_rounds( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ElectionRounds; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod technical_membership { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - pub struct ResetMembers { - pub members: 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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn add_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddMember { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveMember { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn swap_member( - &self, - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SwapMember { remove, add }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reset_members( - &self, - members: Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = ResetMembers { members }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn change_key( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ChangeKey { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_prime( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetPrime { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_prime( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearPrime {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_membership::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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 = 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 } - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod grandpa { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReportEquivocation { - pub equivocation_proof: - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - 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)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - 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)] - pub struct NoteStalled { - pub delay: u32, - pub best_finalized_block_number: u32, - } - impl ::subxt::Call for NoteStalled { - const PALLET: &'static str = "Grandpa"; - const FUNCTION: &'static str = "note_stalled"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn report_equivocation( - &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocation { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn report_equivocation_unsigned( - &self, - equivocation_proof : runtime_types :: sp_finality_grandpa :: EquivocationProof < :: subxt :: sp_core :: H256 , u32 >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocationUnsigned { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_stalled( - &self, - delay: u32, - best_finalized_block_number: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = NoteStalled { - delay, - best_finalized_block_number, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_grandpa::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewAuthorities( - pub Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, - ); - impl ::subxt::Event for NewAuthorities { - const PALLET: &'static str = "Grandpa"; - const EVENT: &'static str = "NewAuthorities"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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; - 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; - 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 = 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 = (u32, 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 = u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SetIdSession(pub u64); - impl ::subxt::StorageEntry for SetIdSession { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "SetIdSession"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn state( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_grandpa::StoredState, - ::subxt::Error, - > { - let entry = State; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn pending_change( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange, - >, - ::subxt::Error, - > { - let entry = PendingChange; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_forced( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = NextForced; - self.client.storage().fetch(&entry, hash).await - } - pub async fn stalled( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(u32, u32)>, - ::subxt::Error, - > { - let entry = Stalled; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_set_id( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CurrentSetId; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn set_id_session( - &self, - _0: u64, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = SetIdSession(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn set_id_session_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SetIdSession>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod treasury { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProposeSpend { - #[codec(compact)] - pub value: u128, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for ProposeSpend { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "propose_spend"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RejectProposal { - #[codec(compact)] - pub proposal_id: u32, - } - impl ::subxt::Call for RejectProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "reject_proposal"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveProposal { - #[codec(compact)] - pub proposal_id: u32, - } - impl ::subxt::Call for ApproveProposal { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "approve_proposal"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose_spend( - &self, - value: u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeSpend { value, beneficiary }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reject_proposal( - &self, - proposal_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RejectProposal { proposal_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_proposal( - &self, - proposal_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveProposal { proposal_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_treasury::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed(pub u32); - impl ::subxt::Event for Proposed { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Proposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Spending(pub u128); - impl ::subxt::Event for Spending { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Spending"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Awarded( - pub u32, - pub u128, - pub ::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)] - pub struct Rejected(pub u32, pub u128); - impl ::subxt::Event for Rejected { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rejected"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burnt(pub u128); - impl ::subxt::Event for Burnt { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Burnt"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Rollover(pub u128); - impl ::subxt::Event for Rollover { - const PALLET: &'static str = "Treasury"; - const EVENT: &'static str = "Rollover"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Deposit(pub 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Proposals(pub 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, - 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; - 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 proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposals( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Proposals(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposals_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proposals>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn approvals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - ::subxt::Error, - > { - let entry = Approvals; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod contracts { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Call { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub value: u128, - #[codec(compact)] - pub gas_limit: u64, - pub data: Vec, - } - impl ::subxt::Call for Call { - const PALLET: &'static str = "Contracts"; - const FUNCTION: &'static str = "call"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstantiateWithCode { - #[codec(compact)] - pub endowment: u128, - #[codec(compact)] - pub gas_limit: u64, - pub code: Vec, - pub data: Vec, - pub salt: Vec, - } - impl ::subxt::Call for InstantiateWithCode { - const PALLET: &'static str = "Contracts"; - const FUNCTION: &'static str = "instantiate_with_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Instantiate { - #[codec(compact)] - pub endowment: u128, - #[codec(compact)] - pub gas_limit: u64, - pub code_hash: ::subxt::sp_core::H256, - pub data: Vec, - pub salt: Vec, - } - impl ::subxt::Call for Instantiate { - const PALLET: &'static str = "Contracts"; - const FUNCTION: &'static str = "instantiate"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn call( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - value: u128, - gas_limit: u64, - data: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Call { - dest, - value, - gas_limit, - data, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn instantiate_with_code( - &self, - endowment: u128, - gas_limit: u64, - code: Vec, - data: Vec, - salt: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = InstantiateWithCode { - endowment, - gas_limit, - code, - data, - salt, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn instantiate( - &self, - endowment: u128, - gas_limit: u64, - code_hash: ::subxt::sp_core::H256, - data: Vec, - salt: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Instantiate { - endowment, - gas_limit, - code_hash, - data, - salt, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_contracts::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Instantiated { - pub deployer: ::subxt::sp_core::crypto::AccountId32, - pub contract: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Instantiated { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "Instantiated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Terminated { - pub contract: ::subxt::sp_core::crypto::AccountId32, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Terminated { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "Terminated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CodeStored { - pub code_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for CodeStored { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "CodeStored"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduleUpdated { - pub version: u32, - } - impl ::subxt::Event for ScheduleUpdated { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "ScheduleUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ContractEmitted { - pub contract: ::subxt::sp_core::crypto::AccountId32, - pub data: Vec, - } - impl ::subxt::Event for ContractEmitted { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "ContractEmitted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CodeRemoved { - pub code_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for CodeRemoved { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "CodeRemoved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PristineCode(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for PristineCode { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "PristineCode"; - type Value = Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct CodeStorage(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for CodeStorage { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "CodeStorage"; - type Value = runtime_types::pallet_contracts::wasm::PrefabWasmModule; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct AccountCounter; - impl ::subxt::StorageEntry for AccountCounter { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "AccountCounter"; - type Value = u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ContractInfoOf(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for ContractInfoOf { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "ContractInfoOf"; - type Value = runtime_types::pallet_contracts::storage::RawContractInfo< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct DeletionQueue; - impl ::subxt::StorageEntry for DeletionQueue { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "DeletionQueue"; - type Value = - Vec; - 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 pristine_code( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> - { - let entry = PristineCode(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn pristine_code_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PristineCode>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn code_storage( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_contracts::wasm::PrefabWasmModule, - >, - ::subxt::Error, - > { - let entry = CodeStorage(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn code_storage_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeStorage>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn account_counter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = AccountCounter; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn contract_info_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_contracts::storage::RawContractInfo< - ::subxt::sp_core::H256, - >, - >, - ::subxt::Error, - > { - let entry = ContractInfoOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn contract_info_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ContractInfoOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn deletion_queue( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = DeletionQueue; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod sudo { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Sudo { - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for Sudo { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoUncheckedWeight { - pub call: runtime_types::node_runtime::Call, - pub weight: u64, - } - impl ::subxt::Call for SudoUncheckedWeight { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_unchecked_weight"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetKey { - pub new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for SetKey { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "set_key"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoAs { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for SudoAs { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_as"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn sudo( - &self, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Sudo { call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_unchecked_weight( - &self, - call: runtime_types::node_runtime::Call, - weight: u64, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoUncheckedWeight { call, weight }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_key( - &self, - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetKey { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_as( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = SudoAs { who, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_sudo::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Sudid(pub Result<(), runtime_types::sp_runtime::DispatchError>); - impl ::subxt::Event for Sudid { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "Sudid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KeyChanged(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoAsDone( - pub Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for SudoAsDone { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "SudoAsDone"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Key; - impl ::subxt::StorageEntry for Key { - const PALLET: &'static str = "Sudo"; - const STORAGE: &'static str = "Key"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn key( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::Error, - > { - let entry = Key; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod im_online { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Heartbeat { - pub heartbeat: runtime_types::pallet_im_online::Heartbeat, - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn heartbeat( - &self, - heartbeat: runtime_types::pallet_im_online::Heartbeat, - signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, - ) -> ::subxt::SubmittableExtrinsic { - let call = Heartbeat { - heartbeat, - signature, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_im_online::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct HeartbeatReceived( - pub 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)] - 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)] - pub struct SomeOffline( - pub Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - 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 = 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(u32, 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(u32, ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for AuthoredBlocks { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "AuthoredBlocks"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn heartbeat_after( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = HeartbeatAfter; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn keys (& self , 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 :: Error >{ - let entry = Keys; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn received_heartbeats( - &self, - _0: u32, - _1: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >, - >, - ::subxt::Error, - > { - let entry = ReceivedHeartbeats(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn received_heartbeats_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReceivedHeartbeats>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn authored_blocks( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = AuthoredBlocks(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn authored_blocks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AuthoredBlocks>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod authority_discovery { - use super::runtime_types; - } - pub mod offences { - use super::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)] - pub struct Offence(pub [u8; 16usize], pub Vec); - 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(pub ::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, - u128, - >, - ), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ConcurrentReportsIndex([u8; 16usize], Vec); - impl ::subxt::StorageEntry for ConcurrentReportsIndex { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ConcurrentReportsIndex"; - type Value = 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(pub [u8; 16usize]); - impl ::subxt::StorageEntry for ReportsByKindIndex { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = 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 } - } - pub async fn reports( - &self, - _0: ::subxt::sp_core::H256, - 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, - u128, - >, - ), - >, - >, - ::subxt::Error, - > { - let entry = Reports(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn reports_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reports>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn concurrent_reports_index( - &self, - _0: [u8; 16usize], - _1: Vec, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = ConcurrentReportsIndex(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn concurrent_reports_index_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ConcurrentReportsIndex>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn reports_by_kind_index( - &self, - _0: [u8; 16usize], - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> { - let entry = ReportsByKindIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn reports_by_kind_index_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReportsByKindIndex>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod historical { - use super::runtime_types; - } - pub mod randomness_collective_flip { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct RandomMaterial; - impl ::subxt::StorageEntry for RandomMaterial { - const PALLET: &'static str = "RandomnessCollectiveFlip"; - const STORAGE: &'static str = "RandomMaterial"; - type Value = Vec<::subxt::sp_core::H256>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn random_material( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = RandomMaterial; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod identity { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct SetIdentity { - pub info: 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)] - pub struct SetSubs { - pub subs: 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)] - 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)] - pub struct RequestJudgement { - #[codec(compact)] - pub reg_index: u32, - #[codec(compact)] - pub max_fee: u128, - } - impl ::subxt::Call for RequestJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "request_judgement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelRequest { - pub reg_index: u32, - } - impl ::subxt::Call for CancelRequest { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "cancel_request"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetFee { - #[codec(compact)] - pub index: u32, - #[codec(compact)] - pub fee: u128, - } - impl ::subxt::Call for SetFee { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "set_fee"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetAccountId { - #[codec(compact)] - pub index: 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)] - pub struct SetFields { - #[codec(compact)] - pub index: 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)] - pub struct ProvideJudgement { - #[codec(compact)] - pub reg_index: u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub judgement: runtime_types::pallet_identity::types::Judgement, - } - impl ::subxt::Call for ProvideJudgement { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "provide_judgement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KillIdentity { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for KillIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "kill_identity"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AddSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - 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)] - pub struct RenameSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - 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)] - pub struct RemoveSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for RemoveSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "remove_sub"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn add_registrar( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddRegistrar { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_identity( - &self, - info: runtime_types::pallet_identity::types::IdentityInfo, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetIdentity { info }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_subs( - &self, - subs: Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetSubs { subs }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_identity( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearIdentity {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn request_judgement( - &self, - reg_index: u32, - max_fee: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = RequestJudgement { reg_index, max_fee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_request( - &self, - reg_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelRequest { reg_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_fee( - &self, - index: u32, - fee: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetFee { index, fee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_account_id( - &self, - index: u32, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetAccountId { index, new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_fields( - &self, - index: u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetFields { index, fields }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn provide_judgement( - &self, - reg_index: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - judgement: runtime_types::pallet_identity::types::Judgement, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProvideJudgement { - reg_index, - target, - judgement, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_identity( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillIdentity { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn add_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - data: runtime_types::pallet_identity::types::Data, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddSub { sub, data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn rename_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - data: runtime_types::pallet_identity::types::Data, - ) -> ::subxt::SubmittableExtrinsic { - let call = RenameSub { sub, data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveSub { sub }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn quit_sub(&self) -> ::subxt::SubmittableExtrinsic { - let call = QuitSub {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_identity::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IdentitySet(pub ::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)] - pub struct IdentityCleared( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for IdentityCleared { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IdentityKilled( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for IdentityKilled { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "IdentityKilled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgementRequested( - pub ::subxt::sp_core::crypto::AccountId32, - pub u32, - ); - impl ::subxt::Event for JudgementRequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementRequested"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgementUnrequested( - pub ::subxt::sp_core::crypto::AccountId32, - pub u32, - ); - impl ::subxt::Event for JudgementUnrequested { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementUnrequested"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgementGiven(pub ::subxt::sp_core::crypto::AccountId32, pub u32); - impl ::subxt::Event for JudgementGiven { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "JudgementGiven"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RegistrarAdded(pub u32); - impl ::subxt::Event for RegistrarAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "RegistrarAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubIdentityAdded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for SubIdentityAdded { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityAdded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubIdentityRemoved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for SubIdentityRemoved { - const PALLET: &'static str = "Identity"; - const EVENT: &'static str = "SubIdentityRemoved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubIdentityRevoked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub 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(pub ::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; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct SuperOf(pub ::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(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SubsOf { - const PALLET: &'static str = "Identity"; - const STORAGE: &'static str = "SubsOf"; - type Value = ( - 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< - Option< - runtime_types::pallet_identity::types::RegistrarInfo< - 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 } - } - pub async fn identity_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_identity::types::Registration, - >, - ::subxt::Error, - > { - let entry = IdentityOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn identity_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, IdentityOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn super_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ::subxt::Error, - > { - let entry = SuperOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn super_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuperOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn subs_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - ::subxt::Error, - > { - let entry = SubsOf(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn subs_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, SubsOf>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn registrars( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - Option< - runtime_types::pallet_identity::types::RegistrarInfo< - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >, - ::subxt::Error, - > { - let entry = Registrars; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod society { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bid { - pub value: u128, - } - impl ::subxt::Call for Bid { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unbid { - pub pos: u32, - } - impl ::subxt::Call for Unbid { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "unbid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vouch { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub value: u128, - pub tip: u128, - } - impl ::subxt::Call for Vouch { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "vouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unvouch { - pub pos: u32, - } - impl ::subxt::Call for Unvouch { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "unvouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote { - pub candidate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub approve: bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DefenderVote { - pub approve: bool, - } - impl ::subxt::Call for DefenderVote { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "defender_vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Payout {} - impl ::subxt::Call for Payout { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "payout"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Found { - pub founder: ::subxt::sp_core::crypto::AccountId32, - pub max_members: u32, - pub rules: Vec, - } - impl ::subxt::Call for Found { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "found"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unfound {} - impl ::subxt::Call for Unfound { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "unfound"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgeSuspendedMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub forgive: bool, - } - impl ::subxt::Call for JudgeSuspendedMember { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "judge_suspended_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgeSuspendedCandidate { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub judgement: runtime_types::pallet_society::Judgement, - } - impl ::subxt::Call for JudgeSuspendedCandidate { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "judge_suspended_candidate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMaxMembers { - pub max: u32, - } - impl ::subxt::Call for SetMaxMembers { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "set_max_members"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn bid(&self, value: u128) -> ::subxt::SubmittableExtrinsic { - let call = Bid { value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unbid(&self, pos: u32) -> ::subxt::SubmittableExtrinsic { - let call = Unbid { pos }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vouch( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - value: u128, - tip: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vouch { who, value, tip }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unvouch( - &self, - pos: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unvouch { pos }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - candidate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - approve: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { candidate, approve }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn defender_vote( - &self, - approve: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = DefenderVote { approve }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn payout(&self) -> ::subxt::SubmittableExtrinsic { - let call = Payout {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn found( - &self, - founder: ::subxt::sp_core::crypto::AccountId32, - max_members: u32, - rules: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Found { - founder, - max_members, - rules, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unfound(&self) -> ::subxt::SubmittableExtrinsic { - let call = Unfound {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn judge_suspended_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - forgive: bool, - ) -> ::subxt::SubmittableExtrinsic - { - let call = JudgeSuspendedMember { who, forgive }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn judge_suspended_candidate( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - judgement: runtime_types::pallet_society::Judgement, - ) -> ::subxt::SubmittableExtrinsic - { - let call = JudgeSuspendedCandidate { who, judgement }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_members( - &self, - max: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMaxMembers { max }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_society::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Founded(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Founded { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Founded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bid(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Bid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vouch( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Vouch { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Vouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AutoUnbid(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for AutoUnbid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "AutoUnbid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unbid(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Unbid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unbid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unvouch(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Unvouch { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unvouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Inducted( - pub ::subxt::sp_core::crypto::AccountId32, - pub Vec<::subxt::sp_core::crypto::AccountId32>, - ); - impl ::subxt::Event for Inducted { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Inducted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SuspendedMemberJudgement( - pub ::subxt::sp_core::crypto::AccountId32, - pub bool, - ); - impl ::subxt::Event for SuspendedMemberJudgement { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "SuspendedMemberJudgement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CandidateSuspended(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for CandidateSuspended { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "CandidateSuspended"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberSuspended(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for MemberSuspended { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "MemberSuspended"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Challenged(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Challenged { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Challenged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub bool, - ); - impl ::subxt::Event for Vote { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DefenderVote(pub ::subxt::sp_core::crypto::AccountId32, pub bool); - impl ::subxt::Event for DefenderVote { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "DefenderVote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewMaxMembers(pub u32); - impl ::subxt::Event for NewMaxMembers { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "NewMaxMembers"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unfounded(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Unfounded { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unfounded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Deposit(pub u128); - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Deposit"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Founder; - impl ::subxt::StorageEntry for Founder { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Founder"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Rules; - impl ::subxt::StorageEntry for Rules { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Rules"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Candidates; - impl ::subxt::StorageEntry for Candidates { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Candidates"; - type Value = Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SuspendedCandidates(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SuspendedCandidates { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "SuspendedCandidates"; - type Value = ( - u128, - runtime_types::pallet_society::BidKind< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Pot; - impl ::subxt::StorageEntry for Pot { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Pot"; - type Value = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Head; - impl ::subxt::StorageEntry for Head { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Head"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Members"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SuspendedMembers(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SuspendedMembers { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "SuspendedMembers"; - type Value = bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Bids; - impl ::subxt::StorageEntry for Bids { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Bids"; - type Value = Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Vouching(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Vouching { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Vouching"; - type Value = runtime_types::pallet_society::VouchingStatus; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Payouts(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Payouts { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Payouts"; - type Value = Vec<(u32, u128)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Strikes(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Strikes { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Strikes"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Votes( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for Votes { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Votes"; - type Value = runtime_types::pallet_society::Vote; - 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 Defender; - impl ::subxt::StorageEntry for Defender { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Defender"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DefenderVotes(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for DefenderVotes { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "DefenderVotes"; - type Value = runtime_types::pallet_society::Vote; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MaxMembers; - impl ::subxt::StorageEntry for MaxMembers { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "MaxMembers"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn founder( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Founder; - self.client.storage().fetch(&entry, hash).await - } - pub async fn rules( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = Rules; - self.client.storage().fetch(&entry, hash).await - } - pub async fn candidates( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Candidates; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn suspended_candidates( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - u128, - runtime_types::pallet_society::BidKind< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - )>, - ::subxt::Error, - > { - let entry = SuspendedCandidates(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn suspended_candidates_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuspendedCandidates>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn pot( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Pot; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn head( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Head; - self.client.storage().fetch(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn suspended_members( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = SuspendedMembers(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn suspended_members_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuspendedMembers>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bids( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Bids; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn vouching( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = Vouching(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn vouching_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Vouching>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn payouts( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = Payouts(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn payouts_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Payouts>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn strikes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = Strikes(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn strikes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Strikes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn votes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = Votes(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn votes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Votes>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn defender( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Defender; - self.client.storage().fetch(&entry, hash).await - } - pub async fn defender_votes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = DefenderVotes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn defender_votes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DefenderVotes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn max_members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = MaxMembers; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod recovery { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsRecovered { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for AsRecovered { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "as_recovered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetRecovered { - pub lost: ::subxt::sp_core::crypto::AccountId32, - pub rescuer: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetRecovered { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "set_recovered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CreateRecovery { - pub friends: Vec<::subxt::sp_core::crypto::AccountId32>, - pub threshold: u16, - pub delay_period: u32, - } - impl ::subxt::Call for CreateRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "create_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InitiateRecovery { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for InitiateRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "initiate_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VouchRecovery { - pub lost: ::subxt::sp_core::crypto::AccountId32, - pub rescuer: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for VouchRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "vouch_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClaimRecovery { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ClaimRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "claim_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CloseRecovery { - pub rescuer: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for CloseRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "close_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveRecovery {} - impl ::subxt::Call for RemoveRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "remove_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelRecovered { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for CancelRecovered { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "cancel_recovered"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn as_recovered( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsRecovered { account, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_recovered( - &self, - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetRecovered { lost, rescuer }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn create_recovery( - &self, - friends: Vec<::subxt::sp_core::crypto::AccountId32>, - threshold: u16, - delay_period: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CreateRecovery { - friends, - threshold, - delay_period, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn initiate_recovery( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = InitiateRecovery { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vouch_recovery( - &self, - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = VouchRecovery { lost, rescuer }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn claim_recovery( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClaimRecovery { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close_recovery( - &self, - rescuer: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseRecovery { rescuer }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_recovery( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveRecovery {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_recovered( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelRecovered { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_recovery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryCreated(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for RecoveryCreated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryInitiated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for RecoveryInitiated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryInitiated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryVouched( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for RecoveryVouched { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryVouched"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryClosed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for RecoveryClosed { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryClosed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AccountRecovered( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for AccountRecovered { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "AccountRecovered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryRemoved(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for RecoveryRemoved { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryRemoved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Recoverable(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Recoverable { - const PALLET: &'static str = "Recovery"; - const STORAGE: &'static str = "Recoverable"; - type Value = runtime_types::pallet_recovery::RecoveryConfig< - u32, - u128, - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct ActiveRecoveries( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ActiveRecoveries { - const PALLET: &'static str = "Recovery"; - const STORAGE: &'static str = "ActiveRecoveries"; - type Value = runtime_types::pallet_recovery::ActiveRecovery< - u32, - 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::Twox64Concat, - ), - ]) - } - } - pub struct Proxy(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Proxy { - const PALLET: &'static str = "Recovery"; - const STORAGE: &'static str = "Proxy"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn recoverable( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_recovery::RecoveryConfig< - u32, - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Recoverable(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn recoverable_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Recoverable>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn active_recoveries( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_recovery::ActiveRecovery< - u32, - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = ActiveRecoveries(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn active_recoveries_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ActiveRecoveries>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn proxy( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Proxy(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proxy_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Proxy>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod vesting { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct VestOther { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for VestOther { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest_other"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestedTransfer { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo, - } - impl ::subxt::Call for VestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vested_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceVestedTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo, - } - impl ::subxt::Call for ForceVestedTransfer { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "force_vested_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MergeSchedules { - pub schedule1_index: u32, - pub schedule2_index: u32, - } - impl ::subxt::Call for MergeSchedules { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "merge_schedules"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn vest(&self) -> ::subxt::SubmittableExtrinsic { - let call = Vest {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vest_other( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = VestOther { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vested_transfer( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - u128, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = VestedTransfer { target, schedule }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_vested_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - u128, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceVestedTransfer { - source, - target, - schedule, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn merge_schedules( - &self, - schedule1_index: u32, - schedule2_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = MergeSchedules { - schedule1_index, - schedule2_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_vesting::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestingUpdated( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for VestingUpdated { - const PALLET: &'static str = "Vesting"; - const EVENT: &'static str = "VestingUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestingCompleted(pub ::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(pub ::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< - u128, - u32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Vesting"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_vesting::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn vesting( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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< - u128, - u32, - >, - >, - >, - ::subxt::Error, - > { - let entry = Vesting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn vesting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Vesting>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_vesting::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod scheduler { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Schedule { - pub when: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for Schedule { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Cancel { - pub when: u32, - pub index: u32, - } - impl ::subxt::Call for Cancel { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduleNamed { - pub id: Vec, - pub when: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelNamed { - pub id: Vec, - } - impl ::subxt::Call for CancelNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "cancel_named"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduleAfter { - pub after: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_after"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduleNamedAfter { - pub id: Vec, - pub after: u32, - pub maybe_periodic: Option<(u32, u32)>, - pub priority: u8, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named_after"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn schedule( - &self, - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Schedule { - when, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel( - &self, - when: u32, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Cancel { when, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn schedule_named( - &self, - id: Vec, - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_named( - &self, - id: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelNamed { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn schedule_after( - &self, - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ScheduleAfter { - after, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn schedule_named_after( - &self, - id: Vec, - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_scheduler::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Scheduled(pub u32, pub u32); - impl ::subxt::Event for Scheduled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Scheduled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Canceled(pub u32, pub u32); - impl ::subxt::Event for Canceled { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Canceled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Dispatched( - pub (u32, u32), - pub Option>, - pub Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for Dispatched { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Agenda(pub u32); - impl ::subxt::StorageEntry for Agenda { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Agenda"; - type Value = Vec< - Option< - runtime_types::pallet_scheduler::ScheduledV2< - runtime_types::node_runtime::Call, - u32, - runtime_types::node_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(pub Vec); - impl ::subxt::StorageEntry for Lookup { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "Lookup"; - type Value = (u32, u32); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_scheduler::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 agenda( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - Option< - runtime_types::pallet_scheduler::ScheduledV2< - runtime_types::node_runtime::Call, - u32, - runtime_types::node_runtime::OriginCaller, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >, - ::subxt::Error, - > { - let entry = Agenda(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn agenda_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Agenda>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn lookup( - &self, - _0: Vec, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<(u32, u32)>, - ::subxt::Error, - > { - let entry = Lookup(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn lookup_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Lookup>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_scheduler::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod proxy { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: Option, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AddProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::node_runtime::ProxyType, - pub delay: u32, - } - impl ::subxt::Call for AddProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "add_proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::node_runtime::ProxyType, - pub delay: u32, - } - impl ::subxt::Call for RemoveProxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "remove_proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Anonymous { - pub proxy_type: runtime_types::node_runtime::ProxyType, - pub delay: u32, - pub index: u16, - } - impl ::subxt::Call for Anonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "anonymous"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KillAnonymous { - pub spawner: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::node_runtime::ProxyType, - pub index: u16, - #[codec(compact)] - pub height: u32, - #[codec(compact)] - pub ext_index: u32, - } - impl ::subxt::Call for KillAnonymous { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "kill_anonymous"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - pub struct ProxyAnnounced { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: Option, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn proxy( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: Option, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Proxy { - real, - force_proxy_type, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn add_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddProxy { - delegate, - proxy_type, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxy { - delegate, - proxy_type, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_proxies( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxies {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn anonymous( - &self, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: u32, - index: u16, - ) -> ::subxt::SubmittableExtrinsic { - let call = Anonymous { - proxy_type, - delay, - index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_anonymous( - &self, - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - index: u16, - height: u32, - ext_index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillAnonymous { - spawner, - proxy_type, - index, - height, - ext_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn announce( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = Announce { real, call_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_announcement( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RemoveAnnouncement { real, call_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reject_announcement( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RejectAnnouncement { - delegate, - call_hash, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn proxy_announced( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: Option, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProxyAnnounced { - delegate, - real, - force_proxy_type, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_proxy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProxyExecuted( - pub 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)] - pub struct AnonymousCreated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::node_runtime::ProxyType, - pub u16, - ); - impl ::subxt::Event for AnonymousCreated { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "AnonymousCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Announced( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct ProxyAdded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::node_runtime::ProxyType, - pub u32, - ); - impl ::subxt::Event for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proxies(pub ::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::node_runtime::ProxyType, - u32, - >, - >, - u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Announcements(pub ::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, - u32, - >, - >, - u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn proxies( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::node_runtime::ProxyType, - u32, - >, - >, - u128, - ), - ::subxt::Error, - > { - let entry = Proxies(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proxies_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proxies>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn announcements( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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, - u32, - >, - >, - u128, - ), - ::subxt::Error, - > { - let entry = Announcements(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn announcements_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Announcements>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod multisig { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsMultiThreshold1 { - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold1"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsMulti { - pub threshold: u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: - Option>, - pub call: runtime_types::frame_support::traits::misc::WrapperKeepOpaque< - runtime_types::node_runtime::Call, - >, - pub store_call: bool, - pub max_weight: u64, - } - impl ::subxt::Call for AsMulti { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveAsMulti { - pub threshold: u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub maybe_timepoint: - Option>, - pub call_hash: [u8; 32usize], - pub max_weight: 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)] - pub struct CancelAsMulti { - pub threshold: u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - pub timepoint: runtime_types::pallet_multisig::Timepoint, - pub call_hash: [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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn as_multi_threshold1( - &self, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMultiThreshold1 { - other_signatories, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn as_multi( - &self, - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: Option< - runtime_types::pallet_multisig::Timepoint, - >, - call: runtime_types::frame_support::traits::misc::WrapperKeepOpaque< - runtime_types::node_runtime::Call, - >, - store_call: bool, - max_weight: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call, - store_call, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_as_multi( - &self, - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: Option< - runtime_types::pallet_multisig::Timepoint, - >, - call_hash: [u8; 32usize], - max_weight: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_as_multi( - &self, - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: runtime_types::pallet_multisig::Timepoint, - call_hash: [u8; 32usize], - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_multisig::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewMultisig( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], - ); - impl ::subxt::Event for NewMultisig { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "NewMultisig"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MultisigApproval( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint, - pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], - ); - impl ::subxt::Event for MultisigApproval { - const PALLET: &'static str = "Multisig"; - const EVENT: &'static str = "MultisigApproval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MultisigExecuted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint, - pub ::subxt::sp_core::crypto::AccountId32, - pub [u8; 32usize], - pub 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)] - pub struct MultisigCancelled( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint, - pub ::subxt::sp_core::crypto::AccountId32, - pub [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(::subxt::sp_core::crypto::AccountId32, [u8; 32usize]); - impl ::subxt::StorageEntry for Multisigs { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Multisigs"; - type Value = runtime_types::pallet_multisig::Multisig< - u32, - 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(pub [u8; 32usize]); - impl ::subxt::StorageEntry for Calls { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = ( - runtime_types::frame_support::traits::misc::WrapperKeepOpaque< - runtime_types::node_runtime::Call, - >, - ::subxt::sp_core::crypto::AccountId32, - u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn multisigs( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: [u8; 32usize], - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_multisig::Multisig< - u32, - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Multisigs(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn multisigs_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Multisigs>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn calls( - &self, - _0: [u8; 32usize], - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::frame_support::traits::misc::WrapperKeepOpaque< - runtime_types::node_runtime::Call, - >, - ::subxt::sp_core::crypto::AccountId32, - u128, - )>, - ::subxt::Error, - > { - let entry = Calls(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn calls_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Calls>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod bounties { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProposeBounty { - #[codec(compact)] - pub value: u128, - pub description: Vec, - } - impl ::subxt::Call for ProposeBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveBounty { - #[codec(compact)] - pub bounty_id: u32, - } - impl ::subxt::Call for ApproveBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "approve_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProposeCurator { - #[codec(compact)] - pub bounty_id: u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub fee: u128, - } - impl ::subxt::Call for ProposeCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "propose_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct UnassignCurator { - #[codec(compact)] - pub bounty_id: u32, - } - impl ::subxt::Call for UnassignCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "unassign_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AcceptCurator { - #[codec(compact)] - pub bounty_id: u32, - } - impl ::subxt::Call for AcceptCurator { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "accept_curator"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AwardBounty { - #[codec(compact)] - pub bounty_id: u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for AwardBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "award_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClaimBounty { - #[codec(compact)] - pub bounty_id: u32, - } - impl ::subxt::Call for ClaimBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "claim_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CloseBounty { - #[codec(compact)] - pub bounty_id: u32, - } - impl ::subxt::Call for CloseBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "close_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ExtendBountyExpiry { - #[codec(compact)] - pub bounty_id: u32, - pub remark: Vec, - } - impl ::subxt::Call for ExtendBountyExpiry { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "extend_bounty_expiry"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose_bounty( - &self, - value: u128, - description: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeBounty { value, description }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_bounty( - &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveBounty { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose_curator( - &self, - bounty_id: u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - fee: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeCurator { - bounty_id, - curator, - fee, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unassign_curator( - &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = UnassignCurator { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn accept_curator( - &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AcceptCurator { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn award_bounty( - &self, - bounty_id: u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = AwardBounty { - bounty_id, - beneficiary, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn claim_bounty( - &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClaimBounty { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close_bounty( - &self, - bounty_id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseBounty { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn extend_bounty_expiry( - &self, - bounty_id: u32, - remark: Vec, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExtendBountyExpiry { bounty_id, remark }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_bounties::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BountyProposed(pub u32); - impl ::subxt::Event for BountyProposed { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyProposed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BountyRejected(pub u32, pub u128); - impl ::subxt::Event for BountyRejected { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyRejected"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BountyBecameActive(pub u32); - impl ::subxt::Event for BountyBecameActive { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyBecameActive"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BountyAwarded(pub u32, pub ::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)] - pub struct BountyClaimed( - pub u32, - pub u128, - pub ::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)] - pub struct BountyCanceled(pub u32); - impl ::subxt::Event for BountyCanceled { - const PALLET: &'static str = "Bounties"; - const EVENT: &'static str = "BountyCanceled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BountyExtended(pub 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 = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Bounties(pub 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, - u128, - u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct BountyDescriptions(pub u32); - impl ::subxt::StorageEntry for BountyDescriptions { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyDescriptions"; - type Value = Vec; - 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 = Vec; - 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 bounty_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = BountyCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn bounties( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_bounties::Bounty< - ::subxt::sp_core::crypto::AccountId32, - u128, - u32, - >, - >, - ::subxt::Error, - > { - let entry = Bounties(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn bounties_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Bounties>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bounty_descriptions( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> - { - let entry = BountyDescriptions(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn bounty_descriptions_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BountyDescriptions>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bounty_approvals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> { - let entry = BountyApprovals; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod tips { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReportAwesome { - pub reason: Vec, - 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)] - 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)] - pub struct TipNew { - pub reason: Vec, - pub who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - pub tip_value: u128, - } - impl ::subxt::Call for TipNew { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip_new"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Tip { - pub hash: ::subxt::sp_core::H256, - #[codec(compact)] - pub tip_value: u128, - } - impl ::subxt::Call for Tip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn report_awesome( - &self, - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReportAwesome { reason, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn retract_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = RetractTip { hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn tip_new( - &self, - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - tip_value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = TipNew { - reason, - who, - tip_value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn tip( - &self, - hash: ::subxt::sp_core::H256, - tip_value: u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Tip { hash, tip_value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseTip { hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn slash_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = SlashTip { hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_tips::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewTip(pub ::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)] - pub struct TipClosing(pub ::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)] - pub struct TipClosed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for TipClosed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TipRetracted(pub ::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)] - pub struct TipSlashed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub 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(pub ::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, - u128, - 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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reasons { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Reasons"; - type Value = Vec; - 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 tips( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_tips::OpenTip< - ::subxt::sp_core::crypto::AccountId32, - u128, - u32, - ::subxt::sp_core::H256, - >, - >, - ::subxt::Error, - > { - let entry = Tips(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn tips_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Tips>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn reasons( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option>, ::subxt::Error> - { - let entry = Reasons(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn reasons_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reasons>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod assets { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Create { - #[codec(compact)] - pub id: u32, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub min_balance: u64, - } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreate { - #[codec(compact)] - pub id: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub is_sufficient: bool, - #[codec(compact)] - pub min_balance: u64, - } - impl ::subxt::Call for ForceCreate { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroy { - #[codec(compact)] - pub id: u32, - pub witness: runtime_types::pallet_assets::types::DestroyWitness, - } - impl ::subxt::Call for Destroy { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "destroy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Mint { - #[codec(compact)] - pub id: u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for Mint { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "mint"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burn { - #[codec(compact)] - pub id: u32, - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for Burn { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "burn"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - #[codec(compact)] - pub id: u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferKeepAlive { - #[codec(compact)] - pub id: u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for TransferKeepAlive { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer_keep_alive"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceTransfer { - #[codec(compact)] - pub id: u32, - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Freeze { - #[codec(compact)] - pub id: u32, - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "freeze"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thaw { - #[codec(compact)] - pub id: u32, - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for Thaw { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "thaw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct FreezeAsset { - #[codec(compact)] - pub id: u32, - } - impl ::subxt::Call for FreezeAsset { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "freeze_asset"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ThawAsset { - #[codec(compact)] - pub id: u32, - } - impl ::subxt::Call for ThawAsset { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "thaw_asset"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferOwnership { - #[codec(compact)] - pub id: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for TransferOwnership { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer_ownership"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetTeam { - #[codec(compact)] - pub id: u32, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for SetTeam { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "set_team"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMetadata { - #[codec(compact)] - pub id: u32, - pub name: Vec, - pub symbol: Vec, - pub decimals: u8, - } - impl ::subxt::Call for SetMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "set_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearMetadata { - #[codec(compact)] - pub id: u32, - } - impl ::subxt::Call for ClearMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "clear_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceSetMetadata { - #[codec(compact)] - pub id: u32, - pub name: Vec, - pub symbol: Vec, - pub decimals: u8, - pub is_frozen: bool, - } - impl ::subxt::Call for ForceSetMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_set_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceClearMetadata { - #[codec(compact)] - pub id: u32, - } - impl ::subxt::Call for ForceClearMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_clear_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceAssetStatus { - #[codec(compact)] - pub id: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub min_balance: u64, - pub is_sufficient: bool, - pub is_frozen: bool, - } - impl ::subxt::Call for ForceAssetStatus { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_asset_status"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveTransfer { - #[codec(compact)] - pub id: u32, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for ApproveTransfer { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "approve_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelApproval { - #[codec(compact)] - pub id: u32, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for CancelApproval { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "cancel_approval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCancelApproval { - #[codec(compact)] - pub id: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for ForceCancelApproval { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_cancel_approval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferApproved { - #[codec(compact)] - pub id: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub destination: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - pub amount: u64, - } - impl ::subxt::Call for TransferApproved { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer_approved"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn create( - &self, - id: u32, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - min_balance: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Create { - id, - admin, - min_balance, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_create( - &self, - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - is_sufficient: bool, - min_balance: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceCreate { - id, - owner, - is_sufficient, - min_balance, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn destroy( - &self, - id: u32, - witness: runtime_types::pallet_assets::types::DestroyWitness, - ) -> ::subxt::SubmittableExtrinsic { - let call = Destroy { id, witness }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn mint( - &self, - id: u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Mint { - id, - beneficiary, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn burn( - &self, - id: u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Burn { id, who, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer( - &self, - id: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { id, target, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_keep_alive( - &self, - id: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferKeepAlive { id, target, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_transfer( - &self, - id: u32, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceTransfer { - id, - source, - dest, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze( - &self, - id: u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Freeze { id, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw( - &self, - id: u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Thaw { id, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze_asset( - &self, - id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FreezeAsset { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw_asset( - &self, - id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ThawAsset { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_ownership( - &self, - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferOwnership { id, owner }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_team( - &self, - id: u32, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetTeam { - id, - issuer, - admin, - freezer, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_metadata( - &self, - id: u32, - name: Vec, - symbol: Vec, - decimals: u8, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMetadata { - id, - name, - symbol, - decimals, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_metadata( - &self, - id: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearMetadata { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_set_metadata( - &self, - id: u32, - name: Vec, - symbol: Vec, - decimals: u8, - is_frozen: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceSetMetadata { - id, - name, - symbol, - decimals, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_clear_metadata( - &self, - id: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceClearMetadata { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_asset_status( - &self, - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - min_balance: u64, - is_sufficient: bool, - is_frozen: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceAssetStatus { - id, - owner, - issuer, - admin, - freezer, - min_balance, - is_sufficient, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_transfer( - &self, - id: u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveTransfer { - id, - delegate, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_approval( - &self, - id: u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelApproval { id, delegate }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_cancel_approval( - &self, - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceCancelApproval { - id, - owner, - delegate, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_approved( - &self, - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - destination: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferApproved { - id, - owner, - destination, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_assets::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Created( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Created { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Created"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Issued( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u64, - ); - impl ::subxt::Event for Issued { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Issued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transferred( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u64, - ); - impl ::subxt::Event for Transferred { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Transferred"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burned( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u64, - ); - impl ::subxt::Event for Burned { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Burned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TeamChanged( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for TeamChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TeamChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OwnerChanged(pub u32, pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for OwnerChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "OwnerChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Frozen(pub u32, pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Frozen { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Frozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thawed(pub u32, pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Thawed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Thawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetFrozen(pub u32); - impl ::subxt::Event for AssetFrozen { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetFrozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetThawed(pub u32); - impl ::subxt::Event for AssetThawed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetThawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroyed(pub u32); - impl ::subxt::Event for Destroyed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Destroyed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreated(pub u32, pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for ForceCreated { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ForceCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataSet(pub u32, pub Vec, pub Vec, pub u8, pub bool); - impl ::subxt::Event for MetadataSet { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataCleared(pub u32); - impl ::subxt::Event for MetadataCleared { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovedTransfer( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u64, - ); - impl ::subxt::Event for ApprovedTransfer { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovedTransfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovalCancelled( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ApprovalCancelled { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalCancelled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferredApproved( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u64, - ); - impl ::subxt::Event for TransferredApproved { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TransferredApproved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetStatusChanged(pub u32); - impl ::subxt::Event for AssetStatusChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetStatusChanged"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Asset(pub u32); - impl ::subxt::StorageEntry for Asset { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Asset"; - type Value = runtime_types::pallet_assets::types::AssetDetails< - u64, - ::subxt::sp_core::crypto::AccountId32, - u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Account(u32, ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Account { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Account"; - type Value = runtime_types::pallet_assets::types::AssetBalance; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Approvals( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for Approvals { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Approvals"; - type Value = runtime_types::pallet_assets::types::Approval; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.2, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Metadata(pub u32); - impl ::subxt::StorageEntry for Metadata { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Metadata"; - type Value = runtime_types::pallet_assets::types::AssetMetadata< - u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn asset( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_assets::types::AssetDetails< - u64, - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Asset(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn asset_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn account( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_assets::types::AssetBalance, - ::subxt::Error, - > { - let entry = Account(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn approvals( - &self, - _0: u32, - _1: ::subxt::sp_core::crypto::AccountId32, - _2: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_assets::types::Approval, - >, - ::subxt::Error, - > { - let entry = Approvals(_0, _1, _2); - self.client.storage().fetch(&entry, hash).await - } - pub async fn approvals_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Approvals>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn metadata( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_assets::types::AssetMetadata< - u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - >, - ::subxt::Error, - > { - let entry = Metadata(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn metadata_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Metadata>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod mmr { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct RootHash; - impl ::subxt::StorageEntry for RootHash { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "RootHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NumberOfLeaves; - impl ::subxt::StorageEntry for NumberOfLeaves { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "NumberOfLeaves"; - type Value = u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Nodes(pub u64); - impl ::subxt::StorageEntry for Nodes { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "Nodes"; - type Value = ::subxt::sp_core::H256; - 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 root_hash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = RootHash; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn number_of_leaves( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = NumberOfLeaves; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn nodes( - &self, - _0: u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = Nodes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nodes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Nodes>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod lottery { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BuyTicket { - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for BuyTicket { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "buy_ticket"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetCalls { - pub calls: Vec, - } - impl ::subxt::Call for SetCalls { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "set_calls"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct StartLottery { - pub price: u128, - pub length: u32, - pub delay: u32, - pub repeat: bool, - } - impl ::subxt::Call for StartLottery { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "start_lottery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct StopRepeat {} - impl ::subxt::Call for StopRepeat { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "stop_repeat"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn buy_ticket( - &self, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = BuyTicket { call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_calls( - &self, - calls: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetCalls { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn start_lottery( - &self, - price: u128, - length: u32, - delay: u32, - repeat: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = StartLottery { - price, - length, - delay, - repeat, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn stop_repeat( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = StopRepeat {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_lottery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct LotteryStarted {} - impl ::subxt::Event for LotteryStarted { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "LotteryStarted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CallsUpdated {} - impl ::subxt::Event for CallsUpdated { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "CallsUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Winner(pub ::subxt::sp_core::crypto::AccountId32, pub u128); - impl ::subxt::Event for Winner { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "Winner"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TicketBought( - pub ::subxt::sp_core::crypto::AccountId32, - pub (u8, u8), - ); - impl ::subxt::Event for TicketBought { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "TicketBought"; - } - } - pub mod storage { - use super::runtime_types; - pub struct LotteryIndex; - impl ::subxt::StorageEntry for LotteryIndex { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "LotteryIndex"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Lottery; - impl ::subxt::StorageEntry for Lottery { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "Lottery"; - type Value = runtime_types::pallet_lottery::LotteryConfig; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Participants(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Participants { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "Participants"; - type Value = (u32, Vec<(u8, u8)>); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct TicketsCount; - impl ::subxt::StorageEntry for TicketsCount { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "TicketsCount"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Tickets(pub u32); - impl ::subxt::StorageEntry for Tickets { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "Tickets"; - 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 CallIndices; - impl ::subxt::StorageEntry for CallIndices { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "CallIndices"; - type Value = Vec<(u8, u8)>; - 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 lottery_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = LotteryIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lottery( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_lottery::LotteryConfig, - >, - ::subxt::Error, - > { - let entry = Lottery; - self.client.storage().fetch(&entry, hash).await - } - pub async fn participants( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result<(u32, Vec<(u8, u8)>), ::subxt::Error> - { - let entry = Participants(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn participants_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Participants>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn tickets_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = TicketsCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn tickets( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Tickets(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn tickets_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Tickets>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn call_indices( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = CallIndices; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod gilt { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PlaceBid { - #[codec(compact)] - pub amount: u128, - pub duration: u32, - } - impl ::subxt::Call for PlaceBid { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "place_bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RetractBid { - #[codec(compact)] - pub amount: u128, - pub duration: u32, - } - impl ::subxt::Call for RetractBid { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "retract_bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetTarget { - #[codec(compact)] - pub target: ::subxt::sp_arithmetic::per_things::Perquintill, - } - impl ::subxt::Call for SetTarget { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "set_target"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thaw { - #[codec(compact)] - pub index: u32, - } - impl ::subxt::Call for Thaw { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "thaw"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn place_bid( - &self, - amount: u128, - duration: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = PlaceBid { amount, duration }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn retract_bid( - &self, - amount: u128, - duration: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RetractBid { amount, duration }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_target( - &self, - target: ::subxt::sp_arithmetic::per_things::Perquintill, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetTarget { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw(&self, index: u32) -> ::subxt::SubmittableExtrinsic { - let call = Thaw { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_gilt::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BidPlaced( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub u32, - ); - impl ::subxt::Event for BidPlaced { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "BidPlaced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BidRetracted( - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub u32, - ); - impl ::subxt::Event for BidRetracted { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "BidRetracted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct GiltIssued( - pub u32, - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - ); - impl ::subxt::Event for GiltIssued { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "GiltIssued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct GiltThawed( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub u128, - pub u128, - ); - impl ::subxt::Event for GiltThawed { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "GiltThawed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct QueueTotals; - impl ::subxt::StorageEntry for QueueTotals { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "QueueTotals"; - type Value = Vec<(u32, u128)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Queues(pub u32); - impl ::subxt::StorageEntry for Queues { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "Queues"; - type Value = Vec< - runtime_types::pallet_gilt::pallet::GiltBid< - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ActiveTotal; - impl ::subxt::StorageEntry for ActiveTotal { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "ActiveTotal"; - type Value = runtime_types::pallet_gilt::pallet::ActiveGiltsTotal; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Active(pub u32); - impl ::subxt::StorageEntry for Active { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "Active"; - type Value = runtime_types::pallet_gilt::pallet::ActiveGilt< - u128, - ::subxt::sp_core::crypto::AccountId32, - u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn queue_totals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { - let entry = QueueTotals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queues( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec< - runtime_types::pallet_gilt::pallet::GiltBid< - u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Queues(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queues_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Queues>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn active_total( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_gilt::pallet::ActiveGiltsTotal, - ::subxt::Error, - > { - let entry = ActiveTotal; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn active( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_gilt::pallet::ActiveGilt< - u128, - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ::subxt::Error, - > { - let entry = Active(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn active_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Active>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod uniques { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Create { - #[codec(compact)] - pub class: u32, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreate { - #[codec(compact)] - pub class: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub free_holding: bool, - } - impl ::subxt::Call for ForceCreate { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "force_create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroy { - #[codec(compact)] - pub class: u32, - pub witness: runtime_types::pallet_uniques::types::DestroyWitness, - } - impl ::subxt::Call for Destroy { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "destroy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Mint { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for Mint { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "mint"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burn { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - pub check_owner: Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - } - impl ::subxt::Call for Burn { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "burn"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Redeposit { - #[codec(compact)] - pub class: u32, - pub instances: Vec, - } - impl ::subxt::Call for Redeposit { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "redeposit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Freeze { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "freeze"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thaw { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - } - impl ::subxt::Call for Thaw { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "thaw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct FreezeClass { - #[codec(compact)] - pub class: u32, - } - impl ::subxt::Call for FreezeClass { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "freeze_class"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ThawClass { - #[codec(compact)] - pub class: u32, - } - impl ::subxt::Call for ThawClass { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "thaw_class"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferOwnership { - #[codec(compact)] - pub class: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for TransferOwnership { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "transfer_ownership"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetTeam { - #[codec(compact)] - pub class: u32, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for SetTeam { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_team"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveTransfer { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - } - impl ::subxt::Call for ApproveTransfer { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "approve_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelApproval { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - pub maybe_check_delegate: Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - } - impl ::subxt::Call for CancelApproval { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "cancel_approval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceAssetStatus { - #[codec(compact)] - pub class: u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - pub free_holding: bool, - pub is_frozen: bool, - } - impl ::subxt::Call for ForceAssetStatus { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "force_asset_status"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetAttribute { - #[codec(compact)] - pub class: u32, - pub maybe_instance: Option, - pub key: - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - pub value: - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - } - impl ::subxt::Call for SetAttribute { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_attribute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearAttribute { - #[codec(compact)] - pub class: u32, - pub maybe_instance: Option, - pub key: - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - } - impl ::subxt::Call for ClearAttribute { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "clear_attribute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMetadata { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - pub data: - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - pub is_frozen: bool, - } - impl ::subxt::Call for SetMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearMetadata { - #[codec(compact)] - pub class: u32, - #[codec(compact)] - pub instance: u32, - } - impl ::subxt::Call for ClearMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "clear_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetClassMetadata { - #[codec(compact)] - pub class: u32, - pub data: - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - pub is_frozen: bool, - } - impl ::subxt::Call for SetClassMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_class_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearClassMetadata { - #[codec(compact)] - pub class: u32, - } - impl ::subxt::Call for ClearClassMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "clear_class_metadata"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn create( - &self, - class: u32, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Create { class, admin }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_create( - &self, - class: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - free_holding: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceCreate { - class, - owner, - free_holding, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn destroy( - &self, - class: u32, - witness: runtime_types::pallet_uniques::types::DestroyWitness, - ) -> ::subxt::SubmittableExtrinsic { - let call = Destroy { class, witness }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn mint( - &self, - class: u32, - instance: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Mint { - class, - instance, - owner, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn burn( - &self, - class: u32, - instance: u32, - check_owner: Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Burn { - class, - instance, - check_owner, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer( - &self, - class: u32, - instance: u32, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { - class, - instance, - dest, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn redeposit( - &self, - class: u32, - instances: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Redeposit { class, instances }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze( - &self, - class: u32, - instance: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Freeze { class, instance }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw( - &self, - class: u32, - instance: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Thaw { class, instance }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze_class( - &self, - class: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FreezeClass { class }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw_class( - &self, - class: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ThawClass { class }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_ownership( - &self, - class: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferOwnership { class, owner }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_team( - &self, - class: u32, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetTeam { - class, - issuer, - admin, - freezer, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_transfer( - &self, - class: u32, - instance: u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveTransfer { - class, - instance, - delegate, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_approval( - &self, - class: u32, - instance: u32, - maybe_check_delegate: Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelApproval { - class, - instance, - maybe_check_delegate, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_asset_status( - &self, - class: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - free_holding: bool, - is_frozen: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceAssetStatus { - class, - owner, - issuer, - admin, - freezer, - free_holding, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_attribute( - &self, - class: u32, - maybe_instance: Option, - key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - value: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetAttribute { - class, - maybe_instance, - key, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_attribute( - &self, - class: u32, - maybe_instance: Option, - key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearAttribute { - class, - maybe_instance, - key, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_metadata( - &self, - class: u32, - instance: u32, - data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - is_frozen: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMetadata { - class, - instance, - data, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_metadata( - &self, - class: u32, - instance: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearMetadata { class, instance }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_class_metadata( - &self, - class: u32, - data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - is_frozen: bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetClassMetadata { - class, - data, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_class_metadata( - &self, - class: u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ClearClassMetadata { class }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_uniques::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Created( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Created { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Created"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreated(pub u32, pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for ForceCreated { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ForceCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroyed(pub u32); - impl ::subxt::Event for Destroyed { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Destroyed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Issued( - pub u32, - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Issued { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Issued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transferred( - pub u32, - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Transferred { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Transferred"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burned( - pub u32, - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Burned { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Burned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Frozen(pub u32, pub u32); - impl ::subxt::Event for Frozen { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Frozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thawed(pub u32, pub u32); - impl ::subxt::Event for Thawed { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Thawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassFrozen(pub u32); - impl ::subxt::Event for ClassFrozen { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassFrozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassThawed(pub u32); - impl ::subxt::Event for ClassThawed { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassThawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OwnerChanged(pub u32, pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for OwnerChanged { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "OwnerChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TeamChanged( - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for TeamChanged { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "TeamChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovedTransfer( - pub u32, - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ApprovedTransfer { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ApprovedTransfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovalCancelled( - pub u32, - pub u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ApprovalCancelled { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ApprovalCancelled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetStatusChanged(pub u32); - impl ::subxt::Event for AssetStatusChanged { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "AssetStatusChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassMetadataSet( - pub u32, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, - pub bool, - ); - impl ::subxt::Event for ClassMetadataSet { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassMetadataSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassMetadataCleared(pub u32); - impl ::subxt::Event for ClassMetadataCleared { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassMetadataCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataSet( - pub u32, - pub u32, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, - pub bool, - ); - impl ::subxt::Event for MetadataSet { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataCleared(pub u32, pub u32); - impl ::subxt::Event for MetadataCleared { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "MetadataCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Redeposited(pub u32, pub Vec); - impl ::subxt::Event for Redeposited { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Redeposited"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AttributeSet( - pub u32, - pub Option, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, - ); - impl ::subxt::Event for AttributeSet { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "AttributeSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AttributeCleared( - pub u32, - pub Option, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec, - ); - impl ::subxt::Event for AttributeCleared { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "AttributeCleared"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Class(pub u32); - impl ::subxt::StorageEntry for Class { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Class"; - type Value = runtime_types::pallet_uniques::types::ClassDetails< - ::subxt::sp_core::crypto::AccountId32, - u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct Account(::subxt::sp_core::crypto::AccountId32, u32, u32); - impl ::subxt::StorageEntry for Account { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Account"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.2, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Asset(u32, u32); - impl ::subxt::StorageEntry for Asset { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Asset"; - type Value = runtime_types::pallet_uniques::types::InstanceDetails< - ::subxt::sp_core::crypto::AccountId32, - u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct ClassMetadataOf(pub u32); - impl ::subxt::StorageEntry for ClassMetadataOf { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "ClassMetadataOf"; - type Value = runtime_types::pallet_uniques::types::ClassMetadata; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct InstanceMetadataOf(u32, u32); - impl ::subxt::StorageEntry for InstanceMetadataOf { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "InstanceMetadataOf"; - type Value = runtime_types::pallet_uniques::types::InstanceMetadata; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Attribute( - u32, - Option, - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - ); - impl ::subxt::StorageEntry for Attribute { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Attribute"; - type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec, - u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.2, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn class( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::ClassDetails< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Class(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn class_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Class>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn account( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: u32, - _2: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> - { - let entry = Account(_0, _1, _2); - self.client.storage().fetch(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn asset( - &self, - _0: u32, - _1: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::InstanceDetails< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - >, - ::subxt::Error, - > { - let entry = Asset(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn asset_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn class_metadata_of( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::ClassMetadata, - >, - ::subxt::Error, - > { - let entry = ClassMetadataOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn class_metadata_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ClassMetadataOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn instance_metadata_of( - &self, - _0: u32, - _1: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::InstanceMetadata, - >, - ::subxt::Error, - > { - let entry = InstanceMetadataOf(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn instance_metadata_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, InstanceMetadataOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn attribute( - &self, - _0: u32, - _1: Option, - _2: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - u128, - )>, - ::subxt::Error, - > { - let entry = Attribute(_0, _1, _2); - self.client.storage().fetch(&entry, hash).await - } - pub async fn attribute_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Attribute>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod transaction_storage { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Store { - pub data: Vec, - } - impl ::subxt::Call for Store { - const PALLET: &'static str = "TransactionStorage"; - const FUNCTION: &'static str = "store"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Renew { - pub block: u32, - pub index: u32, - } - impl ::subxt::Call for Renew { - const PALLET: &'static str = "TransactionStorage"; - const FUNCTION: &'static str = "renew"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CheckProof { - pub proof: - runtime_types::sp_transaction_storage_proof::TransactionStorageProof, - } - impl ::subxt::Call for CheckProof { - const PALLET: &'static str = "TransactionStorage"; - const FUNCTION: &'static str = "check_proof"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn store( - &self, - data: Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Store { data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn renew( - &self, - block: u32, - index: u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Renew { block, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn check_proof( - &self, - proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof, - ) -> ::subxt::SubmittableExtrinsic { - let call = CheckProof { proof }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_transaction_storage::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Stored(pub u32); - impl ::subxt::Event for Stored { - const PALLET: &'static str = "TransactionStorage"; - const EVENT: &'static str = "Stored"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Renewed(pub u32); - impl ::subxt::Event for Renewed { - const PALLET: &'static str = "TransactionStorage"; - const EVENT: &'static str = "Renewed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProofChecked {} - impl ::subxt::Event for ProofChecked { - const PALLET: &'static str = "TransactionStorage"; - const EVENT: &'static str = "ProofChecked"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Transactions(pub u32); - impl ::subxt::StorageEntry for Transactions { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "Transactions"; - type Value = - Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ChunkCount(pub u32); - impl ::subxt::StorageEntry for ChunkCount { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "ChunkCount"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ByteFee; - impl ::subxt::StorageEntry for ByteFee { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "ByteFee"; - type Value = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EntryFee; - impl ::subxt::StorageEntry for EntryFee { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "EntryFee"; - type Value = u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxTransactionSize; - impl ::subxt::StorageEntry for MaxTransactionSize { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "MaxTransactionSize"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxBlockTransactions; - impl ::subxt::StorageEntry for MaxBlockTransactions { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "MaxBlockTransactions"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StoragePeriod; - impl ::subxt::StorageEntry for StoragePeriod { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "StoragePeriod"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockTransactions; - impl ::subxt::StorageEntry for BlockTransactions { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "BlockTransactions"; - type Value = - Vec; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProofChecked; - impl ::subxt::StorageEntry for ProofChecked { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "ProofChecked"; - type Value = bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn transactions( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - Vec, - >, - ::subxt::Error, - > { - let entry = Transactions(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn transactions_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Transactions>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn chunk_count( - &self, - _0: u32, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ChunkCount(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn chunk_count_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ChunkCount>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn byte_fee( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = ByteFee; - self.client.storage().fetch(&entry, hash).await - } - pub async fn entry_fee( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option, ::subxt::Error> - { - let entry = EntryFee; - self.client.storage().fetch(&entry, hash).await - } - pub async fn max_transaction_size( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = MaxTransactionSize; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn max_block_transactions( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = MaxBlockTransactions; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn storage_period( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = StoragePeriod; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn block_transactions( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - Vec, - ::subxt::Error, - > { - let entry = BlockTransactions; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proof_checked( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = ProofChecked; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod bags_list { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn rebag( - &self, - dislocated: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Rebag { dislocated }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_bags_list::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Rebagged( - pub ::subxt::sp_core::crypto::AccountId32, - pub u64, - pub 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 CounterForListNodes; - impl ::subxt::StorageEntry for CounterForListNodes { - const PALLET: &'static str = "BagsList"; - const STORAGE: &'static str = "CounterForListNodes"; - type Value = u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ListNodes(pub ::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 ListBags(pub 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 } - } - pub async fn counter_for_list_nodes( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result { - let entry = CounterForListNodes; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn list_nodes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ListNodes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn list_nodes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ListNodes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn list_bags( - &self, - _0: u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ListBags(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn list_bags_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ListBags>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod runtime_types { - use super::runtime_types; - pub mod finality_grandpa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Equivocation<_0, _1, _2> { - pub round_number: u64, - pub identity: _0, - pub first: (_1, _2), - pub second: (_1, _2), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Precommit<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Prevote<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - } - pub mod frame_support { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub mod bounded_btree_map { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct BoundedBTreeMap<_0, _1>( - pub std::collections::BTreeMap<_0, _1>, - ); - } - pub mod bounded_vec { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct BoundedVec<_0>(pub Vec<_0>); - } - pub mod weak_bounded_vec { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct WeakBoundedVec<_0>(pub Vec<_0>); - } - } - pub mod traits { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct WrapperKeepOpaque<_0>(u32, pub _0); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct WrapperOpaque<_0>(u32, pub _0); - } - pub mod tokens { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum BalanceStatus { - Free, - Reserved, - } - } - } - } - pub mod weights { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum DispatchClass { - Normal, - Operational, - Mandatory, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DispatchInfo { - pub weight: 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)] - pub enum Pays { - Yes, - No, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PerDispatchClass<_0> { - pub normal: _0, - pub operational: _0, - pub mandatory: _0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RuntimeDbWeight { - pub read: u64, - pub write: u64, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct WeightToFeeCoefficient<_0> { - pub coeff_integer: _0, - pub coeff_frac: ::subxt::sp_arithmetic::per_things::Perbill, - pub negative: bool, - pub degree: u8, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PalletId(pub [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, - )] - pub struct CheckGenesis {} - } - pub mod check_mortality { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckMortality( - pub runtime_types::sp_runtime::generic::era::Era, - ); - } - pub mod check_nonce { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckNonce(pub u32); - } - pub mod check_spec_version { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckSpecVersion {} - } - pub mod check_tx_version { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckTxVersion {} - } - pub mod check_weight { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckWeight {} - } - } - pub mod limits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BlockLength { - pub max: runtime_types::frame_support::weights::PerDispatchClass, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BlockWeights { - pub base_block: u64, - pub max_block: u64, - pub per_class: - runtime_types::frame_support::weights::PerDispatchClass< - runtime_types::frame_system::limits::WeightsPerClass, - >, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct WeightsPerClass { - pub base_extrinsic: u64, - pub max_extrinsic: Option, - pub max_total: Option, - pub reserved: Option, - } - } - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : Vec < u8 > , } , set_heap_pages { pages : u64 , } , set_code { code : Vec < u8 > , } , set_code_without_checks { code : Vec < u8 > , } , set_changes_trie_config { changes_trie_config : Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : Vec < (Vec < u8 > , Vec < u8 > ,) > , } , kill_storage { keys : Vec < Vec < u8 > > , } , kill_prefix { prefix : Vec < u8 > , subkeys : u32 , } , remark_with_event { remark : Vec < u8 > , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidSpecName, - SpecVersionNeedsToIncrease, - FailedToExtractRuntimeVersion, - NonDefaultComposite, - NonZeroRefCount, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), - ExtrinsicFailed( - runtime_types::sp_runtime::DispatchError, - runtime_types::frame_support::weights::DispatchInfo, - ), - CodeUpdated, - NewAccount(::subxt::sp_core::crypto::AccountId32), - KilledAccount(::subxt::sp_core::crypto::AccountId32), - Remarked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct EventRecord<_0, _1> { - pub phase: runtime_types::frame_system::Phase, - pub event: _0, - pub topics: Vec<_1>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct LastRuntimeUpgradeInfo { - #[codec(compact)] - pub spec_version: u32, - pub spec_name: String, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Phase { - ApplyExtrinsic(u32), - Finalization, - Initialization, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RawOrigin<_0> { - Root, - Signed(_0), - None, - } - } - pub mod node_runtime { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - System(runtime_types::frame_system::pallet::Call), - Utility(runtime_types::pallet_utility::pallet::Call), - Babe(runtime_types::pallet_babe::pallet::Call), - Timestamp(runtime_types::pallet_timestamp::pallet::Call), - Authorship(runtime_types::pallet_authorship::pallet::Call), - Indices(runtime_types::pallet_indices::pallet::Call), - Balances(runtime_types::pallet_balances::pallet::Call), - ElectionProviderMultiPhase( - runtime_types::pallet_election_provider_multi_phase::pallet::Call, - ), - Staking(runtime_types::pallet_staking::pallet::pallet::Call), - Session(runtime_types::pallet_session::pallet::Call), - Democracy(runtime_types::pallet_democracy::pallet::Call), - Council(runtime_types::pallet_collective::pallet::Call), - TechnicalCommittee(runtime_types::pallet_collective::pallet::Call), - Elections(runtime_types::pallet_elections_phragmen::pallet::Call), - TechnicalMembership(runtime_types::pallet_membership::pallet::Call), - Grandpa(runtime_types::pallet_grandpa::pallet::Call), - Treasury(runtime_types::pallet_treasury::pallet::Call), - Contracts(runtime_types::pallet_contracts::pallet::Call), - Sudo(runtime_types::pallet_sudo::pallet::Call), - ImOnline(runtime_types::pallet_im_online::pallet::Call), - Identity(runtime_types::pallet_identity::pallet::Call), - Society(runtime_types::pallet_society::pallet::Call), - Recovery(runtime_types::pallet_recovery::pallet::Call), - Vesting(runtime_types::pallet_vesting::pallet::Call), - Scheduler(runtime_types::pallet_scheduler::pallet::Call), - Proxy(runtime_types::pallet_proxy::pallet::Call), - Multisig(runtime_types::pallet_multisig::pallet::Call), - Bounties(runtime_types::pallet_bounties::pallet::Call), - Tips(runtime_types::pallet_tips::pallet::Call), - Assets(runtime_types::pallet_assets::pallet::Call), - Lottery(runtime_types::pallet_lottery::pallet::Call), - Gilt(runtime_types::pallet_gilt::pallet::Call), - Uniques(runtime_types::pallet_uniques::pallet::Call), - TransactionStorage( - runtime_types::pallet_transaction_storage::pallet::Call, - ), - BagsList(runtime_types::pallet_bags_list::pallet::Call), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - System(runtime_types::frame_system::pallet::Event), - Utility(runtime_types::pallet_utility::pallet::Event), - Indices(runtime_types::pallet_indices::pallet::Event), - Balances(runtime_types::pallet_balances::pallet::Event), - ElectionProviderMultiPhase( - runtime_types::pallet_election_provider_multi_phase::pallet::Event, - ), - Staking(runtime_types::pallet_staking::pallet::pallet::Event), - Session(runtime_types::pallet_session::pallet::Event), - Democracy(runtime_types::pallet_democracy::pallet::Event), - Council(runtime_types::pallet_collective::pallet::Event), - TechnicalCommittee(runtime_types::pallet_collective::pallet::Event), - Elections(runtime_types::pallet_elections_phragmen::pallet::Event), - TechnicalMembership(runtime_types::pallet_membership::pallet::Event), - Grandpa(runtime_types::pallet_grandpa::pallet::Event), - Treasury(runtime_types::pallet_treasury::pallet::Event), - Contracts(runtime_types::pallet_contracts::pallet::Event), - Sudo(runtime_types::pallet_sudo::pallet::Event), - ImOnline(runtime_types::pallet_im_online::pallet::Event), - Offences(runtime_types::pallet_offences::pallet::Event), - Identity(runtime_types::pallet_identity::pallet::Event), - Society(runtime_types::pallet_society::pallet::Event), - Recovery(runtime_types::pallet_recovery::pallet::Event), - Vesting(runtime_types::pallet_vesting::pallet::Event), - Scheduler(runtime_types::pallet_scheduler::pallet::Event), - Proxy(runtime_types::pallet_proxy::pallet::Event), - Multisig(runtime_types::pallet_multisig::pallet::Event), - Bounties(runtime_types::pallet_bounties::pallet::Event), - Tips(runtime_types::pallet_tips::pallet::Event), - Assets(runtime_types::pallet_assets::pallet::Event), - Lottery(runtime_types::pallet_lottery::pallet::Event), - Gilt(runtime_types::pallet_gilt::pallet::Event), - Uniques(runtime_types::pallet_uniques::pallet::Event), - TransactionStorage( - runtime_types::pallet_transaction_storage::pallet::Event, - ), - BagsList(runtime_types::pallet_bags_list::pallet::Event), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NposSolution16 { - votes1: Vec<(u32, u16)>, - votes2: Vec<( - u32, - (u16, runtime_types::sp_arithmetic::per_things::PerU16), - u16, - )>, - votes3: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 2usize], - u16, - )>, - votes4: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 3usize], - u16, - )>, - votes5: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 4usize], - u16, - )>, - votes6: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 5usize], - u16, - )>, - votes7: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 6usize], - u16, - )>, - votes8: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 7usize], - u16, - )>, - votes9: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 8usize], - u16, - )>, - votes10: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 9usize], - u16, - )>, - votes11: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 10usize], - u16, - )>, - votes12: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 11usize], - u16, - )>, - votes13: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 12usize], - u16, - )>, - votes14: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 13usize], - u16, - )>, - votes15: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 14usize], - u16, - )>, - votes16: Vec<( - u32, - [(u16, runtime_types::sp_arithmetic::per_things::PerU16); 15usize], - u16, - )>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum OriginCaller { - system( - runtime_types::frame_system::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - Council( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - TechnicalCommittee( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - Void(runtime_types::sp_core::Void), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum ProxyType { - Any, - NonTransfer, - Governance, - Staking, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Runtime {} - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 authority_discovery: - runtime_types::sp_authority_discovery::app::Public, - } - } - pub mod pallet_assets { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - create { - #[codec(compact)] - id: u32, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - min_balance: u64, - }, - force_create { - #[codec(compact)] - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - is_sufficient: bool, - #[codec(compact)] - min_balance: u64, - }, - destroy { - #[codec(compact)] - id: u32, - witness: runtime_types::pallet_assets::types::DestroyWitness, - }, - mint { - #[codec(compact)] - id: u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - burn { - #[codec(compact)] - id: u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - transfer { - #[codec(compact)] - id: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - transfer_keep_alive { - #[codec(compact)] - id: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - force_transfer { - #[codec(compact)] - id: u32, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - freeze { - #[codec(compact)] - id: u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - thaw { - #[codec(compact)] - id: u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - freeze_asset { - #[codec(compact)] - id: u32, - }, - thaw_asset { - #[codec(compact)] - id: u32, - }, - transfer_ownership { - #[codec(compact)] - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - set_team { - #[codec(compact)] - id: u32, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - set_metadata { - #[codec(compact)] - id: u32, - name: Vec, - symbol: Vec, - decimals: u8, - }, - clear_metadata { - #[codec(compact)] - id: u32, - }, - force_set_metadata { - #[codec(compact)] - id: u32, - name: Vec, - symbol: Vec, - decimals: u8, - is_frozen: bool, - }, - force_clear_metadata { - #[codec(compact)] - id: u32, - }, - force_asset_status { - #[codec(compact)] - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - min_balance: u64, - is_sufficient: bool, - is_frozen: bool, - }, - approve_transfer { - #[codec(compact)] - id: u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - cancel_approval { - #[codec(compact)] - id: u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - force_cancel_approval { - #[codec(compact)] - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - transfer_approved { - #[codec(compact)] - id: u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - destination: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - amount: u64, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - BalanceLow, - BalanceZero, - NoPermission, - Unknown, - Frozen, - InUse, - BadWitness, - MinBalanceZero, - NoProvider, - BadMetadata, - Unapproved, - WouldDie, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Created( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - Issued(u32, ::subxt::sp_core::crypto::AccountId32, u64), - Transferred( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u64, - ), - Burned(u32, ::subxt::sp_core::crypto::AccountId32, u64), - TeamChanged( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - OwnerChanged(u32, ::subxt::sp_core::crypto::AccountId32), - Frozen(u32, ::subxt::sp_core::crypto::AccountId32), - Thawed(u32, ::subxt::sp_core::crypto::AccountId32), - AssetFrozen(u32), - AssetThawed(u32), - Destroyed(u32), - ForceCreated(u32, ::subxt::sp_core::crypto::AccountId32), - MetadataSet(u32, Vec, Vec, u8, bool), - MetadataCleared(u32), - ApprovedTransfer( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u64, - ), - ApprovalCancelled( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - TransferredApproved( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u64, - ), - AssetStatusChanged(u32), - } - } - pub mod types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Approval<_0, _1> { - pub amount: _0, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetBalance<_0, _1> { - pub balance: _0, - pub is_frozen: bool, - pub sufficient: bool, - pub extra: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetDetails<_0, _1, _2> { - pub owner: _1, - pub issuer: _1, - pub admin: _1, - pub freezer: _1, - pub supply: _0, - pub deposit: _2, - pub min_balance: _0, - pub is_sufficient: bool, - pub accounts: u32, - pub sufficients: u32, - pub approvals: u32, - pub is_frozen: bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetMetadata<_0, _1> { - pub deposit: _0, - pub name: _1, - pub symbol: _1, - pub decimals: u8, - pub is_frozen: bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DestroyWitness { - #[codec(compact)] - pub accounts: u32, - #[codec(compact)] - pub sufficients: u32, - #[codec(compact)] - pub approvals: u32, - } - } - } - pub mod pallet_authorship { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - set_uncles { - new_uncles: Vec< - runtime_types::sp_runtime::generic::header::Header< - u32, - runtime_types::sp_runtime::traits::BlakeTwo256, - >, - >, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidUncleParent, - UnclesAlreadySet, - TooManyUncles, - GenesisUncle, - TooHighUncle, - UncleAlreadyIncluded, - OldUncle, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum UncleEntryItem<_0, _1, _2> { - InclusionHeight(_0), - Uncle(_1, Option<_2>), - } - } - pub mod pallet_babe { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - report_equivocation { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , report_equivocation_unsigned { equivocation_proof : std :: boxed :: Box < runtime_types :: sp_consensus_slots :: EquivocationProof < runtime_types :: sp_runtime :: generic :: header :: Header < u32 , runtime_types :: sp_runtime :: traits :: BlakeTwo256 > , runtime_types :: sp_consensus_babe :: app :: Public > > , key_owner_proof : runtime_types :: sp_session :: MembershipProof , } , plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidEquivocationProof, - InvalidKeyOwnershipProof, - DuplicateOffenceReport, - } - } - } - pub mod pallet_bags_list { - use super::runtime_types; - pub mod list { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bag { - pub head: Option<::subxt::sp_core::crypto::AccountId32>, - pub tail: Option<::subxt::sp_core::crypto::AccountId32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Node { - pub id: ::subxt::sp_core::crypto::AccountId32, - pub prev: Option<::subxt::sp_core::crypto::AccountId32>, - pub next: Option<::subxt::sp_core::crypto::AccountId32>, - pub bag_upper: u64, - } - } - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - rebag { - dislocated: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Rebagged(::subxt::sp_core::crypto::AccountId32, u64, u64), - } - } - } - pub mod pallet_balances { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - transfer { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - value: u128, - }, - set_balance { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - new_free: u128, - #[codec(compact)] - new_reserved: u128, - }, - force_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - value: u128, - }, - transfer_keep_alive { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - value: u128, - }, - transfer_all { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - keep_alive: bool, - }, - force_unreserve { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - amount: u128, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - VestingBalance, - LiquidityRestrictions, - InsufficientBalance, - ExistentialDeposit, - KeepAlive, - ExistingVestingSchedule, - DeadAccount, - TooManyReserves, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Endowed(::subxt::sp_core::crypto::AccountId32, u128), - DustLost(::subxt::sp_core::crypto::AccountId32, u128), - Transfer( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - BalanceSet(::subxt::sp_core::crypto::AccountId32, u128, u128), - Reserved(::subxt::sp_core::crypto::AccountId32, u128), - Unreserved(::subxt::sp_core::crypto::AccountId32, u128), - ReserveRepatriated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, - ), - Deposit(::subxt::sp_core::crypto::AccountId32, u128), - Withdraw(::subxt::sp_core::crypto::AccountId32, u128), - Slashed(::subxt::sp_core::crypto::AccountId32, u128), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct BalanceLock<_0> { - pub id: [u8; 8usize], - pub amount: _0, - pub reasons: runtime_types::pallet_balances::Reasons, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Reasons { - Fee, - Misc, - All, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1_0_0, - V2_0_0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Call { - propose_bounty { - #[codec(compact)] - value: u128, - description: Vec, - }, - approve_bounty { - #[codec(compact)] - bounty_id: u32, - }, - propose_curator { - #[codec(compact)] - bounty_id: u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - fee: u128, - }, - unassign_curator { - #[codec(compact)] - bounty_id: u32, - }, - accept_curator { - #[codec(compact)] - bounty_id: u32, - }, - award_bounty { - #[codec(compact)] - bounty_id: u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - claim_bounty { - #[codec(compact)] - bounty_id: u32, - }, - close_bounty { - #[codec(compact)] - bounty_id: u32, - }, - extend_bounty_expiry { - #[codec(compact)] - bounty_id: u32, - remark: Vec, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InsufficientProposersBalance, - InvalidIndex, - ReasonTooBig, - UnexpectedStatus, - RequireCurator, - InvalidValue, - InvalidFee, - PendingPayout, - Premature, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - BountyProposed(u32), - BountyRejected(u32, u128), - BountyBecameActive(u32), - BountyAwarded(u32, ::subxt::sp_core::crypto::AccountId32), - BountyClaimed(u32, u128, ::subxt::sp_core::crypto::AccountId32), - BountyCanceled(u32), - BountyExtended(u32), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum BountyStatus<_0, _1> { - Proposed, - Approved, - Funded, - CuratorProposed { - curator: _0, - }, - Active { - curator: _0, - update_due: _1, - }, - 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)] - pub enum Call { - set_members { - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, - prime: Option<::subxt::sp_core::crypto::AccountId32>, - old_count: u32, - }, - execute { - proposal: std::boxed::Box, - #[codec(compact)] - length_bound: u32, - }, - propose { - #[codec(compact)] - threshold: u32, - proposal: std::boxed::Box, - #[codec(compact)] - length_bound: u32, - }, - vote { - proposal: ::subxt::sp_core::H256, - #[codec(compact)] - index: u32, - approve: bool, - }, - close { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - index: u32, - #[codec(compact)] - proposal_weight_bound: u64, - #[codec(compact)] - length_bound: u32, - }, - disapprove_proposal { - proposal_hash: ::subxt::sp_core::H256, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotMember, - DuplicateProposal, - ProposalMissing, - WrongIndex, - DuplicateVote, - AlreadyInitialized, - TooEarly, - TooManyProposals, - WrongProposalWeight, - WrongProposalLength, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Proposed( - ::subxt::sp_core::crypto::AccountId32, - u32, - ::subxt::sp_core::H256, - u32, - ), - Voted( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - bool, - u32, - u32, - ), - Approved(::subxt::sp_core::H256), - Disapproved(::subxt::sp_core::H256), - Executed( - ::subxt::sp_core::H256, - Result<(), runtime_types::sp_runtime::DispatchError>, - ), - MemberExecuted( - ::subxt::sp_core::H256, - Result<(), runtime_types::sp_runtime::DispatchError>, - ), - Closed(::subxt::sp_core::H256, u32, u32), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RawOrigin<_0> { - Members(u32, u32), - Member(_0), - _Phantom, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Votes<_0, _1> { - pub index: _1, - pub threshold: _1, - pub ayes: Vec<_0>, - pub nays: Vec<_0>, - pub end: _1, - } - } - pub mod pallet_contracts { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - call { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - value: u128, - #[codec(compact)] - gas_limit: u64, - data: Vec, - }, - instantiate_with_code { - #[codec(compact)] - endowment: u128, - #[codec(compact)] - gas_limit: u64, - code: Vec, - data: Vec, - salt: Vec, - }, - instantiate { - #[codec(compact)] - endowment: u128, - #[codec(compact)] - gas_limit: u64, - code_hash: ::subxt::sp_core::H256, - data: Vec, - salt: Vec, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidScheduleVersion, - OutOfGas, - OutputBufferTooSmall, - BelowSubsistenceThreshold, - NewContractNotFunded, - TransferFailed, - MaxCallDepthReached, - ContractNotFound, - CodeTooLarge, - CodeNotFound, - OutOfBounds, - DecodingFailed, - ContractTrapped, - ValueTooLarge, - TerminatedWhileReentrant, - InputForwarded, - RandomSubjectTooLong, - TooManyTopics, - DuplicateTopics, - NoChainExtension, - DeletionQueueFull, - StorageExhausted, - DuplicateContract, - TerminatedInConstructor, - DebugMessageInvalidUTF8, - ReentranceDenied, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Instantiated { - deployer: ::subxt::sp_core::crypto::AccountId32, - contract: ::subxt::sp_core::crypto::AccountId32, - }, - Terminated { - contract: ::subxt::sp_core::crypto::AccountId32, - beneficiary: ::subxt::sp_core::crypto::AccountId32, - }, - CodeStored { - code_hash: ::subxt::sp_core::H256, - }, - ScheduleUpdated { - version: u32, - }, - ContractEmitted { - contract: ::subxt::sp_core::crypto::AccountId32, - data: Vec, - }, - CodeRemoved { - code_hash: ::subxt::sp_core::H256, - }, - } - } - pub mod schedule { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct HostFnWeights { - pub caller: u64, - pub address: u64, - pub gas_left: u64, - pub balance: u64, - pub value_transferred: u64, - pub minimum_balance: u64, - pub contract_deposit: u64, - pub block_number: u64, - pub now: u64, - pub weight_to_fee: u64, - pub gas: u64, - pub input: u64, - pub input_per_byte: u64, - pub r#return: u64, - pub return_per_byte: u64, - pub terminate: u64, - pub random: u64, - pub deposit_event: u64, - pub deposit_event_per_topic: u64, - pub deposit_event_per_byte: u64, - pub debug_message: u64, - pub set_storage: u64, - pub set_storage_per_byte: u64, - pub clear_storage: u64, - pub get_storage: u64, - pub get_storage_per_byte: u64, - pub transfer: u64, - pub call: u64, - pub call_transfer_surcharge: u64, - pub call_per_input_byte: u64, - pub call_per_output_byte: u64, - pub instantiate: u64, - pub instantiate_per_input_byte: u64, - pub instantiate_per_output_byte: u64, - pub instantiate_per_salt_byte: u64, - pub hash_sha2_256: u64, - pub hash_sha2_256_per_byte: u64, - pub hash_keccak_256: u64, - pub hash_keccak_256_per_byte: u64, - pub hash_blake2_256: u64, - pub hash_blake2_256_per_byte: u64, - pub hash_blake2_128: u64, - pub hash_blake2_128_per_byte: u64, - pub ecdsa_recover: u64, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstructionWeights { - pub version: u32, - pub i64const: u32, - pub i64load: u32, - pub i64store: u32, - pub select: u32, - pub r#if: u32, - pub br: u32, - pub br_if: u32, - pub br_table: u32, - pub br_table_per_entry: u32, - pub call: u32, - pub call_indirect: u32, - pub call_indirect_per_param: u32, - pub local_get: u32, - pub local_set: u32, - pub local_tee: u32, - pub global_get: u32, - pub global_set: u32, - pub memory_current: u32, - pub memory_grow: u32, - pub i64clz: u32, - pub i64ctz: u32, - pub i64popcnt: u32, - pub i64eqz: u32, - pub i64extendsi32: u32, - pub i64extendui32: u32, - pub i32wrapi64: u32, - pub i64eq: u32, - pub i64ne: u32, - pub i64lts: u32, - pub i64ltu: u32, - pub i64gts: u32, - pub i64gtu: u32, - pub i64les: u32, - pub i64leu: u32, - pub i64ges: u32, - pub i64geu: u32, - pub i64add: u32, - pub i64sub: u32, - pub i64mul: u32, - pub i64divs: u32, - pub i64divu: u32, - pub i64rems: u32, - pub i64remu: u32, - pub i64and: u32, - pub i64or: u32, - pub i64xor: u32, - pub i64shl: u32, - pub i64shrs: u32, - pub i64shru: u32, - pub i64rotl: u32, - pub i64rotr: u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Limits { - pub event_topics: u32, - pub stack_height: u32, - pub globals: u32, - pub parameters: u32, - pub memory_pages: u32, - pub table_size: u32, - pub br_table_size: u32, - pub subject_len: u32, - pub call_depth: u32, - pub payload_len: u32, - pub code_len: u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Schedule { - pub limits: runtime_types::pallet_contracts::schedule::Limits, - pub instruction_weights: - runtime_types::pallet_contracts::schedule::InstructionWeights, - pub host_fn_weights: - runtime_types::pallet_contracts::schedule::HostFnWeights, - } - } - pub mod storage { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DeletedContract { - pub trie_id: Vec, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RawContractInfo<_0> { - pub trie_id: Vec, - pub code_hash: _0, - pub _reserved: Option<()>, - } - } - pub mod wasm { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PrefabWasmModule { - #[codec(compact)] - pub instruction_weights_version: u32, - #[codec(compact)] - pub initial: u32, - #[codec(compact)] - pub maximum: u32, - #[codec(compact)] - pub refcount: u64, - pub _reserved: Option<()>, - pub code: Vec, - pub original_code_len: u32, - } - } - } - pub mod pallet_democracy { - use super::runtime_types; - pub mod conviction { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Conviction { - None, - Locked1x, - Locked2x, - Locked3x, - Locked4x, - Locked5x, - Locked6x, - } - } - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - propose { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - value: u128, - }, - second { - #[codec(compact)] - proposal: u32, - #[codec(compact)] - seconds_upper_bound: u32, - }, - vote { - #[codec(compact)] - ref_index: u32, - vote: runtime_types::pallet_democracy::vote::AccountVote, - }, - emergency_cancel { - ref_index: u32, - }, - external_propose { - proposal_hash: ::subxt::sp_core::H256, - }, - external_propose_majority { - proposal_hash: ::subxt::sp_core::H256, - }, - external_propose_default { - proposal_hash: ::subxt::sp_core::H256, - }, - fast_track { - proposal_hash: ::subxt::sp_core::H256, - voting_period: u32, - delay: u32, - }, - veto_external { - proposal_hash: ::subxt::sp_core::H256, - }, - cancel_referendum { - #[codec(compact)] - ref_index: u32, - }, - cancel_queued { - which: u32, - }, - delegate { - to: ::subxt::sp_core::crypto::AccountId32, - conviction: - runtime_types::pallet_democracy::conviction::Conviction, - balance: u128, - }, - undelegate, - clear_public_proposals, - note_preimage { - encoded_proposal: Vec, - }, - note_preimage_operational { - encoded_proposal: Vec, - }, - note_imminent_preimage { - encoded_proposal: Vec, - }, - note_imminent_preimage_operational { - encoded_proposal: Vec, - }, - reap_preimage { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - proposal_len_upper_bound: u32, - }, - unlock { - target: ::subxt::sp_core::crypto::AccountId32, - }, - remove_vote { - index: u32, - }, - remove_other_vote { - target: ::subxt::sp_core::crypto::AccountId32, - index: u32, - }, - enact_proposal { - proposal_hash: ::subxt::sp_core::H256, - index: u32, - }, - blacklist { - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: Option, - }, - cancel_proposal { - #[codec(compact)] - prop_index: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - ValueLow, - ProposalMissing, - AlreadyCanceled, - DuplicateProposal, - ProposalBlacklisted, - NotSimpleMajority, - InvalidHash, - NoProposal, - AlreadyVetoed, - DuplicatePreimage, - NotImminent, - TooEarly, - Imminent, - PreimageMissing, - ReferendumInvalid, - PreimageInvalid, - NoneWaiting, - NotVoter, - NoPermission, - AlreadyDelegating, - InsufficientFunds, - NotDelegating, - VotesExist, - InstantNotAllowed, - Nonsense, - WrongUpperBound, - MaxVotesReached, - TooManyProposals, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Proposed(u32, u128), - Tabled(u32, u128, Vec<::subxt::sp_core::crypto::AccountId32>), - ExternalTabled, - Started( - u32, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - ), - Passed(u32), - NotPassed(u32), - Cancelled(u32), - Executed(u32, Result<(), runtime_types::sp_runtime::DispatchError>), - Delegated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - Undelegated(::subxt::sp_core::crypto::AccountId32), - Vetoed( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - u32, - ), - PreimageNoted( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - PreimageUsed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - PreimageInvalid(::subxt::sp_core::H256, u32), - PreimageMissing(::subxt::sp_core::H256, u32), - PreimageReaped( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ::subxt::sp_core::crypto::AccountId32, - ), - Blacklisted(::subxt::sp_core::H256), - } - } - pub mod types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Delegations<_0> { - pub votes: _0, - pub capital: _0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum ReferendumInfo<_0, _1, _2> { - Ongoing( - runtime_types::pallet_democracy::types::ReferendumStatus< - _0, - _1, - _2, - >, - ), - Finished { - approved: bool, - end: _0, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum AccountVote<_0> { - Standard { - vote: runtime_types::pallet_democracy::vote::Vote, - balance: _0, - }, - Split { - aye: _0, - nay: _0, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PriorLock<_0, _1>(pub _0, pub _1); - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Vote(u8); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Voting<_0, _1, _2> { - Direct { - votes: 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>, - }, - 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)] - pub enum VoteThreshold { - SuperMajorityApprove, - SuperMajorityAgainst, - SimpleMajority, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum PreimageStatus<_0, _1, _2> { - Missing(_2), - Available { - data: Vec, - provider: _0, - deposit: _1, - since: _2, - expiry: Option<_2>, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - 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)] - pub enum Call { - submit_unsigned { raw_solution : std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , set_minimum_untrusted_score { maybe_next_score : Option < [u128 ; 3usize] > , } , set_emergency_election_result { supports : Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , num_signed_submissions : u32 , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - PreDispatchEarlySubmission, - PreDispatchWrongWinnerCount, - PreDispatchWeakSubmission, - SignedQueueFull, - SignedCannotPayDeposit, - SignedInvalidWitness, - SignedTooMuchWeight, - OcwCallWrongEra, - MissingSnapshotMetadata, - InvalidSubmissionIndex, - CallNotAllowed, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , bool ,) , ElectionFinalized (Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , u128 ,) , SignedPhaseStarted (u32 ,) , UnsignedPhaseStarted (u32 ,) , } - } - pub mod signed { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum ElectionCompute { - OnChain, - Signed, - Unsigned, - Fallback, - Emergency, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Phase<_0> { - Off, - Signed, - Unsigned((bool, _0)), - Emergency, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RawSolution<_0> { - pub solution: _0, - pub score: [u128; 3usize], - pub round: u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReadySolution<_0> { - pub supports: Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, - pub score: [u128; 3usize], - pub compute: - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RoundSnapshot<_0> { - pub voters: Vec<(_0, u64, Vec<_0>)>, - pub targets: Vec<_0>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SolutionOrSnapshotSize { - #[codec(compact)] - pub voters: u32, - #[codec(compact)] - pub targets: u32, - } - } - pub mod pallet_elections_phragmen { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - vote { - votes: Vec<::subxt::sp_core::crypto::AccountId32>, - #[codec(compact)] - value: u128, - }, - remove_voter, - submit_candidacy { - #[codec(compact)] - candidate_count: u32, - }, - renounce_candidacy { - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - }, - remove_member { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - has_replacement: bool, - }, - clean_defunct_voters { - num_voters: u32, - num_defunct: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - UnableToVote, - NoVotes, - TooManyVotes, - MaximumVotesExceeded, - LowBalance, - UnableToPayBond, - MustBeVoter, - ReportSelf, - DuplicatedCandidate, - MemberSubmit, - RunnerUpSubmit, - InsufficientCandidateFunds, - NotMember, - InvalidWitnessData, - InvalidVoteCount, - InvalidRenouncing, - InvalidReplacement, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewTerm(Vec<(::subxt::sp_core::crypto::AccountId32, u128)>), - EmptyTerm, - ElectionError, - MemberKicked(::subxt::sp_core::crypto::AccountId32), - Renounced(::subxt::sp_core::crypto::AccountId32), - CandidateSlashed(::subxt::sp_core::crypto::AccountId32, u128), - SeatHolderSlashed(::subxt::sp_core::crypto::AccountId32, u128), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Renouncing { - Member, - RunnerUp, - Candidate(u32), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SeatHolder<_0, _1> { - pub who: _0, - pub stake: _1, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Voter<_0, _1> { - pub votes: Vec<_0>, - pub stake: _1, - pub deposit: _1, - } - } - pub mod pallet_gilt { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveGilt<_0, _1, _2> { - pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, - pub amount: _0, - pub who: _1, - pub expiry: _2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveGiltsTotal<_0> { - pub frozen: _0, - pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, - pub index: u32, - pub target: ::subxt::sp_arithmetic::per_things::Perquintill, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - place_bid { - #[codec(compact)] - amount: u128, - duration: u32, - }, - retract_bid { - #[codec(compact)] - amount: u128, - duration: u32, - }, - set_target { - #[codec(compact)] - target: ::subxt::sp_arithmetic::per_things::Perquintill, - }, - thaw { - #[codec(compact)] - index: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - DurationTooSmall, - DurationTooBig, - AmountTooSmall, - BidTooLow, - Unknown, - NotOwner, - NotExpired, - NotFound, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - BidPlaced(::subxt::sp_core::crypto::AccountId32, u128, u32), - BidRetracted(::subxt::sp_core::crypto::AccountId32, u128, u32), - GiltIssued(u32, u32, ::subxt::sp_core::crypto::AccountId32, u128), - GiltThawed(u32, ::subxt::sp_core::crypto::AccountId32, u128, u128), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct GiltBid<_0, _1> { - pub amount: _0, - pub who: _1, - } - } - } - pub mod pallet_grandpa { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - report_equivocation { - equivocation_proof: std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - u32, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - report_equivocation_unsigned { - equivocation_proof: std::boxed::Box< - runtime_types::sp_finality_grandpa::EquivocationProof< - ::subxt::sp_core::H256, - u32, - >, - >, - key_owner_proof: runtime_types::sp_session::MembershipProof, - }, - note_stalled { - delay: u32, - best_finalized_block_number: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - PauseFailed, - ResumeFailed, - ChangePending, - TooSoon, - InvalidKeyOwnershipProof, - InvalidEquivocationProof, - DuplicateOffenceReport, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewAuthorities( - Vec<(runtime_types::sp_finality_grandpa::app::Public, u64)>, - ), - Paused, - Resumed, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 , u64 ,) > , pub forced : Option < _0 > , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum StoredState<_0> { - Live, - PendingPause { scheduled_at: _0, delay: _0 }, - Paused, - 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)] - pub enum Call { - add_registrar { - account: ::subxt::sp_core::crypto::AccountId32, - }, - set_identity { - info: std::boxed::Box< - runtime_types::pallet_identity::types::IdentityInfo, - >, - }, - set_subs { - subs: Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - }, - clear_identity, - request_judgement { - #[codec(compact)] - reg_index: u32, - #[codec(compact)] - max_fee: u128, - }, - cancel_request { - reg_index: u32, - }, - set_fee { - #[codec(compact)] - index: u32, - #[codec(compact)] - fee: u128, - }, - set_account_id { - #[codec(compact)] - index: u32, - new: ::subxt::sp_core::crypto::AccountId32, - }, - set_fields { - #[codec(compact)] - index: u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - }, - provide_judgement { - #[codec(compact)] - reg_index: u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - judgement: runtime_types::pallet_identity::types::Judgement, - }, - kill_identity { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - add_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - data: runtime_types::pallet_identity::types::Data, - }, - rename_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - data: runtime_types::pallet_identity::types::Data, - }, - remove_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - quit_sub, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - TooManySubAccounts, - NotFound, - NotNamed, - EmptyIndex, - FeeChanged, - NoIdentity, - StickyJudgement, - JudgementGiven, - InvalidJudgement, - InvalidIndex, - InvalidTarget, - TooManyFields, - TooManyRegistrars, - AlreadyClaimed, - NotSub, - NotOwned, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - IdentitySet(::subxt::sp_core::crypto::AccountId32), - IdentityCleared(::subxt::sp_core::crypto::AccountId32, u128), - IdentityKilled(::subxt::sp_core::crypto::AccountId32, u128), - JudgementRequested(::subxt::sp_core::crypto::AccountId32, u32), - JudgementUnrequested(::subxt::sp_core::crypto::AccountId32, u32), - JudgementGiven(::subxt::sp_core::crypto::AccountId32, u32), - RegistrarAdded(u32), - SubIdentityAdded( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - SubIdentityRemoved( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - SubIdentityRevoked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - } - } - pub mod types { - use super::runtime_types; - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct BitFlags<_0>( - pub u64, - #[codec(skip)] pub ::core::marker::PhantomData<_0>, - ); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Data { - None, - Raw0([u8; 0usize]), - Raw1([u8; 1usize]), - Raw2([u8; 2usize]), - Raw3([u8; 3usize]), - Raw4([u8; 4usize]), - Raw5([u8; 5usize]), - Raw6([u8; 6usize]), - Raw7([u8; 7usize]), - Raw8([u8; 8usize]), - Raw9([u8; 9usize]), - Raw10([u8; 10usize]), - Raw11([u8; 11usize]), - Raw12([u8; 12usize]), - Raw13([u8; 13usize]), - Raw14([u8; 14usize]), - Raw15([u8; 15usize]), - Raw16([u8; 16usize]), - Raw17([u8; 17usize]), - Raw18([u8; 18usize]), - Raw19([u8; 19usize]), - Raw20([u8; 20usize]), - Raw21([u8; 21usize]), - Raw22([u8; 22usize]), - Raw23([u8; 23usize]), - Raw24([u8; 24usize]), - Raw25([u8; 25usize]), - Raw26([u8; 26usize]), - Raw27([u8; 27usize]), - Raw28([u8; 28usize]), - Raw29([u8; 29usize]), - Raw30([u8; 30usize]), - Raw31([u8; 31usize]), - Raw32([u8; 32usize]), - BlakeTwo256([u8; 32usize]), - Sha256([u8; 32usize]), - Keccak256([u8; 32usize]), - ShaThree256([u8; 32usize]), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum IdentityField { - Display, - Legal, - Web, - Riot, - Email, - PgpFingerprint, - Image, - Twitter, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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: Option<[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)] - pub enum Judgement<_0> { - Unknown, - FeePaid(_0), - Reasonable, - KnownGood, - OutOfDate, - LowQuality, - Erroneous, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Registration<_0> { - pub judgements: - runtime_types::frame_support::storage::bounded_vec::BoundedVec<( - 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)] - pub enum Call { - heartbeat { heartbeat : runtime_types :: pallet_im_online :: Heartbeat < u32 > , signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidKey, - DuplicatedHeartbeat, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - HeartbeatReceived( - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - ), - AllGood, - SomeOffline( - Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - u128, - >, - )>, - ), - } - } - pub mod sr25519 { - use super::runtime_types; - pub mod app_sr25519 { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BoundedOpaqueNetworkState { pub peer_id : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > , pub external_addresses : runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < runtime_types :: frame_support :: storage :: weak_bounded_vec :: WeakBoundedVec < u8 > > , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Call { - claim { - index: u32, - }, - transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: u32, - }, - free { - index: u32, - }, - force_transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: u32, - freeze: bool, - }, - freeze { - index: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotAssigned, - NotOwner, - InUse, - NotTransfer, - Permanent, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - IndexAssigned(::subxt::sp_core::crypto::AccountId32, u32), - IndexFreed(u32), - IndexFrozen(u32, ::subxt::sp_core::crypto::AccountId32), - } - } - } - pub mod pallet_lottery { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - buy_ticket { - call: std::boxed::Box, - }, - set_calls { - calls: Vec, - }, - start_lottery { - price: u128, - length: u32, - delay: u32, - repeat: bool, - }, - stop_repeat, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotConfigured, - InProgress, - AlreadyEnded, - InvalidCall, - AlreadyParticipating, - TooManyCalls, - EncodingFailed, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - LotteryStarted, - CallsUpdated, - Winner(::subxt::sp_core::crypto::AccountId32, u128), - TicketBought(::subxt::sp_core::crypto::AccountId32, (u8, u8)), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct LotteryConfig<_0, _1> { - pub price: _1, - pub start: _0, - pub length: _0, - pub delay: _0, - pub repeat: bool, - } - } - pub mod pallet_membership { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - add_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - remove_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - swap_member { - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - }, - reset_members { - members: Vec<::subxt::sp_core::crypto::AccountId32>, - }, - change_key { - new: ::subxt::sp_core::crypto::AccountId32, - }, - set_prime { - who: ::subxt::sp_core::crypto::AccountId32, - }, - clear_prime, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - AlreadyMember, - NotMember, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - MemberAdded, - MemberRemoved, - MembersSwapped, - MembersReset, - KeyChanged, - Dummy, - } - } - } - pub mod pallet_multisig { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - as_multi_threshold_1 { - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - call: std::boxed::Box, - }, - as_multi { - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: - Option>, - call: - runtime_types::frame_support::traits::misc::WrapperKeepOpaque< - runtime_types::node_runtime::Call, - >, - store_call: bool, - max_weight: u64, - }, - approve_as_multi { - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - maybe_timepoint: - Option>, - call_hash: [u8; 32usize], - max_weight: u64, - }, - cancel_as_multi { - threshold: u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, - timepoint: runtime_types::pallet_multisig::Timepoint, - call_hash: [u8; 32usize], - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - MinimumThreshold, - AlreadyApproved, - NoApprovalsNeeded, - TooFewSignatories, - TooManySignatories, - SignatoriesOutOfOrder, - SenderInSignatories, - NotFound, - NotOwner, - NoTimepoint, - WrongTimepoint, - UnexpectedTimepoint, - MaxWeightTooLow, - AlreadyStored, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewMultisig( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], - ), - MultisigApproval( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint, - ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], - ), - MultisigExecuted( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint, - ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], - Result<(), runtime_types::sp_runtime::DispatchError>, - ), - MultisigCancelled( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint, - ::subxt::sp_core::crypto::AccountId32, - [u8; 32usize], - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Multisig<_0, _1, _2> { - pub when: runtime_types::pallet_multisig::Timepoint<_0>, - pub deposit: _1, - pub depositor: _2, - pub approvals: Vec<_2>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Event { - Offence([u8; 16usize], Vec), - } - } - } - pub mod pallet_proxy { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - proxy { - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: Option, - call: std::boxed::Box, - }, - add_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: u32, - }, - remove_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: u32, - }, - remove_proxies, - anonymous { - proxy_type: runtime_types::node_runtime::ProxyType, - delay: u32, - index: u16, - }, - kill_anonymous { - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - index: u16, - #[codec(compact)] - height: u32, - #[codec(compact)] - ext_index: u32, - }, - announce { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - remove_announcement { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - reject_announcement { - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - proxy_announced { - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: Option, - call: std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - TooMany, - NotFound, - NotProxy, - Unproxyable, - Duplicate, - NoPermission, - Unannounced, - NoSelfProxy, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - ProxyExecuted(Result<(), runtime_types::sp_runtime::DispatchError>), - AnonymousCreated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_runtime::ProxyType, - u16, - ), - Announced( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ), - ProxyAdded( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_runtime::ProxyType, - u32, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Announcement<_0, _1, _2> { - pub real: _0, - pub call_hash: _1, - pub height: _2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProxyDefinition<_0, _1, _2> { - pub delegate: _0, - pub proxy_type: _1, - pub delay: _2, - } - } - pub mod pallet_recovery { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - as_recovered { - account: ::subxt::sp_core::crypto::AccountId32, - call: std::boxed::Box, - }, - set_recovered { - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - }, - create_recovery { - friends: Vec<::subxt::sp_core::crypto::AccountId32>, - threshold: u16, - delay_period: u32, - }, - initiate_recovery { - account: ::subxt::sp_core::crypto::AccountId32, - }, - vouch_recovery { - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - }, - claim_recovery { - account: ::subxt::sp_core::crypto::AccountId32, - }, - close_recovery { - rescuer: ::subxt::sp_core::crypto::AccountId32, - }, - remove_recovery, - cancel_recovered { - account: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotAllowed, - ZeroThreshold, - NotEnoughFriends, - MaxFriends, - NotSorted, - NotRecoverable, - AlreadyRecoverable, - AlreadyStarted, - NotStarted, - NotFriend, - DelayPeriod, - AlreadyVouched, - Threshold, - StillActive, - AlreadyProxy, - BadState, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - RecoveryCreated(::subxt::sp_core::crypto::AccountId32), - RecoveryInitiated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - RecoveryVouched( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - RecoveryClosed( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - AccountRecovered( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - RecoveryRemoved(::subxt::sp_core::crypto::AccountId32), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveRecovery<_0, _1, _2> { - pub created: _0, - pub deposit: _1, - pub friends: Vec<_2>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryConfig<_0, _1, _2> { - pub delay_period: _0, - pub deposit: _1, - pub friends: Vec<_2>, - pub threshold: u16, - } - } - pub mod pallet_scheduler { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - schedule { - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - cancel { - when: u32, - index: u32, - }, - schedule_named { - id: Vec, - when: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - cancel_named { - id: Vec, - }, - schedule_after { - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - schedule_named_after { - id: Vec, - after: u32, - maybe_periodic: Option<(u32, u32)>, - priority: u8, - call: std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - FailedToSchedule, - NotFound, - TargetBlockNumberInPast, - RescheduleNoChange, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Scheduled(u32, u32), - Canceled(u32, u32), - Dispatched( - (u32, u32), - Option>, - Result<(), runtime_types::sp_runtime::DispatchError>, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1, - V2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduledV2<_0, _1, _2, _3> { - pub maybe_id: Option>, - pub priority: u8, - pub call: _0, - pub maybe_periodic: 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)] - pub enum Call { - set_keys { - keys: runtime_types::node_runtime::SessionKeys, - proof: Vec, - }, - purge_keys, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidProof, - NoAssociatedValidatorId, - DuplicatedKey, - NoKeys, - NoAccount, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewSession(u32), - } - } - } - pub mod pallet_society { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - bid { - value: u128, - }, - unbid { - pos: u32, - }, - vouch { - who: ::subxt::sp_core::crypto::AccountId32, - value: u128, - tip: u128, - }, - unvouch { - pos: u32, - }, - vote { - candidate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - approve: bool, - }, - defender_vote { - approve: bool, - }, - payout, - found { - founder: ::subxt::sp_core::crypto::AccountId32, - max_members: u32, - rules: Vec, - }, - unfound, - judge_suspended_member { - who: ::subxt::sp_core::crypto::AccountId32, - forgive: bool, - }, - judge_suspended_candidate { - who: ::subxt::sp_core::crypto::AccountId32, - judgement: runtime_types::pallet_society::Judgement, - }, - set_max_members { - max: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - BadPosition, - NotMember, - AlreadyMember, - Suspended, - NotSuspended, - NoPayout, - AlreadyFounded, - InsufficientPot, - AlreadyVouching, - NotVouching, - Head, - Founder, - AlreadyBid, - AlreadyCandidate, - NotCandidate, - MaxMembers, - NotFounder, - NotHead, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Founded(::subxt::sp_core::crypto::AccountId32), - Bid(::subxt::sp_core::crypto::AccountId32, u128), - Vouch( - ::subxt::sp_core::crypto::AccountId32, - u128, - ::subxt::sp_core::crypto::AccountId32, - ), - AutoUnbid(::subxt::sp_core::crypto::AccountId32), - Unbid(::subxt::sp_core::crypto::AccountId32), - Unvouch(::subxt::sp_core::crypto::AccountId32), - Inducted( - ::subxt::sp_core::crypto::AccountId32, - Vec<::subxt::sp_core::crypto::AccountId32>, - ), - SuspendedMemberJudgement(::subxt::sp_core::crypto::AccountId32, bool), - CandidateSuspended(::subxt::sp_core::crypto::AccountId32), - MemberSuspended(::subxt::sp_core::crypto::AccountId32), - Challenged(::subxt::sp_core::crypto::AccountId32), - Vote( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - bool, - ), - DefenderVote(::subxt::sp_core::crypto::AccountId32, bool), - NewMaxMembers(u32), - Unfounded(::subxt::sp_core::crypto::AccountId32), - Deposit(u128), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bid<_0, _1> { - pub who: _0, - pub kind: runtime_types::pallet_society::BidKind<_0, _1>, - pub value: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum BidKind<_0, _1> { - Deposit(_1), - Vouch(_0, _1), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Judgement { - Rebid, - Reject, - Approve, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Vote { - Skeptic, - Reject, - Approve, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum VouchingStatus { - Vouching, - Banned, - } - } - 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, - )] - pub enum Call { - bond { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - #[codec(compact)] - value: u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - bond_extra { - #[codec(compact)] - max_additional: u128, - }, - unbond { - #[codec(compact)] - value: u128, - }, - withdraw_unbonded { - num_slashing_spans: u32, - }, - validate { - prefs: runtime_types::pallet_staking::ValidatorPrefs, - }, - nominate { - targets: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - }, - chill, - set_payee { - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - set_controller { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - set_validator_count { - #[codec(compact)] - new: u32, - }, - increase_validator_count { - #[codec(compact)] - additional: u32, - }, - scale_validator_count { - factor: runtime_types::sp_arithmetic::per_things::Percent, - }, - force_no_eras, - force_new_era, - set_invulnerables { - invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, - }, - force_unstake { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: u32, - }, - force_new_era_always, - cancel_deferred_slash { - era: u32, - slash_indices: Vec, - }, - payout_stakers { - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: u32, - }, - rebond { - #[codec(compact)] - value: u128, - }, - set_history_depth { - #[codec(compact)] - new_history_depth: u32, - #[codec(compact)] - era_items_deleted: u32, - }, - reap_stash { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: u32, - }, - kick { - who: Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - >, - }, - set_staking_limits { - min_nominator_bond: u128, - min_validator_bond: u128, - max_nominator_count: Option, - max_validator_count: Option, - threshold: - Option, - }, - chill_other { - controller: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Error { - NotController, - NotStash, - AlreadyBonded, - AlreadyPaired, - EmptyTargets, - DuplicateIndex, - InvalidSlashIndex, - InsufficientBond, - NoMoreChunks, - NoUnlockChunk, - FundedTarget, - InvalidEraToReward, - InvalidNumberOfNominations, - NotSortedAndUnique, - AlreadyClaimed, - IncorrectHistoryDepth, - IncorrectSlashingSpans, - BadState, - TooManyTargets, - BadTarget, - CannotChillOther, - TooManyNominators, - TooManyValidators, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Event { - EraPaid(u32, u128, u128), - Rewarded(::subxt::sp_core::crypto::AccountId32, u128), - Slashed(::subxt::sp_core::crypto::AccountId32, u128), - OldSlashingReportDiscarded(u32), - StakersElected, - Bonded(::subxt::sp_core::crypto::AccountId32, u128), - Unbonded(::subxt::sp_core::crypto::AccountId32, u128), - Withdrawn(::subxt::sp_core::crypto::AccountId32, u128), - Kicked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - StakingElectionFailed, - Chilled(::subxt::sp_core::crypto::AccountId32), - PayoutStarted(u32, ::subxt::sp_core::crypto::AccountId32), - } - } - } - pub mod slashing { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SlashingSpans { - pub span_index: u32, - pub last_start: u32, - pub last_nonzero_slash: u32, - pub prior: Vec, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SpanRecord<_0> { - pub slashed: _0, - pub paid_out: _0, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveEraInfo { - pub index: u32, - pub start: Option, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct EraRewardPoints<_0> { - pub total: u32, - pub individual: std::collections::BTreeMap<_0, u32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Exposure<_0, _1> { - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub own: _1, - pub others: - Vec>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Forcing { - NotForcing, - ForceNew, - ForceNone, - ForceAlways, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IndividualExposure<_0, _1> { - pub who: _0, - #[codec(compact)] - pub value: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Nominations<_0> { - pub targets: Vec<_0>, - pub submitted_in: u32, - pub suppressed: bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1_0_0Ancient, - V2_0_0, - V3_0_0, - V4_0_0, - V5_0_0, - V6_0_0, - V7_0_0, - V8_0_0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RewardDestination<_0> { - Staked, - Stash, - Controller, - Account(_0), - None, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct StakingLedger<_0, _1> { - pub stash: _0, - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub active: _1, - pub unlocking: Vec>, - pub claimed_rewards: Vec, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct UnappliedSlash<_0, _1> { - pub validator: _0, - pub own: _1, - pub others: Vec<(_0, _1)>, - pub reporters: Vec<_0>, - pub payout: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct UnlockChunk<_0> { - #[codec(compact)] - pub value: _0, - #[codec(compact)] - pub era: u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ValidatorPrefs { - #[codec(compact)] - pub commission: ::subxt::sp_arithmetic::per_things::Perbill, - pub blocked: bool, - } - } - pub mod pallet_sudo { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - sudo { - call: std::boxed::Box, - }, - sudo_unchecked_weight { - call: std::boxed::Box, - weight: u64, - }, - set_key { - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - sudo_as { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - call: std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - RequireSudo, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Sudid(Result<(), runtime_types::sp_runtime::DispatchError>), - KeyChanged(::subxt::sp_core::crypto::AccountId32), - SudoAsDone(Result<(), runtime_types::sp_runtime::DispatchError>), - } - } - } - pub mod pallet_timestamp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - set { - #[codec(compact)] - now: u64, - }, - } - } - } - pub mod pallet_tips { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - report_awesome { - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - }, - retract_tip { - hash: ::subxt::sp_core::H256, - }, - tip_new { - reason: Vec, - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - tip_value: u128, - }, - tip { - hash: ::subxt::sp_core::H256, - #[codec(compact)] - tip_value: u128, - }, - close_tip { - hash: ::subxt::sp_core::H256, - }, - slash_tip { - hash: ::subxt::sp_core::H256, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - ReasonTooBig, - AlreadyKnown, - UnknownTip, - NotFinder, - StillOpen, - Premature, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewTip(::subxt::sp_core::H256), - TipClosing(::subxt::sp_core::H256), - TipClosed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - TipRetracted(::subxt::sp_core::H256), - TipSlashed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - u128, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpenTip<_0, _1, _2, _3> { - pub reason: _3, - pub who: _0, - pub finder: _0, - pub deposit: _1, - pub closes: Option<_2>, - pub tips: Vec<(_0, _1)>, - pub finders_fee: bool, - } - } - pub mod pallet_transaction_payment { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ChargeTransactionPayment(pub u128); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1Ancient, - V2, - } - } - pub mod pallet_transaction_storage { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - store { data : Vec < u8 > , } , renew { block : u32 , index : u32 , } , check_proof { proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InsufficientFunds, - NotConfigured, - RenewedNotFound, - EmptyTransaction, - UnexpectedProof, - InvalidProof, - MissingProof, - MissingStateData, - DoubleCheck, - ProofNotChecked, - TransactionTooLarge, - TooManyTransactions, - BadContext, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Stored(u32), - Renewed(u32), - ProofChecked, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransactionInfo { - pub chunk_root: ::subxt::sp_core::H256, - pub content_hash: ::subxt::sp_core::H256, - pub size: u32, - pub block_chunks: u32, - } - } - pub mod pallet_treasury { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - propose_spend { - #[codec(compact)] - value: u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - reject_proposal { - #[codec(compact)] - proposal_id: u32, - }, - approve_proposal { - #[codec(compact)] - proposal_id: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InsufficientProposersBalance, - InvalidIndex, - TooManyApprovals, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Proposed(u32), - Spending(u128), - Awarded(u32, u128, ::subxt::sp_core::crypto::AccountId32), - Rejected(u32, u128), - Burnt(u128), - Rollover(u128), - Deposit(u128), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposal<_0, _1> { - pub proposer: _0, - pub value: _1, - pub beneficiary: _0, - pub bond: _1, - } - } - pub mod pallet_uniques { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - create { # [codec (compact)] class : u32 , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , force_create { # [codec (compact)] class : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , free_holding : bool , } , destroy { # [codec (compact)] class : u32 , witness : runtime_types :: pallet_uniques :: types :: DestroyWitness , } , mint { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , burn { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , check_owner : Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > > , } , transfer { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , dest : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , redeposit { # [codec (compact)] class : u32 , instances : Vec < u32 > , } , freeze { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , } , thaw { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , } , freeze_class { # [codec (compact)] class : u32 , } , thaw_class { # [codec (compact)] class : u32 , } , transfer_ownership { # [codec (compact)] class : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , set_team { # [codec (compact)] class : u32 , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , approve_transfer { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , delegate : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , } , cancel_approval { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , maybe_check_delegate : Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > > , } , force_asset_status { # [codec (compact)] class : u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , u32 > , free_holding : bool , is_frozen : bool , } , set_attribute { # [codec (compact)] class : u32 , maybe_instance : Option < u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , value : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , } , clear_attribute { # [codec (compact)] class : u32 , maybe_instance : Option < u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , } , set_metadata { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , is_frozen : bool , } , clear_metadata { # [codec (compact)] class : u32 , # [codec (compact)] instance : u32 , } , set_class_metadata { # [codec (compact)] class : u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < u8 > , is_frozen : bool , } , clear_class_metadata { # [codec (compact)] class : u32 , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NoPermission, - Unknown, - AlreadyExists, - WrongOwner, - BadWitness, - InUse, - Frozen, - WrongDelegate, - NoDelegate, - Unapproved, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Created( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - ForceCreated(u32, ::subxt::sp_core::crypto::AccountId32), - Destroyed(u32), - Issued(u32, u32, ::subxt::sp_core::crypto::AccountId32), - Transferred( - u32, - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - Burned(u32, u32, ::subxt::sp_core::crypto::AccountId32), - Frozen(u32, u32), - Thawed(u32, u32), - ClassFrozen(u32), - ClassThawed(u32), - OwnerChanged(u32, ::subxt::sp_core::crypto::AccountId32), - TeamChanged( - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - ApprovedTransfer( - u32, - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - ApprovalCancelled( - u32, - u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - AssetStatusChanged(u32), - ClassMetadataSet( - u32, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - bool, - ), - ClassMetadataCleared(u32), - MetadataSet( - u32, - u32, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - bool, - ), - MetadataCleared(u32, u32), - Redeposited(u32, Vec), - AttributeSet( - u32, - Option, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - ), - AttributeCleared( - u32, - Option, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - ), - } - } - pub mod types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassDetails<_0, _1> { - pub owner: _0, - pub issuer: _0, - pub admin: _0, - pub freezer: _0, - pub total_deposit: _1, - pub free_holding: bool, - pub instances: u32, - pub instance_metadatas: u32, - pub attributes: u32, - pub is_frozen: bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassMetadata<_0> { - pub deposit: _0, - pub data: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - pub is_frozen: bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DestroyWitness { - #[codec(compact)] - pub instances: u32, - #[codec(compact)] - pub instance_metadatas: u32, - #[codec(compact)] - pub attributes: u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstanceDetails<_0, _1> { - pub owner: _0, - pub approved: Option<_0>, - pub is_frozen: bool, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstanceMetadata<_0> { - pub deposit: _0, - pub data: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - u8, - >, - pub is_frozen: bool, - } - } - } - pub mod pallet_utility { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - batch { - calls: Vec, - }, - as_derivative { - index: u16, - call: std::boxed::Box, - }, - batch_all { - calls: Vec, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - TooManyCalls, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - BatchInterrupted(u32, runtime_types::sp_runtime::DispatchError), - BatchCompleted, - ItemCompleted, - } - } - } - pub mod pallet_vesting { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - vest, - vest_other { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - }, - vested_transfer { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - u128, - u32, - >, - }, - force_vested_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - u32, - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - u128, - u32, - >, - }, - merge_schedules { - schedule1_index: u32, - schedule2_index: u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotVesting, - AtMaxVestingSchedules, - AmountLow, - ScheduleIndexOutOfBounds, - InvalidScheduleParams, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - VestingUpdated(::subxt::sp_core::crypto::AccountId32, u128), - VestingCompleted(::subxt::sp_core::crypto::AccountId32), - } - } - pub mod vesting_info { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestingInfo<_0, _1> { - pub locked: _0, - pub per_block: _0, - pub starting_block: _1, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V0, - V1, - } - } - pub mod primitive_types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct H256(pub [u8; 32usize]); - } - pub mod sp_arithmetic { - use super::runtime_types; - pub mod fixed_point { - use super::runtime_types; - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct FixedU128(pub u128); - } - pub mod per_things { - use super::runtime_types; - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct PerU16(pub u16); - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Perbill(pub u32); - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Percent(pub u8); - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Permill(pub u32); - #[derive( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Perquintill(pub u64); - } - } - pub mod sp_authority_discovery { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod digests { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum NextConfigDescriptor { - V1 { - c: (u64, u64), - allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum AllowedSlots { - PrimarySlots, - PrimaryAndSecondaryPlainSlots, - PrimaryAndSecondaryVRFSlots, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BabeEpochConfiguration { - pub c: (u64, 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)] - 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( - :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Slot(pub u64); - } - pub mod sp_core { - use super::runtime_types; - pub mod changes_trie { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ChangesTrieConfiguration { - pub digest_interval: u32, - pub digest_levels: u32, - } - } - pub mod crypto { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AccountId32(pub [u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KeyTypeId(pub [u8; 4usize]); - } - pub mod ecdsa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub [u8; 65usize]); - } - pub mod ed25519 { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Public(pub [u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub [u8; 64usize]); - } - pub mod offchain { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaqueMultiaddr(pub Vec); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaqueNetworkState { - pub peer_id: runtime_types::sp_core::OpaquePeerId, - pub external_addresses: - Vec, - } - } - pub mod sr25519 { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Public(pub [u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub [u8; 64usize]); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaquePeerId(pub Vec); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Public(pub runtime_types::sp_core::ed25519::Public); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Equivocation<_0, _1> { - 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, - >, - ), - 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)] - pub struct EquivocationProof<_0, _1> { - pub set_id: 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)] - pub struct Support<_0> { - pub total: u128, - pub voters: Vec<(_0, 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, - )] - pub enum ChangesTrieSignal { - NewConfiguration (Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > ,) , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct Digest<_0> { - pub logs: Vec< - runtime_types::sp_runtime::generic::digest::DigestItem<_0>, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum DigestItem<_0> { - ChangesTrieRoot(_0), - PreRuntime([u8; 4usize], Vec), - Consensus([u8; 4usize], Vec), - Seal([u8; 4usize], Vec), - ChangesTrieSignal( - runtime_types::sp_runtime::generic::digest::ChangesTrieSignal, - ), - Other(Vec), - RuntimeEnvironmentUpdated, - } - } - pub mod era { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Era { - Immortal, - Mortal1(u8), - Mortal2(u8), - Mortal3(u8), - Mortal4(u8), - Mortal5(u8), - Mortal6(u8), - Mortal7(u8), - Mortal8(u8), - Mortal9(u8), - Mortal10(u8), - Mortal11(u8), - Mortal12(u8), - Mortal13(u8), - Mortal14(u8), - Mortal15(u8), - Mortal16(u8), - Mortal17(u8), - Mortal18(u8), - Mortal19(u8), - Mortal20(u8), - Mortal21(u8), - Mortal22(u8), - Mortal23(u8), - Mortal24(u8), - Mortal25(u8), - Mortal26(u8), - Mortal27(u8), - Mortal28(u8), - Mortal29(u8), - Mortal30(u8), - Mortal31(u8), - Mortal32(u8), - Mortal33(u8), - Mortal34(u8), - Mortal35(u8), - Mortal36(u8), - Mortal37(u8), - Mortal38(u8), - Mortal39(u8), - Mortal40(u8), - Mortal41(u8), - Mortal42(u8), - Mortal43(u8), - Mortal44(u8), - Mortal45(u8), - Mortal46(u8), - Mortal47(u8), - Mortal48(u8), - Mortal49(u8), - Mortal50(u8), - Mortal51(u8), - Mortal52(u8), - Mortal53(u8), - Mortal54(u8), - Mortal55(u8), - Mortal56(u8), - Mortal57(u8), - Mortal58(u8), - Mortal59(u8), - Mortal60(u8), - Mortal61(u8), - Mortal62(u8), - Mortal63(u8), - Mortal64(u8), - Mortal65(u8), - Mortal66(u8), - Mortal67(u8), - Mortal68(u8), - Mortal69(u8), - Mortal70(u8), - Mortal71(u8), - Mortal72(u8), - Mortal73(u8), - Mortal74(u8), - Mortal75(u8), - Mortal76(u8), - Mortal77(u8), - Mortal78(u8), - Mortal79(u8), - Mortal80(u8), - Mortal81(u8), - Mortal82(u8), - Mortal83(u8), - Mortal84(u8), - Mortal85(u8), - Mortal86(u8), - Mortal87(u8), - Mortal88(u8), - Mortal89(u8), - Mortal90(u8), - Mortal91(u8), - Mortal92(u8), - Mortal93(u8), - Mortal94(u8), - Mortal95(u8), - Mortal96(u8), - Mortal97(u8), - Mortal98(u8), - Mortal99(u8), - Mortal100(u8), - Mortal101(u8), - Mortal102(u8), - Mortal103(u8), - Mortal104(u8), - Mortal105(u8), - Mortal106(u8), - Mortal107(u8), - Mortal108(u8), - Mortal109(u8), - Mortal110(u8), - Mortal111(u8), - Mortal112(u8), - Mortal113(u8), - Mortal114(u8), - Mortal115(u8), - Mortal116(u8), - Mortal117(u8), - Mortal118(u8), - Mortal119(u8), - Mortal120(u8), - Mortal121(u8), - Mortal122(u8), - Mortal123(u8), - Mortal124(u8), - Mortal125(u8), - Mortal126(u8), - Mortal127(u8), - Mortal128(u8), - Mortal129(u8), - Mortal130(u8), - Mortal131(u8), - Mortal132(u8), - Mortal133(u8), - Mortal134(u8), - Mortal135(u8), - Mortal136(u8), - Mortal137(u8), - Mortal138(u8), - Mortal139(u8), - Mortal140(u8), - Mortal141(u8), - Mortal142(u8), - Mortal143(u8), - Mortal144(u8), - Mortal145(u8), - Mortal146(u8), - Mortal147(u8), - Mortal148(u8), - Mortal149(u8), - Mortal150(u8), - Mortal151(u8), - Mortal152(u8), - Mortal153(u8), - Mortal154(u8), - Mortal155(u8), - Mortal156(u8), - Mortal157(u8), - Mortal158(u8), - Mortal159(u8), - Mortal160(u8), - Mortal161(u8), - Mortal162(u8), - Mortal163(u8), - Mortal164(u8), - Mortal165(u8), - Mortal166(u8), - Mortal167(u8), - Mortal168(u8), - Mortal169(u8), - Mortal170(u8), - Mortal171(u8), - Mortal172(u8), - Mortal173(u8), - Mortal174(u8), - Mortal175(u8), - Mortal176(u8), - Mortal177(u8), - Mortal178(u8), - Mortal179(u8), - Mortal180(u8), - Mortal181(u8), - Mortal182(u8), - Mortal183(u8), - Mortal184(u8), - Mortal185(u8), - Mortal186(u8), - Mortal187(u8), - Mortal188(u8), - Mortal189(u8), - Mortal190(u8), - Mortal191(u8), - Mortal192(u8), - Mortal193(u8), - Mortal194(u8), - Mortal195(u8), - Mortal196(u8), - Mortal197(u8), - Mortal198(u8), - Mortal199(u8), - Mortal200(u8), - Mortal201(u8), - Mortal202(u8), - Mortal203(u8), - Mortal204(u8), - Mortal205(u8), - Mortal206(u8), - Mortal207(u8), - Mortal208(u8), - Mortal209(u8), - Mortal210(u8), - Mortal211(u8), - Mortal212(u8), - Mortal213(u8), - Mortal214(u8), - Mortal215(u8), - Mortal216(u8), - Mortal217(u8), - Mortal218(u8), - Mortal219(u8), - Mortal220(u8), - Mortal221(u8), - Mortal222(u8), - Mortal223(u8), - Mortal224(u8), - Mortal225(u8), - Mortal226(u8), - Mortal227(u8), - Mortal228(u8), - Mortal229(u8), - Mortal230(u8), - Mortal231(u8), - Mortal232(u8), - Mortal233(u8), - Mortal234(u8), - Mortal235(u8), - Mortal236(u8), - Mortal237(u8), - Mortal238(u8), - Mortal239(u8), - Mortal240(u8), - Mortal241(u8), - Mortal242(u8), - Mortal243(u8), - Mortal244(u8), - Mortal245(u8), - Mortal246(u8), - Mortal247(u8), - Mortal248(u8), - Mortal249(u8), - Mortal250(u8), - Mortal251(u8), - Mortal252(u8), - Mortal253(u8), - Mortal254(u8), - Mortal255(u8), - } - } - pub mod header { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - 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< - ::subxt::sp_core::H256, - >, - #[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, - )] - pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - Vec, - #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, - ); - } - } - pub mod multiaddress { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum MultiAddress<_0, _1> { - Id(_0), - Index(_1), - Raw(Vec), - Address32([u8; 32usize]), - Address20([u8; 20usize]), - } - } - pub mod traits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BlakeTwo256 {} - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum ArithmeticError { - Underflow, - Overflow, - DivisionByZero, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum DispatchError { - Other, - CannotLookup, - BadOrigin, - Module { index: u8, error: u8 }, - ConsumerRemaining, - NoProviders, - Token(runtime_types::sp_runtime::TokenError), - Arithmetic(runtime_types::sp_runtime::ArithmeticError), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum MultiSignature { - Ed25519(runtime_types::sp_core::ed25519::Signature), - Sr25519(runtime_types::sp_core::sr25519::Signature), - Ecdsa(runtime_types::sp_core::ecdsa::Signature), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum TokenError { - NoFunds, - WouldDie, - BelowMinimum, - CannotCreate, - UnknownAsset, - Frozen, - Unsupported, - } - } - pub mod sp_session { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MembershipProof { - pub session: u32, - pub trie_nodes: Vec>, - pub validator_count: u32, - } - } - pub mod sp_staking { - use super::runtime_types; - pub mod offence { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OffenceDetails<_0, _1> { - pub offender: _1, - pub reporters: Vec<_0>, - } - } - } - pub mod sp_transaction_storage_proof { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransactionStorageProof { - pub chunk: Vec, - pub proof: Vec>, - } - } - pub mod sp_version { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RuntimeVersion { - pub spec_name: String, - pub impl_name: String, - pub authoring_version: u32, - pub spec_version: u32, - pub impl_version: u32, - pub apis: Vec<([u8; 8usize], u32)>, - pub transaction_version: u32, - } - } - } - #[doc = r" Default configuration of common types for a target Substrate runtime."] - #[derive(Clone, Debug, Default, Eq, PartialEq)] - pub struct DefaultConfig; - impl ::subxt::Config for DefaultConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = ::subxt::sp_core::H256; - type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; - type AccountId = ::subxt::sp_runtime::AccountId32; - type Address = ::subxt::sp_runtime::MultiAddress; - type Header = ::subxt::sp_runtime::generic::Header< - Self::BlockNumber, - ::subxt::sp_runtime::traits::BlakeTwo256, - >; - type Signature = ::subxt::sp_runtime::MultiSignature; - type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; - } - impl ::subxt::ExtrinsicExtraData for DefaultConfig { - type AccountData = AccountData; - type Extra = ::subxt::DefaultExtra; - } - pub type AccountData = self::system::storage::Account; - impl ::subxt::AccountData for AccountData { - fn nonce( - result: &::Value, - ) -> ::Index { - result.nonce - } - fn storage_entry( - account_id: ::AccountId, - ) -> Self { - Self(account_id) - } - } - pub struct RuntimeApi> { - pub client: ::subxt::Client, - } - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - fn from(client: ::subxt::Client) -> Self { - Self { client } - } - } - impl<'a, T> RuntimeApi - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { - client: &self.client, - } - } - pub fn tx(&'a self) -> TransactionApi<'a, T> { - TransactionApi { - client: &self.client, - } - } - } - pub struct StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - client: &'a ::subxt::Client, - } - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn system(&self) -> system::storage::StorageApi<'a, T> { - system::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 authorship(&self) -> authorship::storage::StorageApi<'a, T> { - authorship::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 election_provider_multi_phase( - &self, - ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { - election_provider_multi_phase::storage::StorageApi::new(self.client) - } - pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { - staking::storage::StorageApi::new(self.client) - } - pub fn session(&self) -> session::storage::StorageApi<'a, T> { - session::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 elections(&self) -> elections::storage::StorageApi<'a, T> { - elections::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 grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { - grandpa::storage::StorageApi::new(self.client) - } - pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { - treasury::storage::StorageApi::new(self.client) - } - pub fn contracts(&self) -> contracts::storage::StorageApi<'a, T> { - contracts::storage::StorageApi::new(self.client) - } - pub fn sudo(&self) -> sudo::storage::StorageApi<'a, T> { - sudo::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 offences(&self) -> offences::storage::StorageApi<'a, T> { - offences::storage::StorageApi::new(self.client) - } - pub fn randomness_collective_flip( - &self, - ) -> randomness_collective_flip::storage::StorageApi<'a, T> { - randomness_collective_flip::storage::StorageApi::new(self.client) - } - pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { - identity::storage::StorageApi::new(self.client) - } - pub fn society(&self) -> society::storage::StorageApi<'a, T> { - society::storage::StorageApi::new(self.client) - } - pub fn recovery(&self) -> recovery::storage::StorageApi<'a, T> { - recovery::storage::StorageApi::new(self.client) - } - pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { - vesting::storage::StorageApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { - scheduler::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 tips(&self) -> tips::storage::StorageApi<'a, T> { - tips::storage::StorageApi::new(self.client) - } - pub fn assets(&self) -> assets::storage::StorageApi<'a, T> { - assets::storage::StorageApi::new(self.client) - } - pub fn mmr(&self) -> mmr::storage::StorageApi<'a, T> { - mmr::storage::StorageApi::new(self.client) - } - pub fn lottery(&self) -> lottery::storage::StorageApi<'a, T> { - lottery::storage::StorageApi::new(self.client) - } - pub fn gilt(&self) -> gilt::storage::StorageApi<'a, T> { - gilt::storage::StorageApi::new(self.client) - } - pub fn uniques(&self) -> uniques::storage::StorageApi<'a, T> { - uniques::storage::StorageApi::new(self.client) - } - pub fn transaction_storage( - &self, - ) -> transaction_storage::storage::StorageApi<'a, T> { - transaction_storage::storage::StorageApi::new(self.client) - } - pub fn bags_list(&self) -> bags_list::storage::StorageApi<'a, T> { - bags_list::storage::StorageApi::new(self.client) - } - } - pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { - client: &'a ::subxt::Client, - } - impl<'a, T> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn system(&self) -> system::calls::TransactionApi<'a, T> { - system::calls::TransactionApi::new(self.client) - } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { - utility::calls::TransactionApi::new(self.client) - } - pub fn babe(&self) -> babe::calls::TransactionApi<'a, T> { - babe::calls::TransactionApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T> { - timestamp::calls::TransactionApi::new(self.client) - } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { - authorship::calls::TransactionApi::new(self.client) - } - pub fn indices(&self) -> indices::calls::TransactionApi<'a, T> { - indices::calls::TransactionApi::new(self.client) - } - pub fn balances(&self) -> balances::calls::TransactionApi<'a, T> { - balances::calls::TransactionApi::new(self.client) - } - pub fn election_provider_multi_phase( - &self, - ) -> election_provider_multi_phase::calls::TransactionApi<'a, T> { - election_provider_multi_phase::calls::TransactionApi::new(self.client) - } - pub fn staking(&self) -> staking::calls::TransactionApi<'a, T> { - staking::calls::TransactionApi::new(self.client) - } - pub fn session(&self) -> session::calls::TransactionApi<'a, T> { - session::calls::TransactionApi::new(self.client) - } - pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T> { - democracy::calls::TransactionApi::new(self.client) - } - pub fn council(&self) -> council::calls::TransactionApi<'a, T> { - council::calls::TransactionApi::new(self.client) - } - pub fn technical_committee( - &self, - ) -> technical_committee::calls::TransactionApi<'a, T> { - technical_committee::calls::TransactionApi::new(self.client) - } - pub fn elections(&self) -> elections::calls::TransactionApi<'a, T> { - elections::calls::TransactionApi::new(self.client) - } - pub fn technical_membership( - &self, - ) -> technical_membership::calls::TransactionApi<'a, T> { - technical_membership::calls::TransactionApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { - grandpa::calls::TransactionApi::new(self.client) - } - pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T> { - treasury::calls::TransactionApi::new(self.client) - } - pub fn contracts(&self) -> contracts::calls::TransactionApi<'a, T> { - contracts::calls::TransactionApi::new(self.client) - } - pub fn sudo(&self) -> sudo::calls::TransactionApi<'a, T> { - sudo::calls::TransactionApi::new(self.client) - } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { - im_online::calls::TransactionApi::new(self.client) - } - pub fn identity(&self) -> identity::calls::TransactionApi<'a, T> { - identity::calls::TransactionApi::new(self.client) - } - pub fn society(&self) -> society::calls::TransactionApi<'a, T> { - society::calls::TransactionApi::new(self.client) - } - pub fn recovery(&self) -> recovery::calls::TransactionApi<'a, T> { - recovery::calls::TransactionApi::new(self.client) - } - pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T> { - vesting::calls::TransactionApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T> { - scheduler::calls::TransactionApi::new(self.client) - } - pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T> { - proxy::calls::TransactionApi::new(self.client) - } - pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T> { - multisig::calls::TransactionApi::new(self.client) - } - pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T> { - bounties::calls::TransactionApi::new(self.client) - } - pub fn tips(&self) -> tips::calls::TransactionApi<'a, T> { - tips::calls::TransactionApi::new(self.client) - } - pub fn assets(&self) -> assets::calls::TransactionApi<'a, T> { - assets::calls::TransactionApi::new(self.client) - } - pub fn lottery(&self) -> lottery::calls::TransactionApi<'a, T> { - lottery::calls::TransactionApi::new(self.client) - } - pub fn gilt(&self) -> gilt::calls::TransactionApi<'a, T> { - gilt::calls::TransactionApi::new(self.client) - } - pub fn uniques(&self) -> uniques::calls::TransactionApi<'a, T> { - uniques::calls::TransactionApi::new(self.client) - } - pub fn transaction_storage( - &self, - ) -> transaction_storage::calls::TransactionApi<'a, T> { - transaction_storage::calls::TransactionApi::new(self.client) - } - pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T> { - bags_list::calls::TransactionApi::new(self.client) - } - } -} diff --git a/tests/integration/node_runtime.scale b/tests/integration/node_runtime.scale index 80692153a8cb67479eeb2a05a7e42334dc3bea02..cff019d32c4e1906b0c9afa4de90c857b29cd5a3 100644 GIT binary patch delta 9099 zcmbtZ3wTsTmae*|`jH3N33+r#0ymIA2S^Z-AVC5Ij6;wRLU_m{giH5L($bHl9|;i< z10qBhHQR(UASjGRMF%0n;stitZvoNen_YP)j{yKH){E@`3P9&PWYDgJe+-l5_Jd)?!}m_o}ku^^+uWixQMwYNJ2s4yi8L?F;$k zPy_WkoqBg9AtifA_CWuN8hMF3)ZhvzEs>tA;Ij4Z{Gtjy&WBZRsGL@sBaG)j9UVboBo zVPed$HW?;fT==RXTSa}|UHp*ondRxHjc=HFrJovBdG|~e3=^+;FvqyP{xU}xR{4l$ z?tJ6Kj(J}j_Ut2D7yrs^*kEU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oQyq?8-3|4csqt(THzeeA$#JG~uA!^zLlZTZ|c=y>-rAsrUplCgLRW;b+p{sMA2e(w$neO{au}GJ;^*nOu2_QDO5*2 zvXjIdz#}{P41$MGcJlk#DXjkuUq((jZ5KuH2fyL*>S==>S(vqpN8`j@JPw8o!}{kb ztWT8h;(0(wzvBV&_cLPf0X{({r+xb&KF>%u`)y1jz>nyn_&JZRF20F8_v*;MBm6AcgZ&WZJx3_P)DVS`rNSkAo3M{?%$p#uujh-u!j`WL&zBCnz@K3mL}$ E2I`rkwg3PC From 0c45452d1a9d44e59a3a9138899742566d3499ce Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 11:13:04 +0200 Subject: [PATCH 180/216] Fmt --- src/lib.rs | 7 +++++-- tests/integration/runtime.rs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d3e218da3a..95119878b5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55,8 +55,8 @@ use codec::{ Encode, }; use core::{ - marker::PhantomData, fmt::Debug, + marker::PhantomData, }; mod client; @@ -197,6 +197,9 @@ impl WrapperKeepOpaque { /// Create from the given encoded `data`. pub fn from_encoded(data: Vec) -> Self { - Self { data, _phantom: PhantomData } + Self { + data, + _phantom: PhantomData, + } } } diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index 1c1af2e044..0d4a60ed50 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -16,6 +16,6 @@ #[subxt::subxt( runtime_metadata_path = "tests/integration/node_runtime.scale", - generated_type_derives = "Debug, Eq, PartialEq", + generated_type_derives = "Debug, Eq, PartialEq" )] pub mod node_runtime {} From 57f7a0b033e073854129625d3dda250f7305368a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 12:35:56 +0200 Subject: [PATCH 181/216] Extract type generator to module, separate & fix tests --- codegen/src/{types.rs => types/mod.rs} | 781 +----------------------- codegen/src/types/tests.rs | 796 +++++++++++++++++++++++++ 2 files changed, 800 insertions(+), 777 deletions(-) rename codegen/src/{types.rs => types/mod.rs} (51%) create mode 100644 codegen/src/types/tests.rs diff --git a/codegen/src/types.rs b/codegen/src/types/mod.rs similarity index 51% rename from codegen/src/types.rs rename to codegen/src/types/mod.rs index 45a65ce85e..b69f2dd65b 100644 --- a/codegen/src/types.rs +++ b/codegen/src/types/mod.rs @@ -40,6 +40,9 @@ use std::collections::{ HashSet, }; +#[cfg(test)] +mod tests; + #[derive(Debug)] pub struct TypeGenerator<'a> { root_mod_ident: Ident, @@ -304,7 +307,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { | TypeDefPrimitive::U128 ) ) { - Some(quote!( #[derive(::codec::CompactAs)] )) + Some(quote!( #[derive(::subxt::codec::CompactAs)] )) } else { None } @@ -731,779 +734,3 @@ impl TypePathSubstitute { } } } - -#[cfg(test)] -mod tests { - use super::*; - use pretty_assertions::assert_eq; - use scale_info::{ - meta_type, - Registry, - TypeInfo, - }; - - const MOD_PATH: &'static [&'static str] = &["subxt_codegen", "types", "tests"]; - - fn get_mod<'a>( - module: &'a Module, - path_segs: &[&'static str], - ) -> Option<&'a Module<'a>> { - let (mod_name, rest) = path_segs.split_first()?; - let mod_ident = Ident::new(mod_name, Span::call_site()); - let module = module.children.get(&mod_ident)?; - if rest.is_empty() { - Some(module) - } else { - get_mod(module, rest) - } - } - - #[test] - fn generate_struct_with_primitives() { - #[allow(unused)] - #[derive(TypeInfo)] - struct S { - a: bool, - b: u32, - c: char, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct S { - pub a: bool, - pub b: u32, - pub c: char, - } - } - } - .to_string() - ) - } - - #[test] - fn generate_struct_with_a_struct_field() { - #[allow(unused)] - #[derive(TypeInfo)] - struct Parent { - a: bool, - b: Child, - } - - #[allow(unused)] - #[derive(TypeInfo)] - struct Child { - a: i32, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Child { - pub a: i32, - } - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Parent { - pub a: bool, - pub b: root::subxt_codegen::types::tests::Child, - } - } - } - .to_string() - ) - } - - #[test] - fn generate_tuple_struct() { - #[allow(unused)] - #[derive(TypeInfo)] - struct Parent(bool, Child); - - #[allow(unused)] - #[derive(TypeInfo)] - struct Child(i32); - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Child(pub i32,); - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Parent(pub bool, pub root::subxt_codegen::types::tests::Child,); - } - } - .to_string() - ) - } - - #[test] - fn derive_compact_as_for_uint_wrapper_structs() { - #[allow(unused)] - #[derive(TypeInfo)] - struct Su8 { - a: u8, - } - #[allow(unused)] - #[derive(TypeInfo)] - struct TSu8(u8); - #[allow(unused)] - #[derive(TypeInfo)] - struct Su16 { - a: u16, - } - #[allow(unused)] - #[derive(TypeInfo)] - struct TSu16(u16); - #[allow(unused)] - #[derive(TypeInfo)] - struct Su32 { - a: u32, - } - #[allow(unused)] - #[derive(TypeInfo)] - struct TSu32(u32); - #[allow(unused)] - #[derive(TypeInfo)] - struct Su64 { - a: u64, - } - #[allow(unused)] - #[derive(TypeInfo)] - struct TSu64(u64); - #[allow(unused)] - #[derive(TypeInfo)] - struct Su128 { - a: u128, - } - #[allow(unused)] - #[derive(TypeInfo)] - struct TSu128(u128); - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct Su128 { pub a: u128, } - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct Su16 { pub a: u16, } - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct Su32 { pub a: u32, } - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct Su64 { pub a: u64, } - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct Su8 { pub a: u8, } - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct TSu128(pub u128,); - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct TSu16(pub u16,); - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct TSu32(pub u32,); - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct TSu64(pub u64,); - - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct TSu8(pub u8,); - } - } - .to_string() - ) - } - - #[test] - fn generate_enum() { - #[allow(unused)] - #[derive(TypeInfo)] - enum E { - A, - B(bool), - C { a: u32 }, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub enum E { - A, - B (bool,), - C { a: u32, }, - } - } - } - .to_string() - ) - } - - #[test] - fn generate_array_field() { - #[allow(unused)] - #[derive(TypeInfo)] - struct S { - a: [u8; 32], - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct S { - pub a: [u8; 32usize], - } - } - } - .to_string() - ) - } - - #[test] - fn option_fields() { - #[allow(unused)] - #[derive(TypeInfo)] - struct S { - a: Option, - b: Option, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct S { - pub a: Option, - pub b: Option, - } - } - } - .to_string() - ) - } - - #[test] - fn box_fields_struct() { - // todo: [AJ] remove hack for Box and make no_std compatible using `alloc::Box` - - use std::boxed::Box; - - #[allow(unused)] - #[derive(TypeInfo)] - struct S { - a: std::boxed::Box, - b: Box, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct S { - pub a: std::boxed::Box, - pub b: std::boxed::Box, - } - } - } - .to_string() - ) - } - - #[test] - fn box_fields_enum() { - use std::boxed::Box; - - #[allow(unused)] - #[derive(TypeInfo)] - enum E { - A(Box), - B { a: Box }, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub enum E { - A(std::boxed::Box,), - B { a: std::boxed::Box, }, - } - } - } - .to_string() - ) - } - - #[test] - fn range_fields() { - #[allow(unused)] - #[derive(TypeInfo)] - struct S { - a: core::ops::Range, - b: core::ops::RangeInclusive, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct S { - pub a: ::core::ops::Range, - pub b: ::core::ops::RangeInclusive, - } - } - } - .to_string() - ) - } - - #[test] - fn generics() { - #[allow(unused)] - #[derive(TypeInfo)] - struct Foo { - a: T, - } - - #[allow(unused)] - #[derive(TypeInfo)] - struct Bar { - b: Foo, - c: Foo, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Bar { - pub b: root::subxt_codegen::types::tests::Foo, - pub c: root::subxt_codegen::types::tests::Foo, - } - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Foo<_0> { - pub a: _0, - } - } - } - .to_string() - ) - } - - #[test] - fn generics_nested() { - #[allow(unused)] - #[derive(TypeInfo)] - struct Foo { - a: T, - b: Option<(T, U)>, - } - - #[allow(unused)] - #[derive(TypeInfo)] - struct Bar { - b: Foo, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::>()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Bar<_0> { - pub b: root::subxt_codegen::types::tests::Foo<_0, u32>, - } - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Foo<_0, _1> { - pub a: _0, - pub b: Option<(_0, _1,)>, - } - } - } - .to_string() - ) - } - - #[test] - fn generate_bitvec() { - use bitvec::{ - order::{ - Lsb0, - Msb0, - }, - vec::BitVec, - }; - - #[allow(unused)] - #[derive(TypeInfo)] - struct S { - lsb: BitVec, - msb: BitVec, - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(::codec::Encode, ::codec::Decode)] - pub struct S { - pub lsb: ::subxt::bitvec::vec::BitVec, - pub msb: ::subxt::bitvec::vec::BitVec, - } - } - } - .to_string() - ) - } - - #[test] - fn generics_with_alias_adds_phantom_data_marker() { - trait Trait { - type Type; - } - - impl Trait for bool { - type Type = u32; - } - - type Foo = ::Type; - type Bar = (::Type, ::Type); - - #[allow(unused)] - #[derive(TypeInfo)] - struct NamedFields { - b: Foo, - } - - #[allow(unused)] - #[derive(TypeInfo)] - struct UnnamedFields(Bar); - - let mut registry = Registry::new(); - registry.register_type(&meta_type::>()); - registry.register_type(&meta_type::>()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - #[derive(Debug, Eq, PartialEq, ::codec::Encode, ::codec::Decode, ::codec::CompactAs)] - pub struct NamedFields<_0> { - pub b: u32, - #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, - } - #[derive(::codec::Encode, ::codec::Decode)] - pub struct UnnamedFields<_0, _1> ( - pub (u32, u32,), - #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)>, - ); - } - } - .to_string() - ) - } - - #[test] - fn modules() { - mod modules { - pub mod a { - #[allow(unused)] - #[derive(scale_info::TypeInfo)] - pub struct Foo {} - - pub mod b { - #[allow(unused)] - #[derive(scale_info::TypeInfo)] - pub struct Bar { - a: super::Foo, - } - } - } - - pub mod c { - #[allow(unused)] - #[derive(scale_info::TypeInfo)] - pub struct Foo { - a: super::a::b::Bar, - } - } - } - - let mut registry = Registry::new(); - registry.register_type(&meta_type::()); - let portable_types: PortableRegistry = registry.into(); - - let type_gen = TypeGenerator::new( - &portable_types, - "root", - Default::default(), - Default::default(), - ); - let types = type_gen.generate_types_mod(); - let tests_mod = get_mod(&types, MOD_PATH).unwrap(); - - assert_eq!( - tests_mod.into_token_stream().to_string(), - quote! { - pub mod tests { - use super::root; - pub mod modules { - use super::root; - pub mod a { - use super::root; - - pub mod b { - use super::root; - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Bar { - pub a: root::subxt_codegen::types::tests::modules::a::Foo, - } - } - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Foo {} - } - - pub mod c { - use super::root; - - #[derive(::codec::Encode, ::codec::Decode)] - pub struct Foo { - pub a: root::subxt_codegen::types::tests::modules::a::b::Bar, - } - } - } - } - } - .to_string() - ) - } -} diff --git a/codegen/src/types/tests.rs b/codegen/src/types/tests.rs new file mode 100644 index 0000000000..c15da43861 --- /dev/null +++ b/codegen/src/types/tests.rs @@ -0,0 +1,796 @@ +// Copyright 2019-2021 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 pretty_assertions::assert_eq; +use scale_info::{ + meta_type, + Registry, + TypeInfo, +}; + +const MOD_PATH: &'static [&'static str] = &["subxt_codegen", "types", "tests"]; + +fn get_mod<'a>(module: &'a Module, path_segs: &[&'static str]) -> Option<&'a Module<'a>> { + let (mod_name, rest) = path_segs.split_first()?; + let mod_ident = Ident::new(mod_name, Span::call_site()); + let module = module.children.get(&mod_ident)?; + if rest.is_empty() { + Some(module) + } else { + get_mod(module, rest) + } +} + +#[test] +fn generate_struct_with_primitives() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: bool, + b: u32, + c: char, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct S { + pub a: bool, + pub b: u32, + pub c: char, + } + } + } + .to_string() + ) +} + +#[test] +fn generate_struct_with_a_struct_field() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Parent { + a: bool, + b: Child, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct Child { + a: i32, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Child { + pub a: i32, + } + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Parent { + pub a: bool, + pub b: root::subxt_codegen::types::tests::Child, + } + } + } + .to_string() + ) +} + +#[test] +fn generate_tuple_struct() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Parent(bool, Child); + + #[allow(unused)] + #[derive(TypeInfo)] + struct Child(i32); + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Child(pub i32,); + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Parent(pub bool, pub root::subxt_codegen::types::tests::Child,); + } + } + .to_string() + ) +} + +#[test] +fn derive_compact_as_for_uint_wrapper_structs() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Su8 { + a: u8, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu8(u8); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su16 { + a: u16, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu16(u16); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su32 { + a: u32, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu32(u32); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su64 { + a: u64, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu64(u64); + #[allow(unused)] + #[derive(TypeInfo)] + struct Su128 { + a: u128, + } + #[allow(unused)] + #[derive(TypeInfo)] + struct TSu128(u128); + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Su128 { pub a: u128, } + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Su16 { pub a: u16, } + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Su32 { pub a: u32, } + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Su64 { pub a: u64, } + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Su8 { pub a: u8, } + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct TSu128(pub u128,); + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct TSu16(pub u16,); + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct TSu32(pub u32,); + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct TSu64(pub u64,); + + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct TSu8(pub u8,); + } + } + .to_string() + ) +} + +#[test] +fn generate_enum() { + #[allow(unused)] + #[derive(TypeInfo)] + enum E { + A, + B(bool), + C { a: u32 }, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub enum E { + A, + B (bool,), + C { a: u32, }, + } + } + } + .to_string() + ) +} + +#[test] +fn generate_array_field() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: [u8; 32], + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct S { + pub a: [u8; 32usize], + } + } + } + .to_string() + ) +} + +#[test] +fn option_fields() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: Option, + b: Option, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct S { + pub a: Option, + pub b: Option, + } + } + } + .to_string() + ) +} + +#[test] +fn box_fields_struct() { + // todo: [AJ] remove hack for Box and make no_std compatible using `alloc::Box` + + use std::boxed::Box; + + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: std::boxed::Box, + b: Box, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct S { + pub a: std::boxed::Box, + pub b: std::boxed::Box, + } + } + } + .to_string() + ) +} + +#[test] +fn box_fields_enum() { + use std::boxed::Box; + + #[allow(unused)] + #[derive(TypeInfo)] + enum E { + A(Box), + B { a: Box }, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub enum E { + A(std::boxed::Box,), + B { a: std::boxed::Box, }, + } + } + } + .to_string() + ) +} + +#[test] +fn range_fields() { + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + a: core::ops::Range, + b: core::ops::RangeInclusive, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct S { + pub a: ::core::ops::Range, + pub b: ::core::ops::RangeInclusive, + } + } + } + .to_string() + ) +} + +#[test] +fn generics() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Foo { + a: T, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct Bar { + b: Foo, + c: Foo, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Bar { + pub b: root::subxt_codegen::types::tests::Foo, + pub c: root::subxt_codegen::types::tests::Foo, + } + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Foo<_0> { + pub a: _0, + } + } + } + .to_string() + ) +} + +#[test] +fn generics_nested() { + #[allow(unused)] + #[derive(TypeInfo)] + struct Foo { + a: T, + b: Option<(T, U)>, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct Bar { + b: Foo, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::>()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Bar<_0> { + pub b: root::subxt_codegen::types::tests::Foo<_0, u32>, + } + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Foo<_0, _1> { + pub a: _0, + pub b: Option<(_0, _1,)>, + } + } + } + .to_string() + ) +} + +#[test] +fn generate_bitvec() { + use bitvec::{ + order::{ + Lsb0, + Msb0, + }, + vec::BitVec, + }; + + #[allow(unused)] + #[derive(TypeInfo)] + struct S { + lsb: BitVec, + msb: BitVec, + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct S { + pub lsb: ::subxt::bitvec::vec::BitVec, + pub msb: ::subxt::bitvec::vec::BitVec, + } + } + } + .to_string() + ) +} + +#[test] +fn generics_with_alias_adds_phantom_data_marker() { + trait Trait { + type Type; + } + + impl Trait for bool { + type Type = u32; + } + + type Foo = ::Type; + type Bar = (::Type, ::Type); + + #[allow(unused)] + #[derive(TypeInfo)] + struct NamedFields { + b: Foo, + } + + #[allow(unused)] + #[derive(TypeInfo)] + struct UnnamedFields(Bar); + + let mut registry = Registry::new(); + registry.register_type(&meta_type::>()); + registry.register_type(&meta_type::>()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + #[derive(::subxt::codec::CompactAs)] + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct NamedFields<_0> { + pub b: u32, + #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, + } + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct UnnamedFields<_0, _1> ( + pub (u32, u32,), + #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)>, + ); + } + } + .to_string() + ) +} + +#[test] +fn modules() { + mod modules { + pub mod a { + #[allow(unused)] + #[derive(scale_info::TypeInfo)] + pub struct Foo {} + + pub mod b { + #[allow(unused)] + #[derive(scale_info::TypeInfo)] + pub struct Bar { + a: super::Foo, + } + } + } + + pub mod c { + #[allow(unused)] + #[derive(scale_info::TypeInfo)] + pub struct Foo { + a: super::a::b::Bar, + } + } + } + + let mut registry = Registry::new(); + registry.register_type(&meta_type::()); + let portable_types: PortableRegistry = registry.into(); + + let type_gen = TypeGenerator::new( + &portable_types, + "root", + Default::default(), + Default::default(), + ); + let types = type_gen.generate_types_mod(); + let tests_mod = get_mod(&types, MOD_PATH).unwrap(); + + assert_eq!( + tests_mod.into_token_stream().to_string(), + quote! { + pub mod tests { + use super::root; + pub mod modules { + use super::root; + pub mod a { + use super::root; + + pub mod b { + use super::root; + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Bar { + pub a: root::subxt_codegen::types::tests::modules::a::Foo, + } + } + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Foo {} + } + + pub mod c { + use super::root; + + #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] + pub struct Foo { + pub a: root::subxt_codegen::types::tests::modules::a::b::Bar, + } + } + } + } + } + .to_string() + ) +} From 4b45985d5cd13aca10ee116b345fd133222354e2 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:13:11 +0200 Subject: [PATCH 182/216] Fully qualified primitive and prelude types --- codegen/src/types/mod.rs | 98 ++++++++++++++++++++++---------------- codegen/src/types/tests.rs | 72 ++++++++++++++-------------- 2 files changed, 94 insertions(+), 76 deletions(-) diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index b69f2dd65b..660bd79396 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -39,6 +39,7 @@ use std::collections::{ HashMap, HashSet, }; +use syn::parse_quote; #[cfg(test)] mod tests; @@ -275,7 +276,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { quote! {} }; let ty = format_ident!("{}", ident); - let path = syn::parse_quote! { #ty #type_params}; + let path = parse_quote! { #ty #type_params}; syn::Type::Path(path) }); @@ -546,9 +547,7 @@ impl quote::ToTokens for TypePath { impl TypePath { pub(crate) fn to_syn_type(&self) -> syn::Type { match self { - TypePath::Parameter(ty_param) => { - syn::Type::Path(syn::parse_quote! { #ty_param }) - } + TypePath::Parameter(ty_param) => syn::Type::Path(parse_quote! { #ty_param }), TypePath::Type(ty) => ty.to_syn_type(), TypePath::Substitute(sub) => sub.to_syn_type(), } @@ -594,75 +593,94 @@ impl TypePathType { let params = &self.params; match self.ty.type_def() { TypeDef::Composite(_) | TypeDef::Variant(_) => { - let mut ty_path = self - .ty - .path() - .segments() - .iter() - .map(|s| syn::PathSegment::from(format_ident!("{}", s))) - .collect::>(); - if !self.ty.path().namespace().is_empty() { - // types without a namespace are assumed to be globally in scope e.g. `Option`s - ty_path - .insert(0, syn::PathSegment::from(self.root_mod_ident.clone())); - } + let path_segments = self.ty.path().segments(); + + let ty_path: syn::TypePath = match path_segments { + [] => panic!("Type has no ident"), + [ident] => { + // paths to prelude types + match ident.as_str() { + "Option" => parse_quote!(::core::option::Option), + "Result" => parse_quote!(::core::result::Result), + "Cow" => parse_quote!(::alloc::borrow::Cow), + "BTreeMap" => parse_quote!(::alloc::collections::BTreeMap), + "BTreeSet" => parse_quote!(::alloc::collections::BTreeSet), + "Range" => parse_quote!(::core::ops::Range), + "RangeInclusive" => parse_quote!(::core::ops::RangeInclusive), + ident => panic!("Unknown prelude type '{}'", ident), + } + } + _ => { + // paths to generated types in the root types module + let mut ty_path = path_segments + .iter() + .map(|s| syn::PathSegment::from(format_ident!("{}", s))) + .collect::>(); + ty_path.insert( + 0, + syn::PathSegment::from(self.root_mod_ident.clone()), + ); + parse_quote!( #ty_path ) + } + }; let params = &self.params; let path = if params.is_empty() { - syn::parse_quote! { #ty_path } + parse_quote! { #ty_path } } else { - syn::parse_quote! { #ty_path< #( #params ),* > } + parse_quote! { #ty_path< #( #params ),* > } }; syn::Type::Path(path) } TypeDef::Sequence(_) => { let type_param = &self.params[0]; - let type_path = syn::parse_quote! { Vec<#type_param> }; + let type_path = parse_quote! { Vec<#type_param> }; syn::Type::Path(type_path) } TypeDef::Array(array) => { let array_type = &self.params[0]; let array_len = array.len() as usize; - let array = syn::parse_quote! { [#array_type; #array_len] }; + let array = parse_quote! { [#array_type; #array_len] }; syn::Type::Array(array) } TypeDef::Tuple(_) => { - let tuple = syn::parse_quote! { (#( # params, )* ) }; + let tuple = parse_quote! { (#( # params, )* ) }; syn::Type::Tuple(tuple) } TypeDef::Primitive(primitive) => { - let primitive = match primitive { - TypeDefPrimitive::Bool => "bool", - TypeDefPrimitive::Char => "char", - TypeDefPrimitive::Str => "String", - TypeDefPrimitive::U8 => "u8", - TypeDefPrimitive::U16 => "u16", - TypeDefPrimitive::U32 => "u32", - TypeDefPrimitive::U64 => "u64", - TypeDefPrimitive::U128 => "u128", + let path = match primitive { + TypeDefPrimitive::Bool => parse_quote!(::core::primitive::bool), + TypeDefPrimitive::Char => parse_quote!(::core::primitive::char), + TypeDefPrimitive::Str => parse_quote!(::alloc::string::String), + TypeDefPrimitive::U8 => parse_quote!(::core::primitive::u8), + TypeDefPrimitive::U16 => parse_quote!(::core::primitive::u16), + TypeDefPrimitive::U32 => parse_quote!(::core::primitive::u32), + TypeDefPrimitive::U64 => parse_quote!(::core::primitive::u64), + TypeDefPrimitive::U128 => parse_quote!(::core::primitive::u128), TypeDefPrimitive::U256 => unimplemented!("not a rust primitive"), - TypeDefPrimitive::I8 => "i8", - TypeDefPrimitive::I16 => "i16", - TypeDefPrimitive::I32 => "i32", - TypeDefPrimitive::I64 => "i64", - TypeDefPrimitive::I128 => "i128", + TypeDefPrimitive::I8 => parse_quote!(::core::primitive::i8), + TypeDefPrimitive::I16 => parse_quote!(::core::primitive::i16), + TypeDefPrimitive::I32 => parse_quote!(::core::primitive::i32), + TypeDefPrimitive::I64 => parse_quote!(::core::primitive::i64), + TypeDefPrimitive::I128 => parse_quote!(::core::primitive::i128), TypeDefPrimitive::I256 => unimplemented!("not a rust primitive"), }; - let ident = format_ident!("{}", primitive); - let path = syn::parse_quote! { #ident }; syn::Type::Path(path) } TypeDef::Compact(_) => { // todo: change the return type of this method to include info that it is compact // and should be annotated with #[compact] for fields let compact_type = &self.params[0]; - syn::Type::Path(syn::parse_quote! ( #compact_type )) + syn::Type::Path(parse_quote! ( #compact_type )) } TypeDef::BitSequence(_) => { let bit_order_type = &self.params[0]; let bit_store_type = &self.params[1]; - let type_path = syn::parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; + let type_path = parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; syn::Type::Path(type_path) } @@ -730,7 +748,7 @@ impl TypePathSubstitute { } else { let substitute_path = &self.path; let params = &self.params; - syn::parse_quote! ( #substitute_path< #( #params ),* > ) + parse_quote! ( #substitute_path< #( #params ),* > ) } } } diff --git a/codegen/src/types/tests.rs b/codegen/src/types/tests.rs index c15da43861..0ef8cc91f9 100644 --- a/codegen/src/types/tests.rs +++ b/codegen/src/types/tests.rs @@ -66,9 +66,9 @@ fn generate_struct_with_primitives() { #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub a: bool, - pub b: u32, - pub c: char, + pub a: ::core::primitive::bool, + pub b: ::core::primitive::u32, + pub c: ::core::primitive::char, } } } @@ -112,12 +112,12 @@ fn generate_struct_with_a_struct_field() { #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct Child { - pub a: i32, + pub a: ::core::primitive::i32, } #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct Parent { - pub a: bool, + pub a: ::core::primitive::bool, pub b: root::subxt_codegen::types::tests::Child, } } @@ -156,10 +156,10 @@ fn generate_tuple_struct() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Child(pub i32,); + pub struct Child(pub ::core::primitive::i32,); #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Parent(pub bool, pub root::subxt_codegen::types::tests::Child,); + pub struct Parent(pub ::core::primitive::bool, pub root::subxt_codegen::types::tests::Child,); } } .to_string() @@ -239,43 +239,43 @@ fn derive_compact_as_for_uint_wrapper_structs() { #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Su128 { pub a: u128, } + pub struct Su128 { pub a: ::core::primitive::u128, } #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Su16 { pub a: u16, } + pub struct Su16 { pub a: ::core::primitive::u16, } #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Su32 { pub a: u32, } + pub struct Su32 { pub a: ::core::primitive::u32, } #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Su64 { pub a: u64, } + pub struct Su64 { pub a: ::core::primitive::u64, } #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct Su8 { pub a: u8, } + pub struct Su8 { pub a: ::core::primitive::u8, } #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct TSu128(pub u128,); + pub struct TSu128(pub ::core::primitive::u128,); #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct TSu16(pub u16,); + pub struct TSu16(pub ::core::primitive::u16,); #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct TSu32(pub u32,); + pub struct TSu32(pub ::core::primitive::u32,); #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct TSu64(pub u64,); + pub struct TSu64(pub ::core::primitive::u64,); #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] - pub struct TSu8(pub u8,); + pub struct TSu8(pub ::core::primitive::u8,); } } .to_string() @@ -313,8 +313,8 @@ fn generate_enum() { #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub enum E { A, - B (bool,), - C { a: u32, }, + B (::core::primitive::bool,), + C { a: ::core::primitive::u32, }, } } } @@ -350,7 +350,7 @@ fn generate_array_field() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub a: [u8; 32usize], + pub a: [::core::primitive::u8; 32usize], } } } @@ -387,8 +387,8 @@ fn option_fields() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub a: Option, - pub b: Option, + pub a: ::core::option::Option<::core::primitive::bool>, + pub b: ::core::option::Option<::core::primitive::u32>, } } } @@ -429,8 +429,8 @@ fn box_fields_struct() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub a: std::boxed::Box, - pub b: std::boxed::Box, + pub a: std::boxed::Box<::core::primitive::bool>, + pub b: std::boxed::Box<::core::primitive::u32>, } } } @@ -469,8 +469,8 @@ fn box_fields_enum() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub enum E { - A(std::boxed::Box,), - B { a: std::boxed::Box, }, + A(std::boxed::Box<::core::primitive::bool>,), + B { a: std::boxed::Box<::core::primitive::u32>, }, } } } @@ -507,8 +507,8 @@ fn range_fields() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub a: ::core::ops::Range, - pub b: ::core::ops::RangeInclusive, + pub a: ::core::ops::Range<::core::primitive::u32>, + pub b: ::core::ops::RangeInclusive<::core::primitive::u32>, } } } @@ -551,8 +551,8 @@ fn generics() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct Bar { - pub b: root::subxt_codegen::types::tests::Foo, - pub c: root::subxt_codegen::types::tests::Foo, + pub b: root::subxt_codegen::types::tests::Foo<::core::primitive::u32>, + pub c: root::subxt_codegen::types::tests::Foo<::core::primitive::u8>, } #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct Foo<_0> { @@ -599,13 +599,13 @@ fn generics_nested() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct Bar<_0> { - pub b: root::subxt_codegen::types::tests::Foo<_0, u32>, + pub b: root::subxt_codegen::types::tests::Foo<_0, ::core::primitive::u32>, } #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct Foo<_0, _1> { pub a: _0, - pub b: Option<(_0, _1,)>, + pub b: ::core::option::Option<(_0, _1,)>, } } } @@ -650,8 +650,8 @@ fn generate_bitvec() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub lsb: ::subxt::bitvec::vec::BitVec, - pub msb: ::subxt::bitvec::vec::BitVec, + pub lsb: ::subxt::bitvec::vec::BitVec, + pub msb: ::subxt::bitvec::vec::BitVec, } } } @@ -704,12 +704,12 @@ fn generics_with_alias_adds_phantom_data_marker() { #[derive(::subxt::codec::CompactAs)] #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct NamedFields<_0> { - pub b: u32, + pub b: ::core::primitive::u32, #[codec(skip)] pub __subxt_unused_type_params: ::core::marker::PhantomData<_0>, } #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct UnnamedFields<_0, _1> ( - pub (u32, u32,), + pub (::core::primitive::u32, ::core::primitive::u32,), #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1)>, ); } From 7caec49aafcd8af25b6699d41ef090509df15c49 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:26:22 +0200 Subject: [PATCH 183/216] Fix up remaining type gen tests --- codegen/src/types/mod.rs | 11 +- codegen/src/types/tests.rs | 10 +- tests/integration/codegen/polkadot.rs | 19646 +++++++++++++++++++++++- 3 files changed, 19653 insertions(+), 14 deletions(-) diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 660bd79396..98607c5061 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -403,10 +403,7 @@ impl<'a> ModuleType<'a> { let ty_toks = |ty_name: &str, ty_path: &TypePath| { if ty_name.contains("Box<") { // todo [AJ] remove this hack once scale-info can represent Box somehow - quote! { std::boxed::Box<#ty_path> } - } else if ty_name.contains("BTreeMap<") { - // todo [AJ] remove this hack and add namespaces or import prelude types - quote! { std::collections::#ty_path } + quote! { ::std::boxed::Box<#ty_path> } } else { quote! { #ty_path } } @@ -602,9 +599,9 @@ impl TypePathType { match ident.as_str() { "Option" => parse_quote!(::core::option::Option), "Result" => parse_quote!(::core::result::Result), - "Cow" => parse_quote!(::alloc::borrow::Cow), - "BTreeMap" => parse_quote!(::alloc::collections::BTreeMap), - "BTreeSet" => parse_quote!(::alloc::collections::BTreeSet), + "Cow" => parse_quote!(::std::borrow::Cow), + "BTreeMap" => parse_quote!(::std::collections::BTreeMap), + "BTreeSet" => parse_quote!(::std::collections::BTreeSet), "Range" => parse_quote!(::core::ops::Range), "RangeInclusive" => parse_quote!(::core::ops::RangeInclusive), ident => panic!("Unknown prelude type '{}'", ident), diff --git a/codegen/src/types/tests.rs b/codegen/src/types/tests.rs index 0ef8cc91f9..c46403e6fa 100644 --- a/codegen/src/types/tests.rs +++ b/codegen/src/types/tests.rs @@ -398,8 +398,6 @@ fn option_fields() { #[test] fn box_fields_struct() { - // todo: [AJ] remove hack for Box and make no_std compatible using `alloc::Box` - use std::boxed::Box; #[allow(unused)] @@ -429,8 +427,8 @@ fn box_fields_struct() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub struct S { - pub a: std::boxed::Box<::core::primitive::bool>, - pub b: std::boxed::Box<::core::primitive::u32>, + pub a: ::std::boxed::Box<::core::primitive::bool>, + pub b: ::std::boxed::Box<::core::primitive::u32>, } } } @@ -469,8 +467,8 @@ fn box_fields_enum() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode)] pub enum E { - A(std::boxed::Box<::core::primitive::bool>,), - B { a: std::boxed::Box<::core::primitive::u32>, }, + A(::std::boxed::Box<::core::primitive::bool>,), + B { a: ::std::boxed::Box<::core::primitive::u32>, }, } } } diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index 8b13789179..ed9813482a 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -1 +1,19645 @@ - +#[allow(dead_code, unused_imports, non_camel_case_types)] +pub mod api { + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + #[codec(index = 0)] + System(system::Event), + #[codec(index = 1)] + Utility(utility::Event), + #[codec(index = 5)] + Indices(indices::Event), + #[codec(index = 6)] + Balances(balances::Event), + #[codec(index = 8)] + ElectionProviderMultiPhase(election_provider_multi_phase::Event), + #[codec(index = 9)] + Staking(staking::Event), + #[codec(index = 10)] + Session(session::Event), + #[codec(index = 11)] + Democracy(democracy::Event), + #[codec(index = 12)] + Council(council::Event), + #[codec(index = 13)] + TechnicalCommittee(technical_committee::Event), + #[codec(index = 14)] + Elections(elections::Event), + #[codec(index = 15)] + TechnicalMembership(technical_membership::Event), + #[codec(index = 16)] + Grandpa(grandpa::Event), + #[codec(index = 17)] + Treasury(treasury::Event), + #[codec(index = 18)] + Contracts(contracts::Event), + #[codec(index = 19)] + Sudo(sudo::Event), + #[codec(index = 20)] + ImOnline(im_online::Event), + #[codec(index = 22)] + Offences(offences::Event), + #[codec(index = 25)] + Identity(identity::Event), + #[codec(index = 26)] + Society(society::Event), + #[codec(index = 27)] + Recovery(recovery::Event), + #[codec(index = 28)] + Vesting(vesting::Event), + #[codec(index = 29)] + Scheduler(scheduler::Event), + #[codec(index = 30)] + Proxy(proxy::Event), + #[codec(index = 31)] + Multisig(multisig::Event), + #[codec(index = 32)] + Bounties(bounties::Event), + #[codec(index = 33)] + Tips(tips::Event), + #[codec(index = 34)] + Assets(assets::Event), + #[codec(index = 36)] + Lottery(lottery::Event), + #[codec(index = 37)] + Gilt(gilt::Event), + #[codec(index = 38)] + Uniques(uniques::Event), + #[codec(index = 39)] + TransactionStorage(transaction_storage::Event), + #[codec(index = 40)] + BagsList(bags_list::Event), + } + pub mod system { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct FillBlock { + pub ratio: ::subxt::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)] + pub struct Remark { + pub remark: 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)] + 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)] + pub struct SetCode { + pub code: 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)] + pub struct SetCodeWithoutChecks { + pub code: 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)] + pub struct SetChangesTrieConfig { + pub changes_trie_config: ::core::option::Option< + runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, + >, + } + impl ::subxt::Call for SetChangesTrieConfig { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "set_changes_trie_config"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetStorage { + pub items: Vec<(Vec<::core::primitive::u8>, 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)] + pub struct KillStorage { + pub keys: Vec>, + } + impl ::subxt::Call for KillStorage { + const PALLET: &'static str = "System"; + const FUNCTION: &'static str = "kill_storage"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct KillPrefix { + pub prefix: 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)] + pub struct RemarkWithEvent { + pub remark: 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn fill_block( + &self, + ratio: ::subxt::sp_arithmetic::per_things::Perbill, + ) -> ::subxt::SubmittableExtrinsic { + let call = FillBlock { ratio }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remark( + &self, + remark: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Remark { remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_heap_pages( + &self, + pages: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetHeapPages { pages }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_code( + &self, + code: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetCode { code }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_code_without_checks( + &self, + code: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetCodeWithoutChecks { code }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_changes_trie_config( + &self, + changes_trie_config: ::core::option::Option< + runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetChangesTrieConfig { + changes_trie_config, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_storage( + &self, + items: Vec<(Vec<::core::primitive::u8>, Vec<::core::primitive::u8>)>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetStorage { items }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_storage( + &self, + keys: Vec>, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillStorage { keys }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_prefix( + &self, + prefix: Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillPrefix { prefix, subkeys }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remark_with_event( + &self, + remark: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemarkWithEvent { remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::frame_system::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ExtrinsicSuccess( + pub 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)] + pub struct ExtrinsicFailed( + pub runtime_types::sp_runtime::DispatchError, + pub 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)] + 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)] + pub struct NewAccount(pub ::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)] + pub struct KilledAccount(pub ::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)] + pub struct Remarked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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(pub ::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(pub ::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(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ExtrinsicData { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExtrinsicData"; + type Value = 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< + ::subxt::sp_core::H256, + >; + 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 = Vec< + runtime_types::frame_system::EventRecord< + runtime_types::node_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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for EventTopics { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "EventTopics"; + type Value = Vec<(::core::primitive::u32, ::core::primitive::u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct LastRuntimeUpgrade; + impl ::subxt::StorageEntry for LastRuntimeUpgrade { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "LastRuntimeUpgrade"; + type Value = runtime_types::frame_system::LastRuntimeUpgradeInfo; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UpgradedToU32RefCount; + impl ::subxt::StorageEntry for UpgradedToU32RefCount { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "UpgradedToU32RefCount"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct UpgradedToTripleRefCount; + impl ::subxt::StorageEntry for UpgradedToTripleRefCount { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "UpgradedToTripleRefCount"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ExecutionPhase; + impl ::subxt::StorageEntry for ExecutionPhase { + const PALLET: &'static str = "System"; + const STORAGE: &'static str = "ExecutionPhase"; + type Value = runtime_types::frame_system::Phase; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn account( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::AccountData< + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Account(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn account_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn extrinsic_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = ExtrinsicCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn block_weight( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u64, + >, + ::subxt::Error, + > { + let entry = BlockWeight; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn all_extrinsics_len( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = AllExtrinsicsLen; + self.client.storage().fetch(&entry, hash).await + } + pub async fn block_hash( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = BlockHash(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn block_hash_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, BlockHash>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn extrinsic_data( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = ExtrinsicData(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn extrinsic_data_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ExtrinsicData>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn number( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = Number; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn parent_hash( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = ParentHash; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn digest( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_runtime::generic::digest::Digest< + ::subxt::sp_core::H256, + >, + ::subxt::Error, + > { + let entry = Digest; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn events( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::frame_system::EventRecord< + runtime_types::node_runtime::Event, + ::subxt::sp_core::H256, + >, + >, + ::subxt::Error, + > { + let entry = Events; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn event_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = EventCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn event_topics( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::core::primitive::u32, ::core::primitive::u32)>, + ::subxt::Error, + > { + let entry = EventTopics(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn event_topics_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, EventTopics>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn last_runtime_upgrade( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_system::LastRuntimeUpgradeInfo, + >, + ::subxt::Error, + > { + let entry = LastRuntimeUpgrade; + self.client.storage().fetch(&entry, hash).await + } + pub async fn upgraded_to_u32_ref_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = UpgradedToU32RefCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn upgraded_to_triple_ref_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = UpgradedToTripleRefCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn execution_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ExecutionPhase; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod utility { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Batch { + pub calls: Vec, + } + impl ::subxt::Call for Batch { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsDerivative { + pub index: ::core::primitive::u16, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for AsDerivative { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "as_derivative"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BatchAll { + pub calls: Vec, + } + impl ::subxt::Call for BatchAll { + const PALLET: &'static str = "Utility"; + const FUNCTION: &'static str = "batch_all"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn batch( + &self, + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = Batch { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn as_derivative( + &self, + index: ::core::primitive::u16, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsDerivative { index, call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn batch_all( + &self, + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = BatchAll { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_utility::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BatchInterrupted( + pub ::core::primitive::u32, + pub 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)] + 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)] + pub struct ItemCompleted {} + impl ::subxt::Event for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; + } + } + } + pub mod babe { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportEquivocation { + pub 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, + >, + 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)] + pub struct ReportEquivocationUnsigned { + pub 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, + >, + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + 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, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocation { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocationUnsigned { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn plan_config_change( + &self, + config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, + ) -> ::subxt::SubmittableExtrinsic { + let call = PlanConfigChange { config }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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(pub ::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 } + } + pub async fn epoch_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + { + let entry = EpochIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn authorities (& self , 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 :: Error >{ + let entry = Authorities; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn genesis_slot( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_consensus_slots::Slot, + ::subxt::Error, + > { + let entry = GenesisSlot; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_slot( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_consensus_slots::Slot, + ::subxt::Error, + > { + let entry = CurrentSlot; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn randomness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + [::core::primitive::u8; 32usize], + ::subxt::Error, + > { + let entry = Randomness; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn pending_epoch_config_change( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + >, + ::subxt::Error, + > { + let entry = PendingEpochConfigChange; + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_randomness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + [::core::primitive::u8; 32usize], + ::subxt::Error, + > { + let entry = NextRandomness; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn next_authorities (& self , 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 :: Error >{ + let entry = NextAuthorities; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn segment_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = SegmentIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn under_construction( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >, + ::subxt::Error, + > { + let entry = UnderConstruction(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn under_construction_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, UnderConstruction>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn initialized( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + ::core::option::Option<[::core::primitive::u8; 32usize]>, + >, + ::subxt::Error, + > { + let entry = Initialized; + self.client.storage().fetch(&entry, hash).await + } + pub async fn author_vrf_randomness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<[::core::primitive::u8; 32usize]>, + ::subxt::Error, + > { + let entry = AuthorVrfRandomness; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn epoch_start( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + (::core::primitive::u32, ::core::primitive::u32), + ::subxt::Error, + > { + let entry = EpochStart; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lateness( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = Lateness; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn epoch_config( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::Error, + > { + let entry = EpochConfig; + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_epoch_config( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::Error, + > { + let entry = NextEpochConfig; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod timestamp { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set( + &self, + now: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Set { now }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub mod storage { + use super::runtime_types; + pub struct Now; + impl ::subxt::StorageEntry for Now { + const PALLET: &'static str = "Timestamp"; + const STORAGE: &'static str = "Now"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DidUpdate; + impl ::subxt::StorageEntry for DidUpdate { + const PALLET: &'static str = "Timestamp"; + const STORAGE: &'static str = "DidUpdate"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn now( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + { + let entry = Now; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn did_update( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = DidUpdate; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod authorship { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetUncles { + pub new_uncles: 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_uncles( + &self, + new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetUncles { new_uncles }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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 = 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 } + } + pub async fn uncles( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_authorship::UncleEntryItem< + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Uncles; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn author( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Author; + self.client.storage().fetch(&entry, hash).await + } + pub async fn did_set_uncles( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = DidSetUncles; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod indices { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + 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)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn claim( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Claim { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { new, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn free( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Free { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_transfer( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + freeze: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceTransfer { new, index, freeze }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Freeze { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_indices::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct IndexAssigned( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct IndexFreed(pub ::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)] + pub struct IndexFrozen( + pub ::core::primitive::u32, + pub ::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(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Accounts { + const PALLET: &'static str = "Indices"; + const STORAGE: &'static str = "Accounts"; + type Value = ( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn accounts( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + )>, + ::subxt::Error, + > { + let entry = Accounts(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn accounts_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Accounts>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod balances { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transfer { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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)] + pub struct SetBalance { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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)] + pub struct ForceTransfer { + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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)] + pub struct TransferKeepAlive { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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)] + pub struct TransferAll { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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)] + pub struct ForceUnreserve { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn transfer( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { dest, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_balance( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + new_free: ::core::primitive::u128, + new_reserved: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetBalance { + who, + new_free, + new_reserved, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_transfer( + &self, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceTransfer { + source, + dest, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_keep_alive( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferKeepAlive { dest, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_all( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferAll { dest, keep_alive }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_unreserve( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceUnreserve { who, amount }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_balances::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Endowed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct DustLost( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct Transfer( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct BalanceSet( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::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)] + pub struct Reserved( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct Unreserved( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct ReserveRepatriated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub 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)] + pub struct Deposit( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct Withdraw( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct Slashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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(pub ::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(pub ::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(pub ::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 } + } + pub async fn total_issuance( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + { + let entry = TotalIssuance; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn account( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + ::subxt::Error, + > { + let entry = Account(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn account_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , 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 :: Error >{ + let entry = Locks(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn locks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn reserves( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::Error, + > { + let entry = Reserves(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn reserves_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Reserves>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_balances::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod transaction_payment { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct NextFeeMultiplier; + impl ::subxt::StorageEntry for NextFeeMultiplier { + const PALLET: &'static str = "TransactionPayment"; + const STORAGE: &'static str = "NextFeeMultiplier"; + type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "TransactionPayment"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_transaction_payment::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn next_fee_multiplier( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::fixed_point::FixedU128, + ::subxt::Error, + > { + let entry = NextFeeMultiplier; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_transaction_payment::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod election_provider_multi_phase { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SubmitUnsigned { pub raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > , 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)] + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: + ::core::option::Option<[::core::primitive::u128; 3usize]>, + } + 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)] + pub struct SetEmergencyElectionResult { + pub supports: 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)] + pub struct Submit { + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::node_runtime::NposSolution16, + >, + pub num_signed_submissions: ::core::primitive::u32, + } + impl ::subxt::Call for Submit { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn submit_unsigned( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, + witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + ) -> ::subxt::SubmittableExtrinsic { + let call = SubmitUnsigned { + raw_solution, + witness, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: ::core::option::Option< + [::core::primitive::u128; 3usize], + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetMinimumUntrustedScore { maybe_next_score }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_emergency_election_result( + &self, + supports: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SetEmergencyElectionResult { supports }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, + num_signed_submissions: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Submit { + raw_solution, + num_signed_submissions, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + 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)] + pub struct SolutionStored( + pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub ::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)] + pub struct ElectionFinalized( + pub ::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)] + pub struct Rewarded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct Slashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct SignedPhaseStarted(pub ::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)] + pub struct UnsignedPhaseStarted(pub ::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< + ::subxt::sp_core::crypto::AccountId32, + >; + 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 < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionsMap(pub ::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 :: node_runtime :: NposSolution16 > ; + 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 = [::core::primitive::u128; 3usize]; + 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 round( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = Round; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >, + ::subxt::Error, + > { + let entry = CurrentPhase; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn queued_solution (& self , 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 :: Error >{ + let entry = QueuedSolution; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: Error >{ + let entry = Snapshot; + self.client.storage().fetch(&entry, hash).await + } + pub async fn desired_targets( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = DesiredTargets; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: Error >{ + let entry = SnapshotMetadata; + self.client.storage().fetch(&entry, hash).await + } + pub async fn signed_submission_next_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = SignedSubmissionNextIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > , :: subxt :: Error >{ + let entry = SignedSubmissionIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submissions_map (& self , _0 : :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: node_runtime :: NposSolution16 > , :: subxt :: Error >{ + let entry = SignedSubmissionsMap(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn signed_submissions_map_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SignedSubmissionsMap>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn minimum_untrusted_score( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<[::core::primitive::u128; 3usize]>, + ::subxt::Error, + > { + let entry = MinimumUntrustedScore; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod staking { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bond { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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)] + 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)] + 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)] + 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)] + 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)] + pub struct Nominate { + pub targets: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + } + impl ::subxt::Call for Nominate { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "nominate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub struct SetController { + pub controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for SetController { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_controller"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + 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)] + 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)] + 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)] + pub struct SetInvulnerables { + pub invulnerables: 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)] + 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)] + 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)] + pub struct CancelDeferredSlash { + pub era: ::core::primitive::u32, + pub slash_indices: 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)] + 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)] + 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)] + 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)] + 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)] + pub struct Kick { + pub who: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + } + impl ::subxt::Call for Kick { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "kick"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetStakingLimits { + pub min_nominator_bond: ::core::primitive::u128, + pub min_validator_bond: ::core::primitive::u128, + pub max_nominator_count: ::core::option::Option<::core::primitive::u32>, + pub max_validator_count: ::core::option::Option<::core::primitive::u32>, + pub threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + } + impl ::subxt::Call for SetStakingLimits { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "set_staking_limits"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ChillOther { + pub controller: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ChillOther { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "chill_other"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn bond( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Bond { + controller, + value, + payee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn bond_extra( + &self, + max_additional: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = BondExtra { max_additional }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unbond( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unbond { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn withdraw_unbonded( + &self, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = WithdrawUnbonded { num_slashing_spans }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn validate( + &self, + prefs: runtime_types::pallet_staking::ValidatorPrefs, + ) -> ::subxt::SubmittableExtrinsic { + let call = Validate { prefs }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn nominate( + &self, + targets: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Nominate { targets }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn chill(&self) -> ::subxt::SubmittableExtrinsic { + let call = Chill {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_payee( + &self, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetPayee { payee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_controller( + &self, + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetController { controller }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_validator_count( + &self, + new: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetValidatorCount { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn increase_validator_count( + &self, + additional: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = IncreaseValidatorCount { additional }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn scale_validator_count( + &self, + factor: runtime_types::sp_arithmetic::per_things::Percent, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ScaleValidatorCount { factor }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_no_eras( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNoEras {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_new_era( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNewEra {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_invulnerables( + &self, + invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetInvulnerables { invulnerables }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_unstake( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceUnstake { + stash, + num_slashing_spans, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_new_era_always( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceNewEraAlways {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_deferred_slash( + &self, + era: ::core::primitive::u32, + slash_indices: Vec<::core::primitive::u32>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = CancelDeferredSlash { era, slash_indices }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn payout_stakers( + &self, + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = PayoutStakers { + validator_stash, + era, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rebond( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Rebond { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_history_depth( + &self, + new_history_depth: ::core::primitive::u32, + era_items_deleted: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetHistoryDepth { + new_history_depth, + era_items_deleted, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reap_stash( + &self, + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReapStash { + stash, + num_slashing_spans, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kick( + &self, + who: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Kick { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_staking_limits( + &self, + min_nominator_bond: ::core::primitive::u128, + min_validator_bond: ::core::primitive::u128, + max_nominator_count: ::core::option::Option<::core::primitive::u32>, + max_validator_count: ::core::option::Option<::core::primitive::u32>, + threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetStakingLimits { + min_nominator_bond, + min_validator_bond, + max_nominator_count, + max_validator_count, + threshold, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn chill_other( + &self, + controller: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ChillOther { controller }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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 = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Bonded(pub ::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 Ledger(pub ::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(pub ::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(pub ::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(pub ::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< + ::subxt::sp_core::crypto::AccountId32, + >; + 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(pub ::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( + ::core::primitive::u32, + ::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( + ::core::primitive::u32, + ::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( + ::core::primitive::u32, + ::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(pub ::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(pub ::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(pub ::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 = ::subxt::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(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for UnappliedSlashes { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "UnappliedSlashes"; + type Value = 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 = Vec<(::core::primitive::u32, ::core::primitive::u32)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ValidatorSlashInEra( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ValidatorSlashInEra { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ValidatorSlashInEra"; + type Value = ( + ::subxt::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( + ::core::primitive::u32, + ::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(pub ::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( + ::subxt::sp_core::crypto::AccountId32, + ::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, + ::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 = Vec<(::core::primitive::u32, ::core::primitive::bool)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_staking::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ChillThreshold; + impl ::subxt::StorageEntry for ChillThreshold { + const PALLET: &'static str = "Staking"; + const STORAGE: &'static str = "ChillThreshold"; + type Value = runtime_types::sp_arithmetic::per_things::Percent; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn history_depth( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = HistoryDepth; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validator_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ValidatorCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn minimum_validator_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = MinimumValidatorCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn invulnerables( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Invulnerables; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bonded( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Bonded(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bonded_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Bonded>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn min_nominator_bond( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + { + let entry = MinNominatorBond; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn min_validator_bond( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + { + let entry = MinValidatorBond; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn ledger( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::StakingLedger< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Ledger(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn ledger_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Ledger>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn payee( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::Error, + > { + let entry = Payee(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn payee_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Payee>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn validators( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::ValidatorPrefs, + ::subxt::Error, + > { + let entry = Validators(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validators_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Validators>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn counter_for_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = CounterForValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_validators_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = MaxValidatorsCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominators( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::Nominations< + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Nominators(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominators_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Nominators>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn counter_for_nominators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = CounterForNominators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_nominators_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = MaxNominatorsCount; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = CurrentEra; + self.client.storage().fetch(&entry, hash).await + } + pub async fn active_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ActiveEra; + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_start_session_index( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = ErasStartSessionIndex(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_start_session_index_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStartSessionIndex>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_stakers( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ::subxt::Error, + > { + let entry = ErasStakers(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_stakers_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStakers>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_stakers_clipped( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Exposure< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ::subxt::Error, + > { + let entry = ErasStakersClipped(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_stakers_clipped_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasStakersClipped>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_validator_prefs( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::ValidatorPrefs, + ::subxt::Error, + > { + let entry = ErasValidatorPrefs(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_validator_prefs_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorPrefs>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_validator_reward( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::Error, + > { + let entry = ErasValidatorReward(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn eras_validator_reward_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasValidatorReward>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_reward_points( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::sp_core::crypto::AccountId32, + >, + ::subxt::Error, + > { + let entry = ErasRewardPoints(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_reward_points_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasRewardPoints>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn eras_total_stake( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + { + let entry = ErasTotalStake(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn eras_total_stake_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ErasTotalStake>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn force_era( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Forcing, + ::subxt::Error, + > { + let entry = ForceEra; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn slash_reward_fraction( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::sp_arithmetic::per_things::Perbill, + ::subxt::Error, + > { + let entry = SlashRewardFraction; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn canceled_slash_payout( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + { + let entry = CanceledSlashPayout; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn unapplied_slashes( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = UnappliedSlashes(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn unapplied_slashes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, UnappliedSlashes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn bonded_eras( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::core::primitive::u32, ::core::primitive::u32)>, + ::subxt::Error, + > { + let entry = BondedEras; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn validator_slash_in_era( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + )>, + ::subxt::Error, + > { + let entry = ValidatorSlashInEra(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn validator_slash_in_era_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ValidatorSlashInEra>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn nominator_slash_in_era( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::Error, + > { + let entry = NominatorSlashInEra(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn nominator_slash_in_era_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, NominatorSlashInEra>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn slashing_spans( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + ::subxt::Error, + > { + let entry = SlashingSpans(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn slashing_spans_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SlashingSpans>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn span_slash( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >, + ::subxt::Error, + > { + let entry = SpanSlash(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn span_slash_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SpanSlash>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn earliest_unapplied_slash( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = EarliestUnappliedSlash; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_planned_session( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = CurrentPlannedSession; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn offending_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::core::primitive::u32, ::core::primitive::bool)>, + ::subxt::Error, + > { + let entry = OffendingValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_staking::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn chill_threshold( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ::subxt::Error, + > { + let entry = ChillThreshold; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod session { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetKeys { + pub keys: runtime_types::node_runtime::SessionKeys, + pub proof: 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_keys( + &self, + keys: runtime_types::node_runtime::SessionKeys, + proof: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetKeys { keys, proof }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn purge_keys(&self) -> ::subxt::SubmittableExtrinsic { + let call = PurgeKeys {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_session::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewSession(pub ::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 = 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 = Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::node_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 = Vec<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NextKeys(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for NextKeys { + const PALLET: &'static str = "Session"; + const STORAGE: &'static str = "NextKeys"; + type Value = runtime_types::node_runtime::SessionKeys; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct KeyOwner( + runtime_types::sp_core::crypto::KeyTypeId, + Vec<::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, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Validators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = CurrentIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queued_changed( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = QueuedChanged; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queued_keys( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::node_runtime::SessionKeys, + )>, + ::subxt::Error, + > { + let entry = QueuedKeys; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn disabled_validators( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = DisabledValidators; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_keys( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = NextKeys(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_keys_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, NextKeys>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn key_owner( + &self, + _0: runtime_types::sp_core::crypto::KeyTypeId, + _1: Vec<::core::primitive::u8>, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = KeyOwner(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn key_owner_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, KeyOwner>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod democracy { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + pub struct NotePreimage { + pub encoded_proposal: 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)] + pub struct NotePreimageOperational { + pub encoded_proposal: 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)] + pub struct NoteImminentPreimage { + pub encoded_proposal: 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)] + pub struct NoteImminentPreimageOperational { + pub encoded_proposal: 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + proposal_hash, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn second( + &self, + proposal: ::core::primitive::u32, + seconds_upper_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Second { + proposal, + seconds_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { ref_index, vote }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn emergency_cancel( + &self, + ref_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = EmergencyCancel { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = ExternalPropose { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose_majority( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExternalProposeMajority { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn external_propose_default( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExternalProposeDefault { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn fast_track( + &self, + proposal_hash: ::subxt::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FastTrack { + proposal_hash, + voting_period, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn veto_external( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = VetoExternal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_referendum( + &self, + ref_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelReferendum { ref_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_queued( + &self, + which: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelQueued { which }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn delegate( + &self, + to: ::subxt::sp_core::crypto::AccountId32, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Delegate { + to, + conviction, + balance, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn undelegate(&self) -> ::subxt::SubmittableExtrinsic { + let call = Undelegate {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_public_proposals( + &self, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ClearPublicProposals {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_preimage( + &self, + encoded_proposal: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = NotePreimage { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_preimage_operational( + &self, + encoded_proposal: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = NotePreimageOperational { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_imminent_preimage( + &self, + encoded_proposal: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = NoteImminentPreimage { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_imminent_preimage_operational( + &self, + encoded_proposal: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = NoteImminentPreimageOperational { encoded_proposal }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reap_preimage( + &self, + proposal_hash: ::subxt::sp_core::H256, + proposal_len_upper_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReapPreimage { + proposal_hash, + proposal_len_upper_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unlock( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unlock { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_vote( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveVote { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_other_vote( + &self, + target: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveOtherVote { target, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn enact_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = EnactProposal { + proposal_hash, + index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn blacklist( + &self, + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Blacklist { + proposal_hash, + maybe_ref_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_proposal( + &self, + prop_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelProposal { prop_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_democracy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposed(pub ::core::primitive::u32, pub ::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)] + pub struct Tabled( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub 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)] + 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)] + pub struct Started( + pub ::core::primitive::u32, + pub 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)] + pub struct Passed(pub ::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)] + pub struct NotPassed(pub ::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)] + pub struct Cancelled(pub ::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)] + pub struct Executed( + pub ::core::primitive::u32, + pub ::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)] + pub struct Delegated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct Undelegated(pub ::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)] + pub struct Vetoed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct PreimageNoted( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct PreimageUsed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct PreimageInvalid( + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct PreimageMissing( + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct PreimageReaped( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::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)] + pub struct Blacklisted(pub ::subxt::sp_core::H256); + impl ::subxt::Event for Blacklisted { + const PALLET: &'static str = "Democracy"; + const EVENT: &'static str = "Blacklisted"; + } + } + 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 = Vec<( + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DepositOf(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for DepositOf { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "DepositOf"; + type Value = ( + 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(pub ::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(pub ::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(pub ::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 Locks(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Locks { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Locks"; + type Value = ::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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Blacklist { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Blacklist"; + type Value = ( + ::core::primitive::u32, + 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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Cancellations { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "Cancellations"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Democracy"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_democracy::Releases; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn public_prop_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = PublicPropCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn public_props( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<( + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + )>, + ::subxt::Error, + > { + let entry = PublicProps; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn deposit_of( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + Vec<::subxt::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + )>, + ::subxt::Error, + > { + let entry = DepositOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn deposit_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, DepositOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn preimages( + &self, + _0: ::subxt::sp_core::H256, + 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::Error, + > { + let entry = Preimages(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn preimages_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Preimages>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn referendum_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ReferendumCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lowest_unbaked( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = LowestUnbaked; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn referendum_info_of( + &self, + _0: ::core::primitive::u32, + 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::Error, + > { + let entry = ReferendumInfoOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn referendum_info_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ReferendumInfoOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn voting_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::Error, + > { + let entry = VotingOf(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, VotingOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn locks( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = Locks(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn locks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn last_tabled_was_external( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = LastTabledWasExternal; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn next_external( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + )>, + ::subxt::Error, + > { + let entry = NextExternal; + self.client.storage().fetch(&entry, hash).await + } + pub async fn blacklist( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + Vec<::subxt::sp_core::crypto::AccountId32>, + )>, + ::subxt::Error, + > { + let entry = Blacklist(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn blacklist_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Blacklist>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn cancellations( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = Cancellations(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn cancellations_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Cancellations>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod council { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMembers { + pub new_members: 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)] + pub struct Execute { + pub proposal: runtime_types::node_runtime::Call, + #[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)] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: runtime_types::node_runtime::Call, + #[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)] + 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)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_members( + &self, + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMembers { + new_members, + prime, + old_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn execute( + &self, + proposal: runtime_types::node_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Execute { + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::node_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + threshold, + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { + proposal, + index, + approve, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = DisapproveProposal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct Voted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::bool, + pub ::core::primitive::u32, + pub ::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)] + pub struct Approved(pub ::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)] + pub struct Disapproved(pub ::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)] + pub struct Executed( + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct MemberExecuted( + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct Closed( + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + pub ::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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for ProposalOf { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "ProposalOf"; + type Value = runtime_types::node_runtime::Call; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Voting(pub ::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 = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "Council"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn proposals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >, + ::subxt::Error, + > { + let entry = Proposals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposal_of( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ProposalOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposal_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ProposalOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ::subxt::Error, + > { + let entry = Voting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod technical_committee { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMembers { + pub new_members: 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)] + pub struct Execute { + pub proposal: runtime_types::node_runtime::Call, + #[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)] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: runtime_types::node_runtime::Call, + #[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)] + 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)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn set_members( + &self, + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMembers { + new_members, + prime, + old_count, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn execute( + &self, + proposal: runtime_types::node_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Execute { + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::node_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Propose { + threshold, + proposal, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + proposal: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { + proposal, + index, + approve, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic { + let call = Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = DisapproveProposal { proposal_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct Voted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::H256, + pub ::core::primitive::bool, + pub ::core::primitive::u32, + pub ::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)] + pub struct Approved(pub ::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)] + pub struct Disapproved(pub ::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)] + pub struct Executed( + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct MemberExecuted( + pub ::subxt::sp_core::H256, + pub ::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)] + pub struct Closed( + pub ::subxt::sp_core::H256, + pub ::core::primitive::u32, + pub ::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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for ProposalOf { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "ProposalOf"; + type Value = runtime_types::node_runtime::Call; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct Voting(pub ::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 = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Prime; + impl ::subxt::StorageEntry for Prime { + const PALLET: &'static str = "TechnicalCommittee"; + const STORAGE: &'static str = "Prime"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn proposals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::H256, + >, + ::subxt::Error, + > { + let entry = Proposals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposal_of( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ProposalOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposal_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ProposalOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_collective::Votes< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ::subxt::Error, + > { + let entry = Voting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod elections { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vote { + pub votes: Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Elections"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveVoter {} + impl ::subxt::Call for RemoveVoter { + const PALLET: &'static str = "Elections"; + const FUNCTION: &'static str = "remove_voter"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SubmitCandidacy { + #[codec(compact)] + pub candidate_count: ::core::primitive::u32, + } + impl ::subxt::Call for SubmitCandidacy { + const PALLET: &'static str = "Elections"; + const FUNCTION: &'static str = "submit_candidacy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RenounceCandidacy { + pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + } + impl ::subxt::Call for RenounceCandidacy { + const PALLET: &'static str = "Elections"; + const FUNCTION: &'static str = "renounce_candidacy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveMember { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub has_replacement: ::core::primitive::bool, + } + impl ::subxt::Call for RemoveMember { + const PALLET: &'static str = "Elections"; + const FUNCTION: &'static str = "remove_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CleanDefunctVoters { + pub num_voters: ::core::primitive::u32, + pub num_defunct: ::core::primitive::u32, + } + impl ::subxt::Call for CleanDefunctVoters { + const PALLET: &'static str = "Elections"; + const FUNCTION: &'static str = "clean_defunct_voters"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn vote( + &self, + votes: Vec<::subxt::sp_core::crypto::AccountId32>, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { votes, value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_voter( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveVoter {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit_candidacy( + &self, + candidate_count: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SubmitCandidacy { candidate_count }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn renounce_candidacy( + &self, + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + ) -> ::subxt::SubmittableExtrinsic { + let call = RenounceCandidacy { renouncing }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_member( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + has_replacement: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveMember { + who, + has_replacement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clean_defunct_voters( + &self, + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = CleanDefunctVoters { + num_voters, + num_defunct, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewTerm( + pub Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ); + impl ::subxt::Event for NewTerm { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "NewTerm"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct EmptyTerm {} + impl ::subxt::Event for EmptyTerm { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "EmptyTerm"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ElectionError {} + impl ::subxt::Event for ElectionError { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "ElectionError"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MemberKicked(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for MemberKicked { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "MemberKicked"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Renounced(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Renounced { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "Renounced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CandidateSlashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for CandidateSlashed { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "CandidateSlashed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SeatHolderSlashed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for SeatHolderSlashed { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "SeatHolderSlashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "Elections"; + const STORAGE: &'static str = "Members"; + type Value = 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 = "Elections"; + const STORAGE: &'static str = "RunnersUp"; + type Value = 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 = "Elections"; + const STORAGE: &'static str = "Candidates"; + type Value = 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 = "Elections"; + const STORAGE: &'static str = "ElectionRounds"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Voting(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Voting { + const PALLET: &'static str = "Elections"; + const STORAGE: &'static str = "Voting"; + type Value = runtime_types::pallet_elections_phragmen::Voter< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn runners_up( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = RunnersUp; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn candidates( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::Error, + > { + let entry = Candidates; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn election_rounds( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ElectionRounds; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_elections_phragmen::Voter< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ::subxt::Error, + > { + let entry = Voting(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn voting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + } + } + } + pub mod technical_membership { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + 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)] + pub struct ResetMembers { + pub members: 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)] + 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)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn add_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddMember { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveMember { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn swap_member( + &self, + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SwapMember { remove, add }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reset_members( + &self, + members: Vec<::subxt::sp_core::crypto::AccountId32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = ResetMembers { members }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn change_key( + &self, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ChangeKey { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_prime( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetPrime { who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_prime( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearPrime {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_membership::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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 = 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 } + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn prime( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Prime; + self.client.storage().fetch(&entry, hash).await + } + } + } + } + pub mod grandpa { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportEquivocation { + pub equivocation_proof: + 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)] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + 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, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocation { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ReportEquivocationUnsigned { + equivocation_proof, + key_owner_proof, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn note_stalled( + &self, + delay: ::core::primitive::u32, + best_finalized_block_number: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = NoteStalled { + delay, + best_finalized_block_number, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_grandpa::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewAuthorities( + pub 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)] + 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)] + 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(pub ::core::primitive::u64); + impl ::subxt::StorageEntry for SetIdSession { + const PALLET: &'static str = "Grandpa"; + const STORAGE: &'static str = "SetIdSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn state( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = State; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn pending_change( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_grandpa::StoredPendingChange< + ::core::primitive::u32, + >, + >, + ::subxt::Error, + > { + let entry = PendingChange; + self.client.storage().fetch(&entry, hash).await + } + pub async fn next_forced( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = NextForced; + self.client.storage().fetch(&entry, hash).await + } + pub async fn stalled( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::Error, + > { + let entry = Stalled; + self.client.storage().fetch(&entry, hash).await + } + pub async fn current_set_id( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + { + let entry = CurrentSetId; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn set_id_session( + &self, + _0: ::core::primitive::u64, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::Error, + > { + let entry = SetIdSession(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn set_id_session_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SetIdSession>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod treasury { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProposeSpend { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for ProposeSpend { + const PALLET: &'static str = "Treasury"; + const FUNCTION: &'static str = "propose_spend"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn propose_spend( + &self, + value: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeSpend { value, beneficiary }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reject_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RejectProposal { proposal_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveProposal { proposal_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposed(pub ::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)] + pub struct Spending(pub ::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)] + pub struct Awarded( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::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)] + pub struct Rejected(pub ::core::primitive::u32, pub ::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)] + pub struct Burnt(pub ::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)] + pub struct Rollover(pub ::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)] + pub struct Deposit(pub ::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(pub ::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 } + } + pub async fn proposal_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ProposalCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proposals( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_treasury::Proposal< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Proposals(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proposals_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Proposals>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn approvals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >, + ::subxt::Error, + > { + let entry = Approvals; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod contracts { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Call { + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + #[codec(compact)] + pub gas_limit: ::core::primitive::u64, + pub data: Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Call { + const PALLET: &'static str = "Contracts"; + const FUNCTION: &'static str = "call"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstantiateWithCode { + #[codec(compact)] + pub endowment: ::core::primitive::u128, + #[codec(compact)] + pub gas_limit: ::core::primitive::u64, + pub code: Vec<::core::primitive::u8>, + pub data: Vec<::core::primitive::u8>, + pub salt: Vec<::core::primitive::u8>, + } + impl ::subxt::Call for InstantiateWithCode { + const PALLET: &'static str = "Contracts"; + const FUNCTION: &'static str = "instantiate_with_code"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Instantiate { + #[codec(compact)] + pub endowment: ::core::primitive::u128, + #[codec(compact)] + pub gas_limit: ::core::primitive::u64, + pub code_hash: ::subxt::sp_core::H256, + pub data: Vec<::core::primitive::u8>, + pub salt: Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Instantiate { + const PALLET: &'static str = "Contracts"; + const FUNCTION: &'static str = "instantiate"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn call( + &self, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + gas_limit: ::core::primitive::u64, + data: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Call { + dest, + value, + gas_limit, + data, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn instantiate_with_code( + &self, + endowment: ::core::primitive::u128, + gas_limit: ::core::primitive::u64, + code: Vec<::core::primitive::u8>, + data: Vec<::core::primitive::u8>, + salt: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = InstantiateWithCode { + endowment, + gas_limit, + code, + data, + salt, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn instantiate( + &self, + endowment: ::core::primitive::u128, + gas_limit: ::core::primitive::u64, + code_hash: ::subxt::sp_core::H256, + data: Vec<::core::primitive::u8>, + salt: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Instantiate { + endowment, + gas_limit, + code_hash, + data, + salt, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_contracts::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Instantiated { + pub deployer: ::subxt::sp_core::crypto::AccountId32, + pub contract: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Instantiated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "Instantiated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Terminated { + pub contract: ::subxt::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Event for Terminated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "Terminated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CodeStored { + pub code_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for CodeStored { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "CodeStored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduleUpdated { + pub version: ::core::primitive::u32, + } + impl ::subxt::Event for ScheduleUpdated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "ScheduleUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ContractEmitted { + pub contract: ::subxt::sp_core::crypto::AccountId32, + pub data: Vec<::core::primitive::u8>, + } + impl ::subxt::Event for ContractEmitted { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "ContractEmitted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CodeRemoved { + pub code_hash: ::subxt::sp_core::H256, + } + impl ::subxt::Event for CodeRemoved { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "CodeRemoved"; + } + } + pub mod storage { + use super::runtime_types; + pub struct PristineCode(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for PristineCode { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "PristineCode"; + type Value = Vec<::core::primitive::u8>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct CodeStorage(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for CodeStorage { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "CodeStorage"; + type Value = runtime_types::pallet_contracts::wasm::PrefabWasmModule; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct AccountCounter; + impl ::subxt::StorageEntry for AccountCounter { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "AccountCounter"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ContractInfoOf(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for ContractInfoOf { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "ContractInfoOf"; + type Value = runtime_types::pallet_contracts::storage::RawContractInfo< + ::subxt::sp_core::H256, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct DeletionQueue; + impl ::subxt::StorageEntry for DeletionQueue { + const PALLET: &'static str = "Contracts"; + const STORAGE: &'static str = "DeletionQueue"; + type Value = + Vec; + 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 pristine_code( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option>, + ::subxt::Error, + > { + let entry = PristineCode(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn pristine_code_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, PristineCode>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn code_storage( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_contracts::wasm::PrefabWasmModule, + >, + ::subxt::Error, + > { + let entry = CodeStorage(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn code_storage_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, CodeStorage>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn account_counter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + { + let entry = AccountCounter; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn contract_info_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_contracts::storage::RawContractInfo< + ::subxt::sp_core::H256, + >, + >, + ::subxt::Error, + > { + let entry = ContractInfoOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn contract_info_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ContractInfoOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn deletion_queue( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = DeletionQueue; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod sudo { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Sudo { + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for Sudo { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "sudo"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SudoUncheckedWeight { + pub call: runtime_types::node_runtime::Call, + pub weight: ::core::primitive::u64, + } + impl ::subxt::Call for SudoUncheckedWeight { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "sudo_unchecked_weight"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetKey { + pub new: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for SetKey { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "set_key"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SudoAs { + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for SudoAs { + const PALLET: &'static str = "Sudo"; + const FUNCTION: &'static str = "sudo_as"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn sudo( + &self, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Sudo { call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn sudo_unchecked_weight( + &self, + call: runtime_types::node_runtime::Call, + weight: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic + { + let call = SudoUncheckedWeight { call, weight }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_key( + &self, + new: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetKey { new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn sudo_as( + &self, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = SudoAs { who, call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_sudo::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Sudid( + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Sudid { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "Sudid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct KeyChanged(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for KeyChanged { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SudoAsDone( + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for SudoAsDone { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "SudoAsDone"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Key; + impl ::subxt::StorageEntry for Key { + const PALLET: &'static str = "Sudo"; + const STORAGE: &'static str = "Key"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn key( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::sp_core::crypto::AccountId32, + ::subxt::Error, + > { + let entry = Key; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod im_online { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn heartbeat( + &self, + heartbeat: runtime_types::pallet_im_online::Heartbeat< + ::core::primitive::u32, + >, + signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, + ) -> ::subxt::SubmittableExtrinsic { + let call = Heartbeat { + heartbeat, + signature, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_im_online::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct HeartbeatReceived( + pub 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)] + 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)] + pub struct SomeOffline( + pub 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(::core::primitive::u32, ::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( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for AuthoredBlocks { + const PALLET: &'static str = "ImOnline"; + const STORAGE: &'static str = "AuthoredBlocks"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn heartbeat_after( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = HeartbeatAfter; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn keys (& self , 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 :: Error >{ + let entry = Keys; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn received_heartbeats( + &self, + _0: ::core::primitive::u32, + _1: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, + >, + ::subxt::Error, + > { + let entry = ReceivedHeartbeats(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn received_heartbeats_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ReceivedHeartbeats>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn authored_blocks( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = AuthoredBlocks(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn authored_blocks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, AuthoredBlocks>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod authority_discovery { + use super::runtime_types; + } + pub mod offences { + use super::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)] + pub struct Offence( + pub [::core::primitive::u8; 16usize], + pub 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(pub ::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( + [::core::primitive::u8; 16usize], + Vec<::core::primitive::u8>, + ); + impl ::subxt::StorageEntry for ConcurrentReportsIndex { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ConcurrentReportsIndex"; + type Value = 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(pub [::core::primitive::u8; 16usize]); + impl ::subxt::StorageEntry for ReportsByKindIndex { + const PALLET: &'static str = "Offences"; + const STORAGE: &'static str = "ReportsByKindIndex"; + type Value = Vec<::core::primitive::u8>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn reports( + &self, + _0: ::subxt::sp_core::H256, + 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::Error, + > { + let entry = Reports(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn reports_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Reports>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn concurrent_reports_index( + &self, + _0: [::core::primitive::u8; 16usize], + _1: Vec<::core::primitive::u8>, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = ConcurrentReportsIndex(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn concurrent_reports_index_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ConcurrentReportsIndex>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn reports_by_kind_index( + &self, + _0: [::core::primitive::u8; 16usize], + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = ReportsByKindIndex(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn reports_by_kind_index_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ReportsByKindIndex>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod historical { + use super::runtime_types; + } + pub mod randomness_collective_flip { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct RandomMaterial; + impl ::subxt::StorageEntry for RandomMaterial { + const PALLET: &'static str = "RandomnessCollectiveFlip"; + const STORAGE: &'static str = "RandomMaterial"; + type Value = Vec<::subxt::sp_core::H256>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn random_material( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = RandomMaterial; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod identity { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct SetIdentity { + pub info: 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)] + pub struct SetSubs { + pub subs: 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + 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)] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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)] + pub struct KillIdentity { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for KillIdentity { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "kill_identity"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AddSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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)] + pub struct RenameSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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)] + pub struct RemoveSub { + pub sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for RemoveSub { + const PALLET: &'static str = "Identity"; + const FUNCTION: &'static str = "remove_sub"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn add_registrar( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddRegistrar { account }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_identity( + &self, + info: runtime_types::pallet_identity::types::IdentityInfo, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetIdentity { info }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_subs( + &self, + subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetSubs { subs }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_identity( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearIdentity {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn request_judgement( + &self, + reg_index: ::core::primitive::u32, + max_fee: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = RequestJudgement { reg_index, max_fee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_request( + &self, + reg_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelRequest { reg_index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_fee( + &self, + index: ::core::primitive::u32, + fee: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetFee { index, fee }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_account_id( + &self, + index: ::core::primitive::u32, + new: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetAccountId { index, new }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_fields( + &self, + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetFields { index, fields }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn provide_judgement( + &self, + reg_index: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProvideJudgement { + reg_index, + target, + judgement, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_identity( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillIdentity { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn rename_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::SubmittableExtrinsic { + let call = RenameSub { sub, data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_sub( + &self, + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveSub { sub }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn quit_sub(&self) -> ::subxt::SubmittableExtrinsic { + let call = QuitSub {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_identity::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct IdentitySet(pub ::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)] + pub struct IdentityCleared( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct IdentityKilled( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct JudgementRequested( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct JudgementUnrequested( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct JudgementGiven( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct RegistrarAdded(pub ::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)] + pub struct SubIdentityAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct SubIdentityRemoved( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct SubIdentityRevoked( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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(pub ::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(pub ::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(pub ::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 } + } + pub async fn identity_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = IdentityOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn identity_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, IdentityOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn super_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ::subxt::Error, + > { + let entry = SuperOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn super_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuperOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn subs_of( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ( + ::core::primitive::u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + ::subxt::Error, + > { + let entry = SubsOf(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn subs_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, SubsOf>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn registrars( + &self, + 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::Error, + > { + let entry = Registrars; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod society { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bid { + pub value: ::core::primitive::u128, + } + impl ::subxt::Call for Bid { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unbid { + pub pos: ::core::primitive::u32, + } + impl ::subxt::Call for Unbid { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "unbid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vouch { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + pub tip: ::core::primitive::u128, + } + impl ::subxt::Call for Vouch { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "vouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unvouch { + pub pos: ::core::primitive::u32, + } + impl ::subxt::Call for Unvouch { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "unvouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vote { + pub candidate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub approve: ::core::primitive::bool, + } + impl ::subxt::Call for Vote { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DefenderVote { + pub approve: ::core::primitive::bool, + } + impl ::subxt::Call for DefenderVote { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "defender_vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Payout {} + impl ::subxt::Call for Payout { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "payout"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Found { + pub founder: ::subxt::sp_core::crypto::AccountId32, + pub max_members: ::core::primitive::u32, + pub rules: Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Found { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "found"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unfound {} + impl ::subxt::Call for Unfound { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "unfound"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgeSuspendedMember { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub forgive: ::core::primitive::bool, + } + impl ::subxt::Call for JudgeSuspendedMember { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "judge_suspended_member"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct JudgeSuspendedCandidate { + pub who: ::subxt::sp_core::crypto::AccountId32, + pub judgement: runtime_types::pallet_society::Judgement, + } + impl ::subxt::Call for JudgeSuspendedCandidate { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "judge_suspended_candidate"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMaxMembers { + pub max: ::core::primitive::u32, + } + impl ::subxt::Call for SetMaxMembers { + const PALLET: &'static str = "Society"; + const FUNCTION: &'static str = "set_max_members"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn bid( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Bid { value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unbid( + &self, + pos: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unbid { pos }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vouch( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + value: ::core::primitive::u128, + tip: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vouch { who, value, tip }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unvouch( + &self, + pos: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Unvouch { pos }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vote( + &self, + candidate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + approve: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = Vote { candidate, approve }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn defender_vote( + &self, + approve: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = DefenderVote { approve }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn payout(&self) -> ::subxt::SubmittableExtrinsic { + let call = Payout {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn found( + &self, + founder: ::subxt::sp_core::crypto::AccountId32, + max_members: ::core::primitive::u32, + rules: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Found { + founder, + max_members, + rules, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unfound(&self) -> ::subxt::SubmittableExtrinsic { + let call = Unfound {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn judge_suspended_member( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + forgive: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic + { + let call = JudgeSuspendedMember { who, forgive }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn judge_suspended_candidate( + &self, + who: ::subxt::sp_core::crypto::AccountId32, + judgement: runtime_types::pallet_society::Judgement, + ) -> ::subxt::SubmittableExtrinsic + { + let call = JudgeSuspendedCandidate { who, judgement }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_max_members( + &self, + max: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMaxMembers { max }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_society::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Founded(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Founded { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Founded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bid( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Bid { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vouch( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Vouch { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Vouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AutoUnbid(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for AutoUnbid { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "AutoUnbid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unbid(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Unbid { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Unbid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unvouch(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Unvouch { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Unvouch"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Inducted( + pub ::subxt::sp_core::crypto::AccountId32, + pub Vec<::subxt::sp_core::crypto::AccountId32>, + ); + impl ::subxt::Event for Inducted { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Inducted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SuspendedMemberJudgement( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for SuspendedMemberJudgement { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "SuspendedMemberJudgement"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CandidateSuspended(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for CandidateSuspended { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "CandidateSuspended"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MemberSuspended(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for MemberSuspended { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "MemberSuspended"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Challenged(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Challenged { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Challenged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Vote( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for Vote { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Vote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DefenderVote( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for DefenderVote { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "DefenderVote"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewMaxMembers(pub ::core::primitive::u32); + impl ::subxt::Event for NewMaxMembers { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "NewMaxMembers"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Unfounded(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for Unfounded { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Unfounded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Deposit(pub ::core::primitive::u128); + impl ::subxt::Event for Deposit { + const PALLET: &'static str = "Society"; + const EVENT: &'static str = "Deposit"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Founder; + impl ::subxt::StorageEntry for Founder { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Founder"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Rules; + impl ::subxt::StorageEntry for Rules { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Rules"; + type Value = ::subxt::sp_core::H256; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Candidates; + impl ::subxt::StorageEntry for Candidates { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Candidates"; + type Value = Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SuspendedCandidates(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuspendedCandidates { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "SuspendedCandidates"; + type Value = ( + ::core::primitive::u128, + runtime_types::pallet_society::BidKind< + ::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 Pot; + impl ::subxt::StorageEntry for Pot { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Pot"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Head; + impl ::subxt::StorageEntry for Head { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Head"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Members; + impl ::subxt::StorageEntry for Members { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Members"; + type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SuspendedMembers(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for SuspendedMembers { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "SuspendedMembers"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Bids; + impl ::subxt::StorageEntry for Bids { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Bids"; + type Value = Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Vouching(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Vouching { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Vouching"; + type Value = runtime_types::pallet_society::VouchingStatus; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Payouts(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Payouts { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Payouts"; + type Value = Vec<(::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 Strikes(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Strikes { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Strikes"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Votes( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for Votes { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Votes"; + type Value = runtime_types::pallet_society::Vote; + 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 Defender; + impl ::subxt::StorageEntry for Defender { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "Defender"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DefenderVotes(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for DefenderVotes { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "DefenderVotes"; + type Value = runtime_types::pallet_society::Vote; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct MaxMembers; + impl ::subxt::StorageEntry for MaxMembers { + const PALLET: &'static str = "Society"; + const STORAGE: &'static str = "MaxMembers"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn founder( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Founder; + self.client.storage().fetch(&entry, hash).await + } + pub async fn rules( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::H256>, + ::subxt::Error, + > { + let entry = Rules; + self.client.storage().fetch(&entry, hash).await + } + pub async fn candidates( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Candidates; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn suspended_candidates( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u128, + runtime_types::pallet_society::BidKind< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, + ::subxt::Error, + > { + let entry = SuspendedCandidates(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn suspended_candidates_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuspendedCandidates>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn pot( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> + { + let entry = Pot; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn head( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Head; + self.client.storage().fetch(&entry, hash).await + } + pub async fn members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Members; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn suspended_members( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = SuspendedMembers(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn suspended_members_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SuspendedMembers>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn bids( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_society::Bid< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Bids; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn vouching( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = Vouching(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn vouching_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Vouching>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn payouts( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::core::primitive::u32, ::core::primitive::u128)>, + ::subxt::Error, + > { + let entry = Payouts(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn payouts_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Payouts>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn strikes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = Strikes(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn strikes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Strikes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn votes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = Votes(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn votes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Votes>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn defender( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Defender; + self.client.storage().fetch(&entry, hash).await + } + pub async fn defender_votes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = DefenderVotes(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn defender_votes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, DefenderVotes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn max_members( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = MaxMembers; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod recovery { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsRecovered { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for AsRecovered { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "as_recovered"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetRecovered { + pub lost: ::subxt::sp_core::crypto::AccountId32, + pub rescuer: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for SetRecovered { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "set_recovered"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CreateRecovery { + pub friends: Vec<::subxt::sp_core::crypto::AccountId32>, + pub threshold: ::core::primitive::u16, + pub delay_period: ::core::primitive::u32, + } + impl ::subxt::Call for CreateRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "create_recovery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InitiateRecovery { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for InitiateRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "initiate_recovery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VouchRecovery { + pub lost: ::subxt::sp_core::crypto::AccountId32, + pub rescuer: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for VouchRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "vouch_recovery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClaimRecovery { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ClaimRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "claim_recovery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CloseRecovery { + pub rescuer: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for CloseRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "close_recovery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RemoveRecovery {} + impl ::subxt::Call for RemoveRecovery { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "remove_recovery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelRecovered { + pub account: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for CancelRecovered { + const PALLET: &'static str = "Recovery"; + const FUNCTION: &'static str = "cancel_recovered"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn as_recovered( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsRecovered { account, call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_recovered( + &self, + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetRecovered { lost, rescuer }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn create_recovery( + &self, + friends: Vec<::subxt::sp_core::crypto::AccountId32>, + threshold: ::core::primitive::u16, + delay_period: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CreateRecovery { + friends, + threshold, + delay_period, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn initiate_recovery( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = InitiateRecovery { account }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vouch_recovery( + &self, + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = VouchRecovery { lost, rescuer }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn claim_recovery( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClaimRecovery { account }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_recovery( + &self, + rescuer: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseRecovery { rescuer }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_recovery( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveRecovery {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_recovered( + &self, + account: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelRecovered { account }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_recovery::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryCreated(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for RecoveryCreated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryInitiated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for RecoveryInitiated { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryInitiated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryVouched( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for RecoveryVouched { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryVouched"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryClosed( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for RecoveryClosed { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryClosed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AccountRecovered( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for AccountRecovered { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "AccountRecovered"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryRemoved(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::Event for RecoveryRemoved { + const PALLET: &'static str = "Recovery"; + const EVENT: &'static str = "RecoveryRemoved"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Recoverable(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Recoverable { + const PALLET: &'static str = "Recovery"; + const STORAGE: &'static str = "Recoverable"; + type Value = runtime_types::pallet_recovery::RecoveryConfig< + ::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, + )]) + } + } + pub struct ActiveRecoveries( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for ActiveRecoveries { + const PALLET: &'static str = "Recovery"; + const STORAGE: &'static str = "ActiveRecoveries"; + type Value = runtime_types::pallet_recovery::ActiveRecovery< + ::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::Twox64Concat, + ), + ]) + } + } + pub struct Proxy(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Proxy { + const PALLET: &'static str = "Recovery"; + const STORAGE: &'static str = "Proxy"; + type Value = ::subxt::sp_core::crypto::AccountId32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn recoverable( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_recovery::RecoveryConfig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Recoverable(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn recoverable_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Recoverable>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn active_recoveries( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_recovery::ActiveRecovery< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = ActiveRecoveries(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn active_recoveries_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ActiveRecoveries>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn proxy( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Proxy(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn proxy_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Proxy>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + } + } + } + pub mod vesting { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct VestOther { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for VestOther { + const PALLET: &'static str = "Vesting"; + const FUNCTION: &'static str = "vest_other"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestedTransfer { + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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)] + pub struct ForceVestedTransfer { + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn vest(&self) -> ::subxt::SubmittableExtrinsic { + let call = Vest {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vest_other( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = VestOther { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn vested_transfer( + &self, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = VestedTransfer { target, schedule }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_vested_transfer( + &self, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceVestedTransfer { + source, + target, + schedule, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn merge_schedules( + &self, + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = MergeSchedules { + schedule1_index, + schedule2_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestingUpdated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct VestingCompleted(pub ::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(pub ::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 } + } + pub async fn vesting( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::Error, + > { + let entry = Vesting(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn vesting_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Vesting>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_vesting::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod scheduler { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for Schedule { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct ScheduleNamed { + pub id: 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: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for ScheduleNamed { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelNamed { + pub id: 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)] + 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: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for ScheduleAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_after"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduleNamedAfter { + pub id: 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: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for ScheduleNamedAfter { + const PALLET: &'static str = "Scheduler"; + const FUNCTION: &'static str = "schedule_named_after"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + 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::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Schedule { + when, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel( + &self, + when: ::core::primitive::u32, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Cancel { when, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named( + &self, + id: 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::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_named( + &self, + id: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelNamed { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ScheduleAfter { + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn schedule_named_after( + &self, + id: 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::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Scheduled(pub ::core::primitive::u32, pub ::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)] + pub struct Canceled(pub ::core::primitive::u32, pub ::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)] + pub struct Dispatched( + pub (::core::primitive::u32, ::core::primitive::u32), + pub ::core::option::Option>, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::Event for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Agenda(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Agenda { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "Agenda"; + type Value = Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::node_runtime::Call, + ::core::primitive::u32, + runtime_types::node_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(pub Vec<::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 StorageVersion; + impl ::subxt::StorageEntry for StorageVersion { + const PALLET: &'static str = "Scheduler"; + const STORAGE: &'static str = "StorageVersion"; + type Value = runtime_types::pallet_scheduler::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 agenda( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV2< + runtime_types::node_runtime::Call, + ::core::primitive::u32, + runtime_types::node_runtime::OriginCaller, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + >, + ::subxt::Error, + > { + let entry = Agenda(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn agenda_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Agenda>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn lookup( + &self, + _0: Vec<::core::primitive::u8>, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::Error, + > { + let entry = Lookup(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn lookup_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Lookup>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn storage_version( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_scheduler::Releases, + ::subxt::Error, + > { + let entry = StorageVersion; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod proxy { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proxy { + pub real: ::subxt::sp_core::crypto::AccountId32, + pub force_proxy_type: + ::core::option::Option, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for Proxy { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AddProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::node_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)] + pub struct RemoveProxy { + pub delegate: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::node_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)] + 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)] + pub struct Anonymous { + pub proxy_type: runtime_types::node_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)] + pub struct KillAnonymous { + pub spawner: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::node_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)] + 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)] + 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)] + 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)] + 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: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for ProxyAnnounced { + const PALLET: &'static str = "Proxy"; + const FUNCTION: &'static str = "proxy_announced"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn proxy( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::node_runtime::ProxyType, + >, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = Proxy { + real, + force_proxy_type, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn add_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AddProxy { + delegate, + proxy_type, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_proxy( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveProxy { + delegate, + proxy_type, + delay, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_proxies( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = RemoveProxies {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn anonymous( + &self, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: ::core::primitive::u32, + index: ::core::primitive::u16, + ) -> ::subxt::SubmittableExtrinsic { + let call = Anonymous { + proxy_type, + delay, + index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn kill_anonymous( + &self, + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + index: ::core::primitive::u16, + height: ::core::primitive::u32, + ext_index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = KillAnonymous { + spawner, + proxy_type, + index, + height, + ext_index, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn announce( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = Announce { real, call_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn remove_announcement( + &self, + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = RemoveAnnouncement { real, call_hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn reject_announcement( + &self, + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic + { + let call = RejectAnnouncement { + delegate, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + 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::node_runtime::ProxyType, + >, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProxyAnnounced { + delegate, + real, + force_proxy_type, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_proxy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProxyExecuted( + pub ::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)] + pub struct AnonymousCreated( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::node_runtime::ProxyType, + pub ::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)] + pub struct Announced( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct ProxyAdded( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::node_runtime::ProxyType, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for ProxyAdded { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyAdded"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Proxies(pub ::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::node_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(pub ::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 } + } + pub async fn proxies( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::node_runtime::ProxyType, + ::core::primitive::u32, + >, + >, + ::core::primitive::u128, + ), + ::subxt::Error, + > { + let entry = Proxies(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proxies_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Proxies>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn announcements( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + 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::Error, + > { + let entry = Announcements(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn announcements_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Announcements>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod multisig { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsMultiThreshold1 { + pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for AsMultiThreshold1 { + const PALLET: &'static str = "Multisig"; + const FUNCTION: &'static str = "as_multi_threshold1"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: 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)] + pub struct ApproveAsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: 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)] + pub struct CancelAsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn as_multi_threshold1( + &self, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsMultiThreshold1 { + other_signatories, + call, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call: ::subxt::WrapperKeepOpaque, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call, + store_call, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: 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, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + call_hash: [::core::primitive::u8; 32usize], + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewMultisig( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::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)] + pub struct MultisigApproval( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::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)] + pub struct MultisigExecuted( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::core::primitive::u8; 32usize], + pub ::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)] + pub struct MultisigCancelled( + pub ::subxt::sp_core::crypto::AccountId32, + pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub ::subxt::sp_core::crypto::AccountId32, + pub [::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( + ::subxt::sp_core::crypto::AccountId32, + [::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(pub [::core::primitive::u8; 32usize]); + impl ::subxt::StorageEntry for Calls { + const PALLET: &'static str = "Multisig"; + const STORAGE: &'static str = "Calls"; + type Value = ( + ::subxt::WrapperKeepOpaque, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn multisigs( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: [::core::primitive::u8; 32usize], + 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::Error, + > { + let entry = Multisigs(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn multisigs_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Multisigs>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn calls( + &self, + _0: [::core::primitive::u8; 32usize], + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + ::subxt::WrapperKeepOpaque, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::Error, + > { + let entry = Calls(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn calls_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Calls>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + } + } + } + pub mod bounties { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProposeBounty { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub description: 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)] + 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)] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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)] + 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)] + 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)] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for AwardBounty { + const PALLET: &'static str = "Bounties"; + const FUNCTION: &'static str = "award_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub remark: 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn propose_bounty( + &self, + value: ::core::primitive::u128, + description: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeBounty { value, description }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn propose_curator( + &self, + bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + fee: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = ProposeCurator { + bounty_id, + curator, + fee, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn unassign_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = UnassignCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn accept_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = AcceptCurator { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn award_bounty( + &self, + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = AwardBounty { + bounty_id, + beneficiary, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn claim_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClaimBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseBounty { bounty_id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn extend_bounty_expiry( + &self, + bounty_id: ::core::primitive::u32, + remark: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ExtendBountyExpiry { bounty_id, remark }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_bounties::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BountyProposed(pub ::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)] + pub struct BountyRejected( + pub ::core::primitive::u32, + pub ::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)] + pub struct BountyBecameActive(pub ::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)] + pub struct BountyAwarded( + pub ::core::primitive::u32, + pub ::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)] + pub struct BountyClaimed( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::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)] + pub struct BountyCanceled(pub ::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)] + pub struct BountyExtended(pub ::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(pub ::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(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for BountyDescriptions { + const PALLET: &'static str = "Bounties"; + const STORAGE: &'static str = "BountyDescriptions"; + type Value = Vec<::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 = Vec<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn bounty_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = BountyCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn bounties( + &self, + _0: ::core::primitive::u32, + 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::Error, + > { + let entry = Bounties(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bounties_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Bounties>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn bounty_descriptions( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option>, + ::subxt::Error, + > { + let entry = BountyDescriptions(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn bounty_descriptions_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, BountyDescriptions>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn bounty_approvals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result, ::subxt::Error> + { + let entry = BountyApprovals; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod tips { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReportAwesome { + pub reason: 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)] + 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)] + pub struct TipNew { + pub reason: 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)] + 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)] + 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)] + 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 + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn report_awesome( + &self, + reason: Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ReportAwesome { reason, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn retract_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = RetractTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip_new( + &self, + reason: Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + tip_value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = TipNew { + reason, + who, + tip_value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip( + &self, + hash: ::subxt::sp_core::H256, + tip_value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic { + let call = Tip { hash, tip_value }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn close_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = CloseTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn slash_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic { + let call = SlashTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_tips::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NewTip(pub ::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)] + pub struct TipClosing(pub ::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)] + pub struct TipClosed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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)] + pub struct TipRetracted(pub ::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)] + pub struct TipSlashed( + pub ::subxt::sp_core::H256, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::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(pub ::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(pub ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reasons { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Reasons"; + type Value = Vec<::core::primitive::u8>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn tips( + &self, + _0: ::subxt::sp_core::H256, + 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::Error, + > { + let entry = Tips(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn tips_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Tips>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn reasons( + &self, + _0: ::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option>, + ::subxt::Error, + > { + let entry = Reasons(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn reasons_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Reasons>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod assets { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Create { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub min_balance: ::core::primitive::u64, + } + impl ::subxt::Call for Create { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "create"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreate { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub is_sufficient: ::core::primitive::bool, + #[codec(compact)] + pub min_balance: ::core::primitive::u64, + } + impl ::subxt::Call for ForceCreate { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_create"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroy { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub witness: runtime_types::pallet_assets::types::DestroyWitness, + } + impl ::subxt::Call for Destroy { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "destroy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Mint { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for Mint { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "mint"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burn { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for Burn { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "burn"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transfer { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferKeepAlive { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for TransferKeepAlive { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer_keep_alive"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceTransfer { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for ForceTransfer { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Freeze { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for Freeze { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "freeze"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thaw { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for Thaw { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "thaw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct FreezeAsset { + #[codec(compact)] + pub id: ::core::primitive::u32, + } + impl ::subxt::Call for FreezeAsset { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "freeze_asset"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ThawAsset { + #[codec(compact)] + pub id: ::core::primitive::u32, + } + impl ::subxt::Call for ThawAsset { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "thaw_asset"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferOwnership { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for TransferOwnership { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer_ownership"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetTeam { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for SetTeam { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "set_team"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMetadata { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub name: Vec<::core::primitive::u8>, + pub symbol: Vec<::core::primitive::u8>, + pub decimals: ::core::primitive::u8, + } + impl ::subxt::Call for SetMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "set_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearMetadata { + #[codec(compact)] + pub id: ::core::primitive::u32, + } + impl ::subxt::Call for ClearMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "clear_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceSetMetadata { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub name: Vec<::core::primitive::u8>, + pub symbol: Vec<::core::primitive::u8>, + pub decimals: ::core::primitive::u8, + pub is_frozen: ::core::primitive::bool, + } + impl ::subxt::Call for ForceSetMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_set_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceClearMetadata { + #[codec(compact)] + pub id: ::core::primitive::u32, + } + impl ::subxt::Call for ForceClearMetadata { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_clear_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceAssetStatus { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub min_balance: ::core::primitive::u64, + pub is_sufficient: ::core::primitive::bool, + pub is_frozen: ::core::primitive::bool, + } + impl ::subxt::Call for ForceAssetStatus { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_asset_status"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveTransfer { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for ApproveTransfer { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "approve_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelApproval { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for CancelApproval { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "cancel_approval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCancelApproval { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for ForceCancelApproval { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "force_cancel_approval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferApproved { + #[codec(compact)] + pub id: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub destination: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + pub amount: ::core::primitive::u64, + } + impl ::subxt::Call for TransferApproved { + const PALLET: &'static str = "Assets"; + const FUNCTION: &'static str = "transfer_approved"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn create( + &self, + id: ::core::primitive::u32, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + min_balance: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Create { + id, + admin, + min_balance, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_create( + &self, + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + is_sufficient: ::core::primitive::bool, + min_balance: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceCreate { + id, + owner, + is_sufficient, + min_balance, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn destroy( + &self, + id: ::core::primitive::u32, + witness: runtime_types::pallet_assets::types::DestroyWitness, + ) -> ::subxt::SubmittableExtrinsic { + let call = Destroy { id, witness }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn mint( + &self, + id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Mint { + id, + beneficiary, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn burn( + &self, + id: ::core::primitive::u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Burn { id, who, amount }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer( + &self, + id: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { id, target, amount }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_keep_alive( + &self, + id: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferKeepAlive { id, target, amount }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_transfer( + &self, + id: ::core::primitive::u32, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceTransfer { + id, + source, + dest, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze( + &self, + id: ::core::primitive::u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Freeze { id, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw( + &self, + id: ::core::primitive::u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Thaw { id, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze_asset( + &self, + id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FreezeAsset { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw_asset( + &self, + id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ThawAsset { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_ownership( + &self, + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferOwnership { id, owner }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_team( + &self, + id: ::core::primitive::u32, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetTeam { + id, + issuer, + admin, + freezer, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_metadata( + &self, + id: ::core::primitive::u32, + name: Vec<::core::primitive::u8>, + symbol: Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMetadata { + id, + name, + symbol, + decimals, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_metadata( + &self, + id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearMetadata { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_set_metadata( + &self, + id: ::core::primitive::u32, + name: Vec<::core::primitive::u8>, + symbol: Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, + is_frozen: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceSetMetadata { + id, + name, + symbol, + decimals, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_clear_metadata( + &self, + id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceClearMetadata { id }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_asset_status( + &self, + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + min_balance: ::core::primitive::u64, + is_sufficient: ::core::primitive::bool, + is_frozen: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceAssetStatus { + id, + owner, + issuer, + admin, + freezer, + min_balance, + is_sufficient, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_transfer( + &self, + id: ::core::primitive::u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveTransfer { + id, + delegate, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_approval( + &self, + id: ::core::primitive::u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelApproval { id, delegate }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_cancel_approval( + &self, + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ForceCancelApproval { + id, + owner, + delegate, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_approved( + &self, + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + destination: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u64, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferApproved { + id, + owner, + destination, + amount, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_assets::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Created( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Created { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Created"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Issued( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for Issued { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Issued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transferred( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for Transferred { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Transferred"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burned( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for Burned { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Burned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TeamChanged( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for TeamChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "TeamChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OwnerChanged( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for OwnerChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "OwnerChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Frozen( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Frozen { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Frozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thawed( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Thawed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Thawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetFrozen(pub ::core::primitive::u32); + impl ::subxt::Event for AssetFrozen { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetFrozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetThawed(pub ::core::primitive::u32); + impl ::subxt::Event for AssetThawed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetThawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroyed(pub ::core::primitive::u32); + impl ::subxt::Event for Destroyed { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "Destroyed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreated( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ForceCreated { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ForceCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataSet( + pub ::core::primitive::u32, + pub Vec<::core::primitive::u8>, + pub Vec<::core::primitive::u8>, + pub ::core::primitive::u8, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for MetadataSet { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataCleared(pub ::core::primitive::u32); + impl ::subxt::Event for MetadataCleared { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "MetadataCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovedTransfer( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for ApprovedTransfer { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovedTransfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovalCancelled( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ApprovalCancelled { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "ApprovalCancelled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferredApproved( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + ); + impl ::subxt::Event for TransferredApproved { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "TransferredApproved"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetStatusChanged(pub ::core::primitive::u32); + impl ::subxt::Event for AssetStatusChanged { + const PALLET: &'static str = "Assets"; + const EVENT: &'static str = "AssetStatusChanged"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Asset(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Asset { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Asset"; + type Value = runtime_types::pallet_assets::types::AssetDetails< + ::core::primitive::u64, + ::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 Account( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for Account { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Account"; + type Value = runtime_types::pallet_assets::types::AssetBalance< + ::core::primitive::u64, + (), + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Approvals( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::StorageEntry for Approvals { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Approvals"; + type Value = runtime_types::pallet_assets::types::Approval< + ::core::primitive::u64, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.2, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Metadata(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Metadata { + const PALLET: &'static str = "Assets"; + const STORAGE: &'static str = "Metadata"; + type Value = runtime_types::pallet_assets::types::AssetMetadata< + ::core::primitive::u128, + 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::Blake2_128Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn asset( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_assets::types::AssetDetails< + ::core::primitive::u64, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Asset(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn asset_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn account( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_assets::types::AssetBalance< + ::core::primitive::u64, + (), + >, + ::subxt::Error, + > { + let entry = Account(_0, _1); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn account_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn approvals( + &self, + _0: ::core::primitive::u32, + _1: ::subxt::sp_core::crypto::AccountId32, + _2: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_assets::types::Approval< + ::core::primitive::u64, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Approvals(_0, _1, _2); + self.client.storage().fetch(&entry, hash).await + } + pub async fn approvals_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Approvals>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn metadata( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_assets::types::AssetMetadata< + ::core::primitive::u128, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + ::subxt::Error, + > { + let entry = Metadata(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn metadata_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Metadata>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod mmr { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct RootHash; + impl ::subxt::StorageEntry for RootHash { + const PALLET: &'static str = "Mmr"; + const STORAGE: &'static str = "RootHash"; + type Value = ::subxt::sp_core::H256; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct NumberOfLeaves; + impl ::subxt::StorageEntry for NumberOfLeaves { + const PALLET: &'static str = "Mmr"; + const STORAGE: &'static str = "NumberOfLeaves"; + type Value = ::core::primitive::u64; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Nodes(pub ::core::primitive::u64); + impl ::subxt::StorageEntry for Nodes { + const PALLET: &'static str = "Mmr"; + const STORAGE: &'static str = "Nodes"; + type Value = ::subxt::sp_core::H256; + 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 root_hash( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> + { + let entry = RootHash; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn number_of_leaves( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> + { + let entry = NumberOfLeaves; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn nodes( + &self, + _0: ::core::primitive::u64, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::H256>, + ::subxt::Error, + > { + let entry = Nodes(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn nodes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Nodes>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + } + } + } + pub mod lottery { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BuyTicket { + pub call: runtime_types::node_runtime::Call, + } + impl ::subxt::Call for BuyTicket { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "buy_ticket"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetCalls { + pub calls: Vec, + } + impl ::subxt::Call for SetCalls { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "set_calls"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct StartLottery { + pub price: ::core::primitive::u128, + pub length: ::core::primitive::u32, + pub delay: ::core::primitive::u32, + pub repeat: ::core::primitive::bool, + } + impl ::subxt::Call for StartLottery { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "start_lottery"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct StopRepeat {} + impl ::subxt::Call for StopRepeat { + const PALLET: &'static str = "Lottery"; + const FUNCTION: &'static str = "stop_repeat"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn buy_ticket( + &self, + call: runtime_types::node_runtime::Call, + ) -> ::subxt::SubmittableExtrinsic { + let call = BuyTicket { call }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_calls( + &self, + calls: Vec, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetCalls { calls }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn start_lottery( + &self, + price: ::core::primitive::u128, + length: ::core::primitive::u32, + delay: ::core::primitive::u32, + repeat: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = StartLottery { + price, + length, + delay, + repeat, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn stop_repeat( + &self, + ) -> ::subxt::SubmittableExtrinsic { + let call = StopRepeat {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_lottery::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct LotteryStarted {} + impl ::subxt::Event for LotteryStarted { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "LotteryStarted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CallsUpdated {} + impl ::subxt::Event for CallsUpdated { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "CallsUpdated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Winner( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for Winner { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "Winner"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TicketBought( + pub ::subxt::sp_core::crypto::AccountId32, + pub (::core::primitive::u8, ::core::primitive::u8), + ); + impl ::subxt::Event for TicketBought { + const PALLET: &'static str = "Lottery"; + const EVENT: &'static str = "TicketBought"; + } + } + pub mod storage { + use super::runtime_types; + pub struct LotteryIndex; + impl ::subxt::StorageEntry for LotteryIndex { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "LotteryIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Lottery; + impl ::subxt::StorageEntry for Lottery { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "Lottery"; + type Value = runtime_types::pallet_lottery::LotteryConfig< + ::core::primitive::u32, + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Participants(pub ::subxt::sp_core::crypto::AccountId32); + impl ::subxt::StorageEntry for Participants { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "Participants"; + type Value = ( + ::core::primitive::u32, + Vec<(::core::primitive::u8, ::core::primitive::u8)>, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct TicketsCount; + impl ::subxt::StorageEntry for TicketsCount { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "TicketsCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Tickets(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Tickets { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "Tickets"; + 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 CallIndices; + impl ::subxt::StorageEntry for CallIndices { + const PALLET: &'static str = "Lottery"; + const STORAGE: &'static str = "CallIndices"; + type Value = Vec<(::core::primitive::u8, ::core::primitive::u8)>; + 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 lottery_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = LotteryIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn lottery( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_lottery::LotteryConfig< + ::core::primitive::u32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Lottery; + self.client.storage().fetch(&entry, hash).await + } + pub async fn participants( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ( + ::core::primitive::u32, + Vec<(::core::primitive::u8, ::core::primitive::u8)>, + ), + ::subxt::Error, + > { + let entry = Participants(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn participants_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Participants>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn tickets_count( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = TicketsCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn tickets( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + ::subxt::Error, + > { + let entry = Tickets(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn tickets_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Tickets>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn call_indices( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::core::primitive::u8, ::core::primitive::u8)>, + ::subxt::Error, + > { + let entry = CallIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod gilt { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PlaceBid { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub duration: ::core::primitive::u32, + } + impl ::subxt::Call for PlaceBid { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "place_bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RetractBid { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub duration: ::core::primitive::u32, + } + impl ::subxt::Call for RetractBid { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "retract_bid"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetTarget { + #[codec(compact)] + pub target: ::subxt::sp_arithmetic::per_things::Perquintill, + } + impl ::subxt::Call for SetTarget { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "set_target"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thaw { + #[codec(compact)] + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Thaw { + const PALLET: &'static str = "Gilt"; + const FUNCTION: &'static str = "thaw"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn place_bid( + &self, + amount: ::core::primitive::u128, + duration: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = PlaceBid { amount, duration }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn retract_bid( + &self, + amount: ::core::primitive::u128, + duration: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = RetractBid { amount, duration }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_target( + &self, + target: ::subxt::sp_arithmetic::per_things::Perquintill, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetTarget { target }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Thaw { index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_gilt::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BidPlaced( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for BidPlaced { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "BidPlaced"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BidRetracted( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for BidRetracted { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "BidRetracted"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct GiltIssued( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for GiltIssued { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "GiltIssued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct GiltThawed( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + pub ::core::primitive::u128, + ); + impl ::subxt::Event for GiltThawed { + const PALLET: &'static str = "Gilt"; + const EVENT: &'static str = "GiltThawed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct QueueTotals; + impl ::subxt::StorageEntry for QueueTotals { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "QueueTotals"; + type Value = Vec<(::core::primitive::u32, ::core::primitive::u128)>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Queues(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Queues { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "Queues"; + type Value = Vec< + runtime_types::pallet_gilt::pallet::GiltBid< + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct ActiveTotal; + impl ::subxt::StorageEntry for ActiveTotal { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "ActiveTotal"; + type Value = runtime_types::pallet_gilt::pallet::ActiveGiltsTotal< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Active(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Active { + const PALLET: &'static str = "Gilt"; + const STORAGE: &'static str = "Active"; + type Value = runtime_types::pallet_gilt::pallet::ActiveGilt< + ::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::Blake2_128Concat, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn queue_totals( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec<(::core::primitive::u32, ::core::primitive::u128)>, + ::subxt::Error, + > { + let entry = QueueTotals; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queues( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec< + runtime_types::pallet_gilt::pallet::GiltBid< + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + >, + >, + ::subxt::Error, + > { + let entry = Queues(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn queues_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Queues>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn active_total( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_gilt::pallet::ActiveGiltsTotal< + ::core::primitive::u128, + >, + ::subxt::Error, + > { + let entry = ActiveTotal; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn active( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_gilt::pallet::ActiveGilt< + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ::subxt::Error, + > { + let entry = Active(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn active_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Active>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + } + } + } + pub mod uniques { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Create { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for Create { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "create"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreate { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub free_holding: ::core::primitive::bool, + } + impl ::subxt::Call for ForceCreate { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "force_create"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroy { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub witness: runtime_types::pallet_uniques::types::DestroyWitness, + } + impl ::subxt::Call for Destroy { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "destroy"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Mint { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for Mint { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "mint"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burn { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + pub check_owner: ::core::option::Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + } + impl ::subxt::Call for Burn { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "burn"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transfer { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + pub dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for Transfer { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Redeposit { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub instances: Vec<::core::primitive::u32>, + } + impl ::subxt::Call for Redeposit { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "redeposit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Freeze { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + } + impl ::subxt::Call for Freeze { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "freeze"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thaw { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + } + impl ::subxt::Call for Thaw { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "thaw"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct FreezeClass { + #[codec(compact)] + pub class: ::core::primitive::u32, + } + impl ::subxt::Call for FreezeClass { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "freeze_class"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ThawClass { + #[codec(compact)] + pub class: ::core::primitive::u32, + } + impl ::subxt::Call for ThawClass { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "thaw_class"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransferOwnership { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for TransferOwnership { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "transfer_ownership"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetTeam { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for SetTeam { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_team"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApproveTransfer { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + pub delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + impl ::subxt::Call for ApproveTransfer { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "approve_transfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CancelApproval { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + pub maybe_check_delegate: ::core::option::Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + } + impl ::subxt::Call for CancelApproval { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "cancel_approval"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceAssetStatus { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub free_holding: ::core::primitive::bool, + pub is_frozen: ::core::primitive::bool, + } + impl ::subxt::Call for ForceAssetStatus { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "force_asset_status"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetAttribute { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub maybe_instance: ::core::option::Option<::core::primitive::u32>, + pub key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub value: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + impl ::subxt::Call for SetAttribute { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_attribute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearAttribute { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub maybe_instance: ::core::option::Option<::core::primitive::u32>, + pub key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + impl ::subxt::Call for ClearAttribute { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "clear_attribute"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetMetadata { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + pub data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub is_frozen: ::core::primitive::bool, + } + impl ::subxt::Call for SetMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearMetadata { + #[codec(compact)] + pub class: ::core::primitive::u32, + #[codec(compact)] + pub instance: ::core::primitive::u32, + } + impl ::subxt::Call for ClearMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "clear_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SetClassMetadata { + #[codec(compact)] + pub class: ::core::primitive::u32, + pub data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub is_frozen: ::core::primitive::bool, + } + impl ::subxt::Call for SetClassMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "set_class_metadata"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClearClassMetadata { + #[codec(compact)] + pub class: ::core::primitive::u32, + } + impl ::subxt::Call for ClearClassMetadata { + const PALLET: &'static str = "Uniques"; + const FUNCTION: &'static str = "clear_class_metadata"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn create( + &self, + class: ::core::primitive::u32, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Create { class, admin }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_create( + &self, + class: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + free_holding: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceCreate { + class, + owner, + free_holding, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn destroy( + &self, + class: ::core::primitive::u32, + witness: runtime_types::pallet_uniques::types::DestroyWitness, + ) -> ::subxt::SubmittableExtrinsic { + let call = Destroy { class, witness }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn mint( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Mint { + class, + instance, + owner, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn burn( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + check_owner: ::core::option::Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Burn { + class, + instance, + check_owner, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = Transfer { + class, + instance, + dest, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn redeposit( + &self, + class: ::core::primitive::u32, + instances: Vec<::core::primitive::u32>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Redeposit { class, instances }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Freeze { class, instance }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Thaw { class, instance }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn freeze_class( + &self, + class: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = FreezeClass { class }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn thaw_class( + &self, + class: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ThawClass { class }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn transfer_ownership( + &self, + class: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = TransferOwnership { class, owner }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_team( + &self, + class: ::core::primitive::u32, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetTeam { + class, + issuer, + admin, + freezer, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn approve_transfer( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ApproveTransfer { + class, + instance, + delegate, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn cancel_approval( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + maybe_check_delegate: ::core::option::Option< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = CancelApproval { + class, + instance, + maybe_check_delegate, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn force_asset_status( + &self, + class: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + free_holding: ::core::primitive::bool, + is_frozen: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = ForceAssetStatus { + class, + owner, + issuer, + admin, + freezer, + free_holding, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_attribute( + &self, + class: ::core::primitive::u32, + maybe_instance: ::core::option::Option<::core::primitive::u32>, + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + value: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetAttribute { + class, + maybe_instance, + key, + value, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_attribute( + &self, + class: ::core::primitive::u32, + maybe_instance: ::core::option::Option<::core::primitive::u32>, + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearAttribute { + class, + maybe_instance, + key, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_metadata( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + is_frozen: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetMetadata { + class, + instance, + data, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_metadata( + &self, + class: ::core::primitive::u32, + instance: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = ClearMetadata { class, instance }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_class_metadata( + &self, + class: ::core::primitive::u32, + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + is_frozen: ::core::primitive::bool, + ) -> ::subxt::SubmittableExtrinsic { + let call = SetClassMetadata { + class, + data, + is_frozen, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn clear_class_metadata( + &self, + class: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic + { + let call = ClearClassMetadata { class }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_uniques::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Created( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Created { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Created"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ForceCreated( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ForceCreated { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ForceCreated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Destroyed(pub ::core::primitive::u32); + impl ::subxt::Event for Destroyed { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Destroyed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Issued( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Issued { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Issued"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Transferred( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Transferred { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Transferred"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Burned( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for Burned { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Burned"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Frozen(pub ::core::primitive::u32, pub ::core::primitive::u32); + impl ::subxt::Event for Frozen { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Frozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Thawed(pub ::core::primitive::u32, pub ::core::primitive::u32); + impl ::subxt::Event for Thawed { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Thawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassFrozen(pub ::core::primitive::u32); + impl ::subxt::Event for ClassFrozen { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassFrozen"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassThawed(pub ::core::primitive::u32); + impl ::subxt::Event for ClassThawed { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassThawed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OwnerChanged( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for OwnerChanged { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "OwnerChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TeamChanged( + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for TeamChanged { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "TeamChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovedTransfer( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ApprovedTransfer { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ApprovedTransfer"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ApprovalCancelled( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub ::subxt::sp_core::crypto::AccountId32, + pub ::subxt::sp_core::crypto::AccountId32, + ); + impl ::subxt::Event for ApprovalCancelled { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ApprovalCancelled"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetStatusChanged(pub ::core::primitive::u32); + impl ::subxt::Event for AssetStatusChanged { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "AssetStatusChanged"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassMetadataSet( + pub ::core::primitive::u32, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for ClassMetadataSet { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassMetadataSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassMetadataCleared(pub ::core::primitive::u32); + impl ::subxt::Event for ClassMetadataCleared { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "ClassMetadataCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataSet( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub ::core::primitive::bool, + ); + impl ::subxt::Event for MetadataSet { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "MetadataSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MetadataCleared( + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::Event for MetadataCleared { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "MetadataCleared"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Redeposited( + pub ::core::primitive::u32, + pub Vec<::core::primitive::u32>, + ); + impl ::subxt::Event for Redeposited { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "Redeposited"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AttributeSet( + pub ::core::primitive::u32, + pub ::core::option::Option<::core::primitive::u32>, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ); + impl ::subxt::Event for AttributeSet { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "AttributeSet"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AttributeCleared( + pub ::core::primitive::u32, + pub ::core::option::Option<::core::primitive::u32>, + pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ); + impl ::subxt::Event for AttributeCleared { + const PALLET: &'static str = "Uniques"; + const EVENT: &'static str = "AttributeCleared"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Class(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Class { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Class"; + type Value = runtime_types::pallet_uniques::types::ClassDetails< + ::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 Account( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for Account { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Account"; + type Value = (); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.2, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Asset(::core::primitive::u32, ::core::primitive::u32); + impl ::subxt::StorageEntry for Asset { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Asset"; + type Value = runtime_types::pallet_uniques::types::InstanceDetails< + ::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, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct ClassMetadataOf(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ClassMetadataOf { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "ClassMetadataOf"; + type Value = runtime_types::pallet_uniques::types::ClassMetadata< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct InstanceMetadataOf(::core::primitive::u32, ::core::primitive::u32); + impl ::subxt::StorageEntry for InstanceMetadataOf { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "InstanceMetadataOf"; + type Value = runtime_types::pallet_uniques::types::InstanceMetadata< + ::core::primitive::u128, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Attribute( + ::core::primitive::u32, + ::core::option::Option<::core::primitive::u32>, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ); + impl ::subxt::StorageEntry for Attribute { + const PALLET: &'static str = "Uniques"; + const STORAGE: &'static str = "Attribute"; + type Value = ( + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ::core::primitive::u128, + ); + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ::subxt::StorageMapKey::new( + &self.2, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn class( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::ClassDetails< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Class(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn class_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Class>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn account( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + _1: ::core::primitive::u32, + _2: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> + { + let entry = Account(_0, _1, _2); + self.client.storage().fetch(&entry, hash).await + } + pub async fn account_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Account>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn asset( + &self, + _0: ::core::primitive::u32, + _1: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::InstanceDetails< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = Asset(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn asset_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> + { + self.client.storage().iter(hash).await + } + pub async fn class_metadata_of( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::ClassMetadata< + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = ClassMetadataOf(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn class_metadata_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ClassMetadataOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn instance_metadata_of( + &self, + _0: ::core::primitive::u32, + _1: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::pallet_uniques::types::InstanceMetadata< + ::core::primitive::u128, + >, + >, + ::subxt::Error, + > { + let entry = InstanceMetadataOf(_0, _1); + self.client.storage().fetch(&entry, hash).await + } + pub async fn instance_metadata_of_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, InstanceMetadataOf>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn attribute( + &self, + _0: ::core::primitive::u32, + _1: ::core::option::Option<::core::primitive::u32>, + _2: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<( + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ::core::primitive::u128, + )>, + ::subxt::Error, + > { + let entry = Attribute(_0, _1, _2); + self.client.storage().fetch(&entry, hash).await + } + pub async fn attribute_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Attribute>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod transaction_storage { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Store { + pub data: Vec<::core::primitive::u8>, + } + impl ::subxt::Call for Store { + const PALLET: &'static str = "TransactionStorage"; + const FUNCTION: &'static str = "store"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Renew { + pub block: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::Call for Renew { + const PALLET: &'static str = "TransactionStorage"; + const FUNCTION: &'static str = "renew"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct CheckProof { + pub proof: + runtime_types::sp_transaction_storage_proof::TransactionStorageProof, + } + impl ::subxt::Call for CheckProof { + const PALLET: &'static str = "TransactionStorage"; + const FUNCTION: &'static str = "check_proof"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn store( + &self, + data: Vec<::core::primitive::u8>, + ) -> ::subxt::SubmittableExtrinsic { + let call = Store { data }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn renew( + &self, + block: ::core::primitive::u32, + index: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Renew { block, index }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn check_proof( + &self, + proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof, + ) -> ::subxt::SubmittableExtrinsic { + let call = CheckProof { proof }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_transaction_storage::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Stored(pub ::core::primitive::u32); + impl ::subxt::Event for Stored { + const PALLET: &'static str = "TransactionStorage"; + const EVENT: &'static str = "Stored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Renewed(pub ::core::primitive::u32); + impl ::subxt::Event for Renewed { + const PALLET: &'static str = "TransactionStorage"; + const EVENT: &'static str = "Renewed"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProofChecked {} + impl ::subxt::Event for ProofChecked { + const PALLET: &'static str = "TransactionStorage"; + const EVENT: &'static str = "ProofChecked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Transactions(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for Transactions { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "Transactions"; + type Value = + Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct ChunkCount(pub ::core::primitive::u32); + impl ::subxt::StorageEntry for ChunkCount { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "ChunkCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Blake2_128Concat, + )]) + } + } + pub struct ByteFee; + impl ::subxt::StorageEntry for ByteFee { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "ByteFee"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EntryFee; + impl ::subxt::StorageEntry for EntryFee { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "EntryFee"; + type Value = ::core::primitive::u128; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MaxTransactionSize; + impl ::subxt::StorageEntry for MaxTransactionSize { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "MaxTransactionSize"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct MaxBlockTransactions; + impl ::subxt::StorageEntry for MaxBlockTransactions { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "MaxBlockTransactions"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StoragePeriod; + impl ::subxt::StorageEntry for StoragePeriod { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "StoragePeriod"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct BlockTransactions; + impl ::subxt::StorageEntry for BlockTransactions { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "BlockTransactions"; + type Value = + Vec; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ProofChecked; + impl ::subxt::StorageEntry for ProofChecked { + const PALLET: &'static str = "TransactionStorage"; + const STORAGE: &'static str = "ProofChecked"; + type Value = ::core::primitive::bool; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn transactions( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + Vec, + >, + ::subxt::Error, + > { + let entry = Transactions(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn transactions_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, Transactions>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn chunk_count( + &self, + _0: ::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = ChunkCount(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn chunk_count_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ChunkCount>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn byte_fee( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::Error, + > { + let entry = ByteFee; + self.client.storage().fetch(&entry, hash).await + } + pub async fn entry_fee( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u128>, + ::subxt::Error, + > { + let entry = EntryFee; + self.client.storage().fetch(&entry, hash).await + } + pub async fn max_transaction_size( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = MaxTransactionSize; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn max_block_transactions( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = MaxBlockTransactions; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn storage_period( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = StoragePeriod; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn block_transactions( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + Vec, + ::subxt::Error, + > { + let entry = BlockTransactions; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn proof_checked( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> + { + let entry = ProofChecked; + self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + } + pub mod bags_list { + use super::runtime_types; + pub mod calls { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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"; + } + pub struct TransactionApi< + 'a, + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + > { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub fn rebag( + &self, + dislocated: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic { + let call = Rebag { dislocated }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_bags_list::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Rebagged( + pub ::subxt::sp_core::crypto::AccountId32, + pub ::core::primitive::u64, + pub ::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 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 ListNodes(pub ::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 ListBags(pub ::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 } + } + pub async fn counter_for_list_nodes( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> + { + let entry = CounterForListNodes; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn list_nodes( + &self, + _0: ::subxt::sp_core::crypto::AccountId32, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ListNodes(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn list_nodes_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ListNodes>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + pub async fn list_bags( + &self, + _0: ::core::primitive::u64, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option, + ::subxt::Error, + > { + let entry = ListBags(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn list_bags_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ListBags>, + ::subxt::Error, + > { + self.client.storage().iter(hash).await + } + } + } + } + pub mod runtime_types { + use super::runtime_types; + pub mod finality_grandpa { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct Precommit<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Prevote<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + } + pub mod frame_support { + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct BoundedBTreeMap<_0, _1>( + pub ::std::collections::BTreeMap<_0, _1>, + ); + } + pub mod bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct BoundedVec<_0>(pub Vec<_0>); + } + pub mod weak_bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct WeakBoundedVec<_0>(pub Vec<_0>); + } + } + pub mod traits { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct WrapperKeepOpaque<_0>(::core::primitive::u32, pub _0); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct WrapperOpaque<_0>(::core::primitive::u32, pub _0); + } + pub mod tokens { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub enum BalanceStatus { + Free, + Reserved, + } + } + } + } + pub mod weights { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum DispatchClass { + Normal, + Operational, + Mandatory, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum Pays { + Yes, + No, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PerDispatchClass<_0> { + pub normal: _0, + pub operational: _0, + pub mandatory: _0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RuntimeDbWeight { + pub read: ::core::primitive::u64, + pub write: ::core::primitive::u64, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct WeightToFeeCoefficient<_0> { + pub coeff_integer: _0, + pub coeff_frac: ::subxt::sp_arithmetic::per_things::Perbill, + pub negative: ::core::primitive::bool, + pub degree: ::core::primitive::u8, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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, + )] + pub struct CheckGenesis {} + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckMortality( + pub runtime_types::sp_runtime::generic::era::Era, + ); + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckNonce(pub ::core::primitive::u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckSpecVersion {} + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckTxVersion {} + } + pub mod check_weight { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct CheckWeight {} + } + } + pub mod limits { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BlockLength { + pub max: runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u32, + >, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub enum Call { + fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : Vec < :: core :: primitive :: u8 > , } , set_heap_pages { pages : :: core :: primitive :: u64 , } , set_code { code : Vec < :: core :: primitive :: u8 > , } , set_code_without_checks { code : Vec < :: core :: primitive :: u8 > , } , set_changes_trie_config { changes_trie_config : :: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : Vec < (Vec < :: core :: primitive :: u8 > , Vec < :: core :: primitive :: u8 > ,) > , } , kill_storage { keys : Vec < Vec < :: core :: primitive :: u8 > > , } , kill_prefix { prefix : Vec < :: core :: primitive :: u8 > , subkeys : :: core :: primitive :: u32 , } , remark_with_event { remark : Vec < :: core :: primitive :: u8 > , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidSpecName, + SpecVersionNeedsToIncrease, + FailedToExtractRuntimeVersion, + NonDefaultComposite, + NonZeroRefCount, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), + ExtrinsicFailed( + runtime_types::sp_runtime::DispatchError, + runtime_types::frame_support::weights::DispatchInfo, + ), + CodeUpdated, + NewAccount(::subxt::sp_core::crypto::AccountId32), + KilledAccount(::subxt::sp_core::crypto::AccountId32), + Remarked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: Vec<_1>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: ::core::primitive::u32, + pub spec_name: ::alloc::string::String, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Phase { + ApplyExtrinsic(::core::primitive::u32), + Finalization, + Initialization, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum RawOrigin<_0> { + Root, + Signed(_0), + None, + } + } + pub mod node_runtime { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + System(runtime_types::frame_system::pallet::Call), + Utility(runtime_types::pallet_utility::pallet::Call), + Babe(runtime_types::pallet_babe::pallet::Call), + Timestamp(runtime_types::pallet_timestamp::pallet::Call), + Authorship(runtime_types::pallet_authorship::pallet::Call), + Indices(runtime_types::pallet_indices::pallet::Call), + Balances(runtime_types::pallet_balances::pallet::Call), + ElectionProviderMultiPhase( + runtime_types::pallet_election_provider_multi_phase::pallet::Call, + ), + Staking(runtime_types::pallet_staking::pallet::pallet::Call), + Session(runtime_types::pallet_session::pallet::Call), + Democracy(runtime_types::pallet_democracy::pallet::Call), + Council(runtime_types::pallet_collective::pallet::Call), + TechnicalCommittee(runtime_types::pallet_collective::pallet::Call), + Elections(runtime_types::pallet_elections_phragmen::pallet::Call), + TechnicalMembership(runtime_types::pallet_membership::pallet::Call), + Grandpa(runtime_types::pallet_grandpa::pallet::Call), + Treasury(runtime_types::pallet_treasury::pallet::Call), + Contracts(runtime_types::pallet_contracts::pallet::Call), + Sudo(runtime_types::pallet_sudo::pallet::Call), + ImOnline(runtime_types::pallet_im_online::pallet::Call), + Identity(runtime_types::pallet_identity::pallet::Call), + Society(runtime_types::pallet_society::pallet::Call), + Recovery(runtime_types::pallet_recovery::pallet::Call), + Vesting(runtime_types::pallet_vesting::pallet::Call), + Scheduler(runtime_types::pallet_scheduler::pallet::Call), + Proxy(runtime_types::pallet_proxy::pallet::Call), + Multisig(runtime_types::pallet_multisig::pallet::Call), + Bounties(runtime_types::pallet_bounties::pallet::Call), + Tips(runtime_types::pallet_tips::pallet::Call), + Assets(runtime_types::pallet_assets::pallet::Call), + Lottery(runtime_types::pallet_lottery::pallet::Call), + Gilt(runtime_types::pallet_gilt::pallet::Call), + Uniques(runtime_types::pallet_uniques::pallet::Call), + TransactionStorage( + runtime_types::pallet_transaction_storage::pallet::Call, + ), + BagsList(runtime_types::pallet_bags_list::pallet::Call), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + System(runtime_types::frame_system::pallet::Event), + Utility(runtime_types::pallet_utility::pallet::Event), + Indices(runtime_types::pallet_indices::pallet::Event), + Balances(runtime_types::pallet_balances::pallet::Event), + ElectionProviderMultiPhase( + runtime_types::pallet_election_provider_multi_phase::pallet::Event, + ), + Staking(runtime_types::pallet_staking::pallet::pallet::Event), + Session(runtime_types::pallet_session::pallet::Event), + Democracy(runtime_types::pallet_democracy::pallet::Event), + Council(runtime_types::pallet_collective::pallet::Event), + TechnicalCommittee(runtime_types::pallet_collective::pallet::Event), + Elections(runtime_types::pallet_elections_phragmen::pallet::Event), + TechnicalMembership(runtime_types::pallet_membership::pallet::Event), + Grandpa(runtime_types::pallet_grandpa::pallet::Event), + Treasury(runtime_types::pallet_treasury::pallet::Event), + Contracts(runtime_types::pallet_contracts::pallet::Event), + Sudo(runtime_types::pallet_sudo::pallet::Event), + ImOnline(runtime_types::pallet_im_online::pallet::Event), + Offences(runtime_types::pallet_offences::pallet::Event), + Identity(runtime_types::pallet_identity::pallet::Event), + Society(runtime_types::pallet_society::pallet::Event), + Recovery(runtime_types::pallet_recovery::pallet::Event), + Vesting(runtime_types::pallet_vesting::pallet::Event), + Scheduler(runtime_types::pallet_scheduler::pallet::Event), + Proxy(runtime_types::pallet_proxy::pallet::Event), + Multisig(runtime_types::pallet_multisig::pallet::Event), + Bounties(runtime_types::pallet_bounties::pallet::Event), + Tips(runtime_types::pallet_tips::pallet::Event), + Assets(runtime_types::pallet_assets::pallet::Event), + Lottery(runtime_types::pallet_lottery::pallet::Event), + Gilt(runtime_types::pallet_gilt::pallet::Event), + Uniques(runtime_types::pallet_uniques::pallet::Event), + TransactionStorage( + runtime_types::pallet_transaction_storage::pallet::Event, + ), + BagsList(runtime_types::pallet_bags_list::pallet::Event), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct NposSolution16 { + votes1: Vec<(::core::primitive::u32, ::core::primitive::u16)>, + votes2: Vec<( + ::core::primitive::u32, + ( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ), + ::core::primitive::u16, + )>, + votes3: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 2usize], + ::core::primitive::u16, + )>, + votes4: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 3usize], + ::core::primitive::u16, + )>, + votes5: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 4usize], + ::core::primitive::u16, + )>, + votes6: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 5usize], + ::core::primitive::u16, + )>, + votes7: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 6usize], + ::core::primitive::u16, + )>, + votes8: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 7usize], + ::core::primitive::u16, + )>, + votes9: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 8usize], + ::core::primitive::u16, + )>, + votes10: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 9usize], + ::core::primitive::u16, + )>, + votes11: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 10usize], + ::core::primitive::u16, + )>, + votes12: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 11usize], + ::core::primitive::u16, + )>, + votes13: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 12usize], + ::core::primitive::u16, + )>, + votes14: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 13usize], + ::core::primitive::u16, + )>, + votes15: Vec<( + ::core::primitive::u32, + [( + ::core::primitive::u16, + runtime_types::sp_arithmetic::per_things::PerU16, + ); 14usize], + ::core::primitive::u16, + )>, + votes16: 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)] + pub enum OriginCaller { + system( + runtime_types::frame_system::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + Council( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + TechnicalCommittee( + runtime_types::pallet_collective::RawOrigin< + ::subxt::sp_core::crypto::AccountId32, + >, + ), + Void(runtime_types::sp_core::Void), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum ProxyType { + Any, + NonTransfer, + Governance, + Staking, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Runtime {} + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 authority_discovery: + runtime_types::sp_authority_discovery::app::Public, + } + } + pub mod pallet_assets { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + create { + #[codec(compact)] + id: ::core::primitive::u32, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + min_balance: ::core::primitive::u64, + }, + force_create { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + is_sufficient: ::core::primitive::bool, + #[codec(compact)] + min_balance: ::core::primitive::u64, + }, + destroy { + #[codec(compact)] + id: ::core::primitive::u32, + witness: runtime_types::pallet_assets::types::DestroyWitness, + }, + mint { + #[codec(compact)] + id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + burn { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + transfer { + #[codec(compact)] + id: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + transfer_keep_alive { + #[codec(compact)] + id: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + force_transfer { + #[codec(compact)] + id: ::core::primitive::u32, + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + freeze { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + thaw { + #[codec(compact)] + id: ::core::primitive::u32, + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + freeze_asset { + #[codec(compact)] + id: ::core::primitive::u32, + }, + thaw_asset { + #[codec(compact)] + id: ::core::primitive::u32, + }, + transfer_ownership { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + set_team { + #[codec(compact)] + id: ::core::primitive::u32, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + set_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + name: Vec<::core::primitive::u8>, + symbol: Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, + }, + clear_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + }, + force_set_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + name: Vec<::core::primitive::u8>, + symbol: Vec<::core::primitive::u8>, + decimals: ::core::primitive::u8, + is_frozen: ::core::primitive::bool, + }, + force_clear_metadata { + #[codec(compact)] + id: ::core::primitive::u32, + }, + force_asset_status { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + issuer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + admin: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + freezer: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + min_balance: ::core::primitive::u64, + is_sufficient: ::core::primitive::bool, + is_frozen: ::core::primitive::bool, + }, + approve_transfer { + #[codec(compact)] + id: ::core::primitive::u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + cancel_approval { + #[codec(compact)] + id: ::core::primitive::u32, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + force_cancel_approval { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + delegate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + transfer_approved { + #[codec(compact)] + id: ::core::primitive::u32, + owner: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + destination: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + amount: ::core::primitive::u64, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + BalanceLow, + BalanceZero, + NoPermission, + Unknown, + Frozen, + InUse, + BadWitness, + MinBalanceZero, + NoProvider, + BadMetadata, + Unapproved, + WouldDie, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Created( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + Issued( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ), + Transferred( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ), + Burned( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ), + TeamChanged( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + OwnerChanged( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + Frozen( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + Thawed( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + AssetFrozen(::core::primitive::u32), + AssetThawed(::core::primitive::u32), + Destroyed(::core::primitive::u32), + ForceCreated( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + MetadataSet( + ::core::primitive::u32, + Vec<::core::primitive::u8>, + Vec<::core::primitive::u8>, + ::core::primitive::u8, + ::core::primitive::bool, + ), + MetadataCleared(::core::primitive::u32), + ApprovedTransfer( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ), + ApprovalCancelled( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + TransferredApproved( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ), + AssetStatusChanged(::core::primitive::u32), + } + } + pub mod types { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Approval<_0, _1> { + pub amount: _0, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetBalance<_0, _1> { + pub balance: _0, + pub is_frozen: ::core::primitive::bool, + pub sufficient: ::core::primitive::bool, + pub extra: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetDetails<_0, _1, _2> { + pub owner: _1, + pub issuer: _1, + pub admin: _1, + pub freezer: _1, + pub supply: _0, + pub deposit: _2, + pub min_balance: _0, + pub is_sufficient: ::core::primitive::bool, + pub accounts: ::core::primitive::u32, + pub sufficients: ::core::primitive::u32, + pub approvals: ::core::primitive::u32, + pub is_frozen: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AssetMetadata<_0, _1> { + pub deposit: _0, + pub name: _1, + pub symbol: _1, + pub decimals: ::core::primitive::u8, + pub is_frozen: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DestroyWitness { + #[codec(compact)] + pub accounts: ::core::primitive::u32, + #[codec(compact)] + pub sufficients: ::core::primitive::u32, + #[codec(compact)] + pub approvals: ::core::primitive::u32, + } + } + } + pub mod pallet_authorship { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + set_uncles { + new_uncles: Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidUncleParent, + UnclesAlreadySet, + TooManyUncles, + GenesisUncle, + TooHighUncle, + UncleAlreadyIncluded, + OldUncle, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum UncleEntryItem<_0, _1, _2> { + InclusionHeight(_0), + 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)] + pub enum Call { + 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 , } , 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 , } , plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidEquivocationProof, + InvalidKeyOwnershipProof, + DuplicateOffenceReport, + } + } + } + pub mod pallet_bags_list { + use super::runtime_types; + pub mod list { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub enum Call { + rebag { + dislocated: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Rebagged( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + ::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)] + pub enum Call { + transfer { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + set_balance { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + new_free: ::core::primitive::u128, + #[codec(compact)] + new_reserved: ::core::primitive::u128, + }, + force_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + transfer_keep_alive { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + transfer_all { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + }, + force_unreserve { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + amount: ::core::primitive::u128, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + VestingBalance, + LiquidityRestrictions, + InsufficientBalance, + ExistentialDeposit, + KeepAlive, + ExistingVestingSchedule, + DeadAccount, + TooManyReserves, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Endowed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + DustLost( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Transfer( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + BalanceSet( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u128, + ), + Reserved( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Unreserved( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + ReserveRepatriated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + ), + Deposit( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Withdraw( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Slashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub enum Reasons { + Fee, + Misc, + All, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1_0_0, + V2_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum Call { + propose_bounty { + #[codec(compact)] + value: ::core::primitive::u128, + description: Vec<::core::primitive::u8>, + }, + approve_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + propose_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + unassign_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + accept_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + award_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + claim_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + close_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + extend_bounty_expiry { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + remark: Vec<::core::primitive::u8>, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InsufficientProposersBalance, + InvalidIndex, + ReasonTooBig, + UnexpectedStatus, + RequireCurator, + InvalidValue, + InvalidFee, + PendingPayout, + Premature, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + BountyProposed(::core::primitive::u32), + BountyRejected(::core::primitive::u32, ::core::primitive::u128), + BountyBecameActive(::core::primitive::u32), + BountyAwarded( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + BountyClaimed( + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + BountyCanceled(::core::primitive::u32), + BountyExtended(::core::primitive::u32), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum BountyStatus<_0, _1> { + Proposed, + Approved, + Funded, + CuratorProposed { + curator: _0, + }, + Active { + curator: _0, + update_due: _1, + }, + 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)] + pub enum Call { + set_members { + new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + prime: + ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + }, + execute { + proposal: ::std::boxed::Box, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + propose { + #[codec(compact)] + threshold: ::core::primitive::u32, + proposal: ::std::boxed::Box, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + vote { + proposal: ::subxt::sp_core::H256, + #[codec(compact)] + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + }, + 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, + }, + disapprove_proposal { + proposal_hash: ::subxt::sp_core::H256, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotMember, + DuplicateProposal, + ProposalMissing, + WrongIndex, + DuplicateVote, + AlreadyInitialized, + TooEarly, + TooManyProposals, + WrongProposalWeight, + WrongProposalLength, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Proposed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ::subxt::sp_core::H256, + ::core::primitive::u32, + ), + Voted( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ::core::primitive::bool, + ::core::primitive::u32, + ::core::primitive::u32, + ), + Approved(::subxt::sp_core::H256), + Disapproved(::subxt::sp_core::H256), + Executed( + ::subxt::sp_core::H256, + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + MemberExecuted( + ::subxt::sp_core::H256, + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + Closed( + ::subxt::sp_core::H256, + ::core::primitive::u32, + ::core::primitive::u32, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum RawOrigin<_0> { + Members(::core::primitive::u32, ::core::primitive::u32), + Member(_0), + _Phantom, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Votes<_0, _1> { + pub index: _1, + pub threshold: _1, + pub ayes: Vec<_0>, + pub nays: Vec<_0>, + pub end: _1, + } + } + pub mod pallet_contracts { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + call { + dest: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + value: ::core::primitive::u128, + #[codec(compact)] + gas_limit: ::core::primitive::u64, + data: Vec<::core::primitive::u8>, + }, + instantiate_with_code { + #[codec(compact)] + endowment: ::core::primitive::u128, + #[codec(compact)] + gas_limit: ::core::primitive::u64, + code: Vec<::core::primitive::u8>, + data: Vec<::core::primitive::u8>, + salt: Vec<::core::primitive::u8>, + }, + instantiate { + #[codec(compact)] + endowment: ::core::primitive::u128, + #[codec(compact)] + gas_limit: ::core::primitive::u64, + code_hash: ::subxt::sp_core::H256, + data: Vec<::core::primitive::u8>, + salt: Vec<::core::primitive::u8>, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidScheduleVersion, + OutOfGas, + OutputBufferTooSmall, + BelowSubsistenceThreshold, + NewContractNotFunded, + TransferFailed, + MaxCallDepthReached, + ContractNotFound, + CodeTooLarge, + CodeNotFound, + OutOfBounds, + DecodingFailed, + ContractTrapped, + ValueTooLarge, + TerminatedWhileReentrant, + InputForwarded, + RandomSubjectTooLong, + TooManyTopics, + DuplicateTopics, + NoChainExtension, + DeletionQueueFull, + StorageExhausted, + DuplicateContract, + TerminatedInConstructor, + DebugMessageInvalidUTF8, + ReentranceDenied, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Instantiated { + deployer: ::subxt::sp_core::crypto::AccountId32, + contract: ::subxt::sp_core::crypto::AccountId32, + }, + Terminated { + contract: ::subxt::sp_core::crypto::AccountId32, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + CodeStored { + code_hash: ::subxt::sp_core::H256, + }, + ScheduleUpdated { + version: ::core::primitive::u32, + }, + ContractEmitted { + contract: ::subxt::sp_core::crypto::AccountId32, + data: Vec<::core::primitive::u8>, + }, + CodeRemoved { + code_hash: ::subxt::sp_core::H256, + }, + } + } + pub mod schedule { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct HostFnWeights { + pub caller: ::core::primitive::u64, + pub address: ::core::primitive::u64, + pub gas_left: ::core::primitive::u64, + pub balance: ::core::primitive::u64, + pub value_transferred: ::core::primitive::u64, + pub minimum_balance: ::core::primitive::u64, + pub contract_deposit: ::core::primitive::u64, + pub block_number: ::core::primitive::u64, + pub now: ::core::primitive::u64, + pub weight_to_fee: ::core::primitive::u64, + pub gas: ::core::primitive::u64, + pub input: ::core::primitive::u64, + pub input_per_byte: ::core::primitive::u64, + pub r#return: ::core::primitive::u64, + pub return_per_byte: ::core::primitive::u64, + pub terminate: ::core::primitive::u64, + pub random: ::core::primitive::u64, + pub deposit_event: ::core::primitive::u64, + pub deposit_event_per_topic: ::core::primitive::u64, + pub deposit_event_per_byte: ::core::primitive::u64, + pub debug_message: ::core::primitive::u64, + pub set_storage: ::core::primitive::u64, + pub set_storage_per_byte: ::core::primitive::u64, + pub clear_storage: ::core::primitive::u64, + pub get_storage: ::core::primitive::u64, + pub get_storage_per_byte: ::core::primitive::u64, + pub transfer: ::core::primitive::u64, + pub call: ::core::primitive::u64, + pub call_transfer_surcharge: ::core::primitive::u64, + pub call_per_input_byte: ::core::primitive::u64, + pub call_per_output_byte: ::core::primitive::u64, + pub instantiate: ::core::primitive::u64, + pub instantiate_per_input_byte: ::core::primitive::u64, + pub instantiate_per_output_byte: ::core::primitive::u64, + pub instantiate_per_salt_byte: ::core::primitive::u64, + pub hash_sha2_256: ::core::primitive::u64, + pub hash_sha2_256_per_byte: ::core::primitive::u64, + pub hash_keccak_256: ::core::primitive::u64, + pub hash_keccak_256_per_byte: ::core::primitive::u64, + pub hash_blake2_256: ::core::primitive::u64, + pub hash_blake2_256_per_byte: ::core::primitive::u64, + pub hash_blake2_128: ::core::primitive::u64, + pub hash_blake2_128_per_byte: ::core::primitive::u64, + pub ecdsa_recover: ::core::primitive::u64, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstructionWeights { + pub version: ::core::primitive::u32, + pub i64const: ::core::primitive::u32, + pub i64load: ::core::primitive::u32, + pub i64store: ::core::primitive::u32, + pub select: ::core::primitive::u32, + pub r#if: ::core::primitive::u32, + pub br: ::core::primitive::u32, + pub br_if: ::core::primitive::u32, + pub br_table: ::core::primitive::u32, + pub br_table_per_entry: ::core::primitive::u32, + pub call: ::core::primitive::u32, + pub call_indirect: ::core::primitive::u32, + pub call_indirect_per_param: ::core::primitive::u32, + pub local_get: ::core::primitive::u32, + pub local_set: ::core::primitive::u32, + pub local_tee: ::core::primitive::u32, + pub global_get: ::core::primitive::u32, + pub global_set: ::core::primitive::u32, + pub memory_current: ::core::primitive::u32, + pub memory_grow: ::core::primitive::u32, + pub i64clz: ::core::primitive::u32, + pub i64ctz: ::core::primitive::u32, + pub i64popcnt: ::core::primitive::u32, + pub i64eqz: ::core::primitive::u32, + pub i64extendsi32: ::core::primitive::u32, + pub i64extendui32: ::core::primitive::u32, + pub i32wrapi64: ::core::primitive::u32, + pub i64eq: ::core::primitive::u32, + pub i64ne: ::core::primitive::u32, + pub i64lts: ::core::primitive::u32, + pub i64ltu: ::core::primitive::u32, + pub i64gts: ::core::primitive::u32, + pub i64gtu: ::core::primitive::u32, + pub i64les: ::core::primitive::u32, + pub i64leu: ::core::primitive::u32, + pub i64ges: ::core::primitive::u32, + pub i64geu: ::core::primitive::u32, + pub i64add: ::core::primitive::u32, + pub i64sub: ::core::primitive::u32, + pub i64mul: ::core::primitive::u32, + pub i64divs: ::core::primitive::u32, + pub i64divu: ::core::primitive::u32, + pub i64rems: ::core::primitive::u32, + pub i64remu: ::core::primitive::u32, + pub i64and: ::core::primitive::u32, + pub i64or: ::core::primitive::u32, + pub i64xor: ::core::primitive::u32, + pub i64shl: ::core::primitive::u32, + pub i64shrs: ::core::primitive::u32, + pub i64shru: ::core::primitive::u32, + pub i64rotl: ::core::primitive::u32, + pub i64rotr: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Limits { + pub event_topics: ::core::primitive::u32, + pub stack_height: ::core::primitive::u32, + pub globals: ::core::primitive::u32, + pub parameters: ::core::primitive::u32, + pub memory_pages: ::core::primitive::u32, + pub table_size: ::core::primitive::u32, + pub br_table_size: ::core::primitive::u32, + pub subject_len: ::core::primitive::u32, + pub call_depth: ::core::primitive::u32, + pub payload_len: ::core::primitive::u32, + pub code_len: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Schedule { + pub limits: runtime_types::pallet_contracts::schedule::Limits, + pub instruction_weights: + runtime_types::pallet_contracts::schedule::InstructionWeights, + pub host_fn_weights: + runtime_types::pallet_contracts::schedule::HostFnWeights, + } + } + pub mod storage { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DeletedContract { + pub trie_id: Vec<::core::primitive::u8>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RawContractInfo<_0> { + pub trie_id: Vec<::core::primitive::u8>, + pub code_hash: _0, + pub _reserved: ::core::option::Option<()>, + } + } + pub mod wasm { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PrefabWasmModule { + #[codec(compact)] + pub instruction_weights_version: ::core::primitive::u32, + #[codec(compact)] + pub initial: ::core::primitive::u32, + #[codec(compact)] + pub maximum: ::core::primitive::u32, + #[codec(compact)] + pub refcount: ::core::primitive::u64, + pub _reserved: ::core::option::Option<()>, + pub code: Vec<::core::primitive::u8>, + pub original_code_len: ::core::primitive::u32, + } + } + } + pub mod pallet_democracy { + use super::runtime_types; + pub mod conviction { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Conviction { + None, + Locked1x, + Locked2x, + Locked3x, + Locked4x, + Locked5x, + Locked6x, + } + } + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + propose { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + value: ::core::primitive::u128, + }, + second { + #[codec(compact)] + proposal: ::core::primitive::u32, + #[codec(compact)] + seconds_upper_bound: ::core::primitive::u32, + }, + vote { + #[codec(compact)] + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + }, + emergency_cancel { + ref_index: ::core::primitive::u32, + }, + external_propose { + proposal_hash: ::subxt::sp_core::H256, + }, + external_propose_majority { + proposal_hash: ::subxt::sp_core::H256, + }, + external_propose_default { + proposal_hash: ::subxt::sp_core::H256, + }, + fast_track { + proposal_hash: ::subxt::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + }, + veto_external { + proposal_hash: ::subxt::sp_core::H256, + }, + cancel_referendum { + #[codec(compact)] + ref_index: ::core::primitive::u32, + }, + cancel_queued { + which: ::core::primitive::u32, + }, + delegate { + to: ::subxt::sp_core::crypto::AccountId32, + conviction: + runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + }, + undelegate, + clear_public_proposals, + note_preimage { + encoded_proposal: Vec<::core::primitive::u8>, + }, + note_preimage_operational { + encoded_proposal: Vec<::core::primitive::u8>, + }, + note_imminent_preimage { + encoded_proposal: Vec<::core::primitive::u8>, + }, + note_imminent_preimage_operational { + encoded_proposal: Vec<::core::primitive::u8>, + }, + reap_preimage { + proposal_hash: ::subxt::sp_core::H256, + #[codec(compact)] + proposal_len_upper_bound: ::core::primitive::u32, + }, + unlock { + target: ::subxt::sp_core::crypto::AccountId32, + }, + remove_vote { + index: ::core::primitive::u32, + }, + remove_other_vote { + target: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + enact_proposal { + proposal_hash: ::subxt::sp_core::H256, + index: ::core::primitive::u32, + }, + blacklist { + proposal_hash: ::subxt::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + }, + cancel_proposal { + #[codec(compact)] + prop_index: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + ValueLow, + ProposalMissing, + AlreadyCanceled, + DuplicateProposal, + ProposalBlacklisted, + NotSimpleMajority, + InvalidHash, + NoProposal, + AlreadyVetoed, + DuplicatePreimage, + NotImminent, + TooEarly, + Imminent, + PreimageMissing, + ReferendumInvalid, + PreimageInvalid, + NoneWaiting, + NotVoter, + NoPermission, + AlreadyDelegating, + InsufficientFunds, + NotDelegating, + VotesExist, + InstantNotAllowed, + Nonsense, + WrongUpperBound, + MaxVotesReached, + TooManyProposals, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Proposed(::core::primitive::u32, ::core::primitive::u128), + Tabled( + ::core::primitive::u32, + ::core::primitive::u128, + Vec<::subxt::sp_core::crypto::AccountId32>, + ), + ExternalTabled, + Started( + ::core::primitive::u32, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + ), + Passed(::core::primitive::u32), + NotPassed(::core::primitive::u32), + Cancelled(::core::primitive::u32), + Executed( + ::core::primitive::u32, + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + Delegated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + Undelegated(::subxt::sp_core::crypto::AccountId32), + Vetoed( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ::core::primitive::u32, + ), + PreimageNoted( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + PreimageUsed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + PreimageInvalid(::subxt::sp_core::H256, ::core::primitive::u32), + PreimageMissing(::subxt::sp_core::H256, ::core::primitive::u32), + PreimageReaped( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + Blacklisted(::subxt::sp_core::H256), + } + } + pub mod types { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Delegations<_0> { + pub votes: _0, + pub capital: _0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum ReferendumInfo<_0, _1, _2> { + Ongoing( + runtime_types::pallet_democracy::types::ReferendumStatus< + _0, + _1, + _2, + >, + ), + Finished { + approved: ::core::primitive::bool, + end: _0, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub enum AccountVote<_0> { + Standard { + vote: runtime_types::pallet_democracy::vote::Vote, + balance: _0, + }, + Split { + aye: _0, + nay: _0, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct PriorLock<_0, _1>(pub _0, pub _1); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Vote(::core::primitive::u8); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Voting<_0, _1, _2> { + Direct { + votes: 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>, + }, + 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)] + pub enum VoteThreshold { + SuperMajorityApprove, + SuperMajorityAgainst, + SimpleMajority, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum PreimageStatus<_0, _1, _2> { + Missing(_2), + Available { + data: Vec<::core::primitive::u8>, + provider: _0, + deposit: _1, + since: _2, + expiry: ::core::option::Option<_2>, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + 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)] + pub enum Call { + submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , set_emergency_election_result { supports : Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + PreDispatchEarlySubmission, + PreDispatchWrongWinnerCount, + PreDispatchWeakSubmission, + SignedQueueFull, + SignedCannotPayDeposit, + SignedInvalidWitness, + SignedTooMuchWeight, + OcwCallWrongEra, + MissingSnapshotMetadata, + InvalidSubmissionIndex, + CallNotAllowed, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , :: core :: primitive :: bool ,) , ElectionFinalized (:: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 ,) , Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 ,) , SignedPhaseStarted (:: core :: primitive :: u32 ,) , UnsignedPhaseStarted (:: core :: primitive :: u32 ,) , } + } + pub mod signed { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum ElectionCompute { + OnChain, + Signed, + Unsigned, + Fallback, + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Phase<_0> { + Off, + Signed, + Unsigned((::core::primitive::bool, _0)), + Emergency, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RawSolution<_0> { + pub solution: _0, + pub score: [::core::primitive::u128; 3usize], + pub round: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ReadySolution<_0> { + pub supports: Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub score: [::core::primitive::u128; 3usize], + pub compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RoundSnapshot<_0> { + pub voters: Vec<(_0, ::core::primitive::u64, Vec<_0>)>, + pub targets: Vec<_0>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum Call { + vote { + votes: Vec<::subxt::sp_core::crypto::AccountId32>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + remove_voter, + submit_candidacy { + #[codec(compact)] + candidate_count: ::core::primitive::u32, + }, + renounce_candidacy { + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + }, + remove_member { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + has_replacement: ::core::primitive::bool, + }, + clean_defunct_voters { + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + UnableToVote, + NoVotes, + TooManyVotes, + MaximumVotesExceeded, + LowBalance, + UnableToPayBond, + MustBeVoter, + ReportSelf, + DuplicatedCandidate, + MemberSubmit, + RunnerUpSubmit, + InsufficientCandidateFunds, + NotMember, + InvalidWitnessData, + InvalidVoteCount, + InvalidRenouncing, + InvalidReplacement, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewTerm( + Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ), + EmptyTerm, + ElectionError, + MemberKicked(::subxt::sp_core::crypto::AccountId32), + Renounced(::subxt::sp_core::crypto::AccountId32), + CandidateSlashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + SeatHolderSlashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Renouncing { + Member, + RunnerUp, + Candidate(::core::primitive::u32), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SeatHolder<_0, _1> { + pub who: _0, + pub stake: _1, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Voter<_0, _1> { + pub votes: Vec<_0>, + pub stake: _1, + pub deposit: _1, + } + } + pub mod pallet_gilt { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveGilt<_0, _1, _2> { + pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, + pub amount: _0, + pub who: _1, + pub expiry: _2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveGiltsTotal<_0> { + pub frozen: _0, + pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, + pub index: ::core::primitive::u32, + pub target: ::subxt::sp_arithmetic::per_things::Perquintill, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + place_bid { + #[codec(compact)] + amount: ::core::primitive::u128, + duration: ::core::primitive::u32, + }, + retract_bid { + #[codec(compact)] + amount: ::core::primitive::u128, + duration: ::core::primitive::u32, + }, + set_target { + #[codec(compact)] + target: ::subxt::sp_arithmetic::per_things::Perquintill, + }, + thaw { + #[codec(compact)] + index: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + DurationTooSmall, + DurationTooBig, + AmountTooSmall, + BidTooLow, + Unknown, + NotOwner, + NotExpired, + NotFound, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + BidPlaced( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ), + BidRetracted( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ), + GiltIssued( + ::core::primitive::u32, + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + GiltThawed( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u128, + ), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct GiltBid<_0, _1> { + pub amount: _0, + pub who: _1, + } + } + } + pub mod pallet_grandpa { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + 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, + }, + 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, + }, + note_stalled { + delay: ::core::primitive::u32, + best_finalized_block_number: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + PauseFailed, + ResumeFailed, + ChangePending, + TooSoon, + InvalidKeyOwnershipProof, + InvalidEquivocationProof, + DuplicateOffenceReport, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewAuthorities( + Vec<( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + )>, + ), + Paused, + Resumed, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum StoredState<_0> { + Live, + PendingPause { scheduled_at: _0, delay: _0 }, + Paused, + 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)] + pub enum Call { + add_registrar { + account: ::subxt::sp_core::crypto::AccountId32, + }, + set_identity { + info: ::std::boxed::Box< + runtime_types::pallet_identity::types::IdentityInfo, + >, + }, + set_subs { + subs: Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + }, + clear_identity, + request_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + #[codec(compact)] + max_fee: ::core::primitive::u128, + }, + cancel_request { + reg_index: ::core::primitive::u32, + }, + set_fee { + #[codec(compact)] + index: ::core::primitive::u32, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + set_account_id { + #[codec(compact)] + index: ::core::primitive::u32, + new: ::subxt::sp_core::crypto::AccountId32, + }, + set_fields { + #[codec(compact)] + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + }, + provide_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + }, + kill_identity { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + add_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + data: runtime_types::pallet_identity::types::Data, + }, + rename_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + data: runtime_types::pallet_identity::types::Data, + }, + remove_sub { + sub: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + quit_sub, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + TooManySubAccounts, + NotFound, + NotNamed, + EmptyIndex, + FeeChanged, + NoIdentity, + StickyJudgement, + JudgementGiven, + InvalidJudgement, + InvalidIndex, + InvalidTarget, + TooManyFields, + TooManyRegistrars, + AlreadyClaimed, + NotSub, + NotOwned, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + IdentitySet(::subxt::sp_core::crypto::AccountId32), + IdentityCleared( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + IdentityKilled( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + JudgementRequested( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + JudgementUnrequested( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + JudgementGiven( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + RegistrarAdded(::core::primitive::u32), + SubIdentityAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + SubIdentityRemoved( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + SubIdentityRevoked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct BitFlags<_0>( + pub ::core::primitive::u64, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Data { + None, + Raw0([::core::primitive::u8; 0usize]), + Raw1([::core::primitive::u8; 1usize]), + Raw2([::core::primitive::u8; 2usize]), + Raw3([::core::primitive::u8; 3usize]), + Raw4([::core::primitive::u8; 4usize]), + Raw5([::core::primitive::u8; 5usize]), + Raw6([::core::primitive::u8; 6usize]), + Raw7([::core::primitive::u8; 7usize]), + Raw8([::core::primitive::u8; 8usize]), + Raw9([::core::primitive::u8; 9usize]), + Raw10([::core::primitive::u8; 10usize]), + Raw11([::core::primitive::u8; 11usize]), + Raw12([::core::primitive::u8; 12usize]), + Raw13([::core::primitive::u8; 13usize]), + Raw14([::core::primitive::u8; 14usize]), + Raw15([::core::primitive::u8; 15usize]), + Raw16([::core::primitive::u8; 16usize]), + Raw17([::core::primitive::u8; 17usize]), + Raw18([::core::primitive::u8; 18usize]), + Raw19([::core::primitive::u8; 19usize]), + Raw20([::core::primitive::u8; 20usize]), + Raw21([::core::primitive::u8; 21usize]), + Raw22([::core::primitive::u8; 22usize]), + Raw23([::core::primitive::u8; 23usize]), + Raw24([::core::primitive::u8; 24usize]), + Raw25([::core::primitive::u8; 25usize]), + Raw26([::core::primitive::u8; 26usize]), + Raw27([::core::primitive::u8; 27usize]), + Raw28([::core::primitive::u8; 28usize]), + Raw29([::core::primitive::u8; 29usize]), + Raw30([::core::primitive::u8; 30usize]), + Raw31([::core::primitive::u8; 31usize]), + Raw32([::core::primitive::u8; 32usize]), + BlakeTwo256([::core::primitive::u8; 32usize]), + Sha256([::core::primitive::u8; 32usize]), + Keccak256([::core::primitive::u8; 32usize]), + ShaThree256([::core::primitive::u8; 32usize]), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum IdentityField { + Display, + Legal, + Web, + Riot, + Email, + PgpFingerprint, + Image, + Twitter, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum Judgement<_0> { + Unknown, + FeePaid(_0), + Reasonable, + KnownGood, + OutOfDate, + LowQuality, + Erroneous, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub enum Call { + 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)] + pub enum Error { + InvalidKey, + DuplicatedHeartbeat, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + HeartbeatReceived( + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + ), + AllGood, + SomeOffline( + 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, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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)] + pub enum Call { + claim { + index: ::core::primitive::u32, + }, + transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + free { + index: ::core::primitive::u32, + }, + force_transfer { + new: ::subxt::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + freeze: ::core::primitive::bool, + }, + freeze { + index: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotAssigned, + NotOwner, + InUse, + NotTransfer, + Permanent, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + IndexAssigned( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + ), + IndexFreed(::core::primitive::u32), + IndexFrozen( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + } + } + } + pub mod pallet_lottery { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + buy_ticket { + call: ::std::boxed::Box, + }, + set_calls { + calls: Vec, + }, + start_lottery { + price: ::core::primitive::u128, + length: ::core::primitive::u32, + delay: ::core::primitive::u32, + repeat: ::core::primitive::bool, + }, + stop_repeat, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotConfigured, + InProgress, + AlreadyEnded, + InvalidCall, + AlreadyParticipating, + TooManyCalls, + EncodingFailed, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + LotteryStarted, + CallsUpdated, + Winner( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + TicketBought( + ::subxt::sp_core::crypto::AccountId32, + (::core::primitive::u8, ::core::primitive::u8), + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct LotteryConfig<_0, _1> { + pub price: _1, + pub start: _0, + pub length: _0, + pub delay: _0, + pub repeat: ::core::primitive::bool, + } + } + pub mod pallet_membership { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + add_member { + who: ::subxt::sp_core::crypto::AccountId32, + }, + remove_member { + who: ::subxt::sp_core::crypto::AccountId32, + }, + swap_member { + remove: ::subxt::sp_core::crypto::AccountId32, + add: ::subxt::sp_core::crypto::AccountId32, + }, + reset_members { + members: Vec<::subxt::sp_core::crypto::AccountId32>, + }, + change_key { + new: ::subxt::sp_core::crypto::AccountId32, + }, + set_prime { + who: ::subxt::sp_core::crypto::AccountId32, + }, + clear_prime, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + AlreadyMember, + NotMember, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + MemberAdded, + MemberRemoved, + MembersSwapped, + MembersReset, + KeyChanged, + Dummy, + } + } + } + pub mod pallet_multisig { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + as_multi_threshold_1 { + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + call: ::std::boxed::Box, + }, + as_multi { + threshold: ::core::primitive::u16, + other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint< + ::core::primitive::u32, + >, + >, + call: + ::subxt::WrapperKeepOpaque, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + }, + approve_as_multi { + threshold: ::core::primitive::u16, + other_signatories: 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, + }, + cancel_as_multi { + threshold: ::core::primitive::u16, + other_signatories: 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)] + pub enum Error { + MinimumThreshold, + AlreadyApproved, + NoApprovalsNeeded, + TooFewSignatories, + TooManySignatories, + SignatoriesOutOfOrder, + SenderInSignatories, + NotFound, + NotOwner, + NoTimepoint, + WrongTimepoint, + UnexpectedTimepoint, + MaxWeightTooLow, + AlreadyStored, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewMultisig( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + [::core::primitive::u8; 32usize], + ), + MultisigApproval( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + ::subxt::sp_core::crypto::AccountId32, + [::core::primitive::u8; 32usize], + ), + MultisigExecuted( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + ::subxt::sp_core::crypto::AccountId32, + [::core::primitive::u8; 32usize], + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + MultisigCancelled( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + ::subxt::sp_core::crypto::AccountId32, + [::core::primitive::u8; 32usize], + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Multisig<_0, _1, _2> { + pub when: runtime_types::pallet_multisig::Timepoint<_0>, + pub deposit: _1, + pub depositor: _2, + pub approvals: Vec<_2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub enum Event { + Offence([::core::primitive::u8; 16usize], Vec<::core::primitive::u8>), + } + } + } + pub mod pallet_proxy { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + proxy { + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::node_runtime::ProxyType, + >, + call: ::std::boxed::Box, + }, + add_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: ::core::primitive::u32, + }, + remove_proxy { + delegate: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + delay: ::core::primitive::u32, + }, + remove_proxies, + anonymous { + proxy_type: runtime_types::node_runtime::ProxyType, + delay: ::core::primitive::u32, + index: ::core::primitive::u16, + }, + kill_anonymous { + spawner: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::node_runtime::ProxyType, + index: ::core::primitive::u16, + #[codec(compact)] + height: ::core::primitive::u32, + #[codec(compact)] + ext_index: ::core::primitive::u32, + }, + announce { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + remove_announcement { + real: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + reject_announcement { + delegate: ::subxt::sp_core::crypto::AccountId32, + call_hash: ::subxt::sp_core::H256, + }, + proxy_announced { + delegate: ::subxt::sp_core::crypto::AccountId32, + real: ::subxt::sp_core::crypto::AccountId32, + force_proxy_type: ::core::option::Option< + runtime_types::node_runtime::ProxyType, + >, + call: ::std::boxed::Box, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + TooMany, + NotFound, + NotProxy, + Unproxyable, + Duplicate, + NoPermission, + Unannounced, + NoSelfProxy, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + ProxyExecuted( + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + AnonymousCreated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + runtime_types::node_runtime::ProxyType, + ::core::primitive::u16, + ), + Announced( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::H256, + ), + ProxyAdded( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + runtime_types::node_runtime::ProxyType, + ::core::primitive::u32, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Announcement<_0, _1, _2> { + pub real: _0, + pub call_hash: _1, + pub height: _2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ProxyDefinition<_0, _1, _2> { + pub delegate: _0, + pub proxy_type: _1, + pub delay: _2, + } + } + pub mod pallet_recovery { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + as_recovered { + account: ::subxt::sp_core::crypto::AccountId32, + call: ::std::boxed::Box, + }, + set_recovered { + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + }, + create_recovery { + friends: Vec<::subxt::sp_core::crypto::AccountId32>, + threshold: ::core::primitive::u16, + delay_period: ::core::primitive::u32, + }, + initiate_recovery { + account: ::subxt::sp_core::crypto::AccountId32, + }, + vouch_recovery { + lost: ::subxt::sp_core::crypto::AccountId32, + rescuer: ::subxt::sp_core::crypto::AccountId32, + }, + claim_recovery { + account: ::subxt::sp_core::crypto::AccountId32, + }, + close_recovery { + rescuer: ::subxt::sp_core::crypto::AccountId32, + }, + remove_recovery, + cancel_recovered { + account: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotAllowed, + ZeroThreshold, + NotEnoughFriends, + MaxFriends, + NotSorted, + NotRecoverable, + AlreadyRecoverable, + AlreadyStarted, + NotStarted, + NotFriend, + DelayPeriod, + AlreadyVouched, + Threshold, + StillActive, + AlreadyProxy, + BadState, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + RecoveryCreated(::subxt::sp_core::crypto::AccountId32), + RecoveryInitiated( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + RecoveryVouched( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + RecoveryClosed( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + AccountRecovered( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + RecoveryRemoved(::subxt::sp_core::crypto::AccountId32), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveRecovery<_0, _1, _2> { + pub created: _0, + pub deposit: _1, + pub friends: Vec<_2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RecoveryConfig<_0, _1, _2> { + pub delay_period: _0, + pub deposit: _1, + pub friends: Vec<_2>, + pub threshold: ::core::primitive::u16, + } + } + pub mod pallet_scheduler { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + schedule { + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box, + }, + cancel { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + schedule_named { + id: 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, + }, + cancel_named { + id: Vec<::core::primitive::u8>, + }, + 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, + }, + schedule_named_after { + id: 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, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + FailedToSchedule, + NotFound, + TargetBlockNumberInPast, + RescheduleNoChange, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Scheduled(::core::primitive::u32, ::core::primitive::u32), + Canceled(::core::primitive::u32, ::core::primitive::u32), + Dispatched( + (::core::primitive::u32, ::core::primitive::u32), + ::core::option::Option>, + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1, + V2, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ScheduledV2<_0, _1, _2, _3> { + pub maybe_id: ::core::option::Option>, + 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)] + pub enum Call { + set_keys { + keys: runtime_types::node_runtime::SessionKeys, + proof: Vec<::core::primitive::u8>, + }, + purge_keys, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InvalidProof, + NoAssociatedValidatorId, + DuplicatedKey, + NoKeys, + NoAccount, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewSession(::core::primitive::u32), + } + } + } + pub mod pallet_society { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + bid { + value: ::core::primitive::u128, + }, + unbid { + pos: ::core::primitive::u32, + }, + vouch { + who: ::subxt::sp_core::crypto::AccountId32, + value: ::core::primitive::u128, + tip: ::core::primitive::u128, + }, + unvouch { + pos: ::core::primitive::u32, + }, + vote { + candidate: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + approve: ::core::primitive::bool, + }, + defender_vote { + approve: ::core::primitive::bool, + }, + payout, + found { + founder: ::subxt::sp_core::crypto::AccountId32, + max_members: ::core::primitive::u32, + rules: Vec<::core::primitive::u8>, + }, + unfound, + judge_suspended_member { + who: ::subxt::sp_core::crypto::AccountId32, + forgive: ::core::primitive::bool, + }, + judge_suspended_candidate { + who: ::subxt::sp_core::crypto::AccountId32, + judgement: runtime_types::pallet_society::Judgement, + }, + set_max_members { + max: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + BadPosition, + NotMember, + AlreadyMember, + Suspended, + NotSuspended, + NoPayout, + AlreadyFounded, + InsufficientPot, + AlreadyVouching, + NotVouching, + Head, + Founder, + AlreadyBid, + AlreadyCandidate, + NotCandidate, + MaxMembers, + NotFounder, + NotHead, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Founded(::subxt::sp_core::crypto::AccountId32), + Bid( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Vouch( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + AutoUnbid(::subxt::sp_core::crypto::AccountId32), + Unbid(::subxt::sp_core::crypto::AccountId32), + Unvouch(::subxt::sp_core::crypto::AccountId32), + Inducted( + ::subxt::sp_core::crypto::AccountId32, + Vec<::subxt::sp_core::crypto::AccountId32>, + ), + SuspendedMemberJudgement( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::bool, + ), + CandidateSuspended(::subxt::sp_core::crypto::AccountId32), + MemberSuspended(::subxt::sp_core::crypto::AccountId32), + Challenged(::subxt::sp_core::crypto::AccountId32), + Vote( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::bool, + ), + DefenderVote( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::bool, + ), + NewMaxMembers(::core::primitive::u32), + Unfounded(::subxt::sp_core::crypto::AccountId32), + Deposit(::core::primitive::u128), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Bid<_0, _1> { + pub who: _0, + pub kind: runtime_types::pallet_society::BidKind<_0, _1>, + pub value: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum BidKind<_0, _1> { + Deposit(_1), + Vouch(_0, _1), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Judgement { + Rebid, + Reject, + Approve, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Vote { + Skeptic, + Reject, + Approve, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum VouchingStatus { + Vouching, + Banned, + } + } + 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, + )] + pub enum Call { + bond { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + bond_extra { + #[codec(compact)] + max_additional: ::core::primitive::u128, + }, + unbond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + withdraw_unbonded { + num_slashing_spans: ::core::primitive::u32, + }, + validate { + prefs: runtime_types::pallet_staking::ValidatorPrefs, + }, + nominate { + targets: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + }, + chill, + set_payee { + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::sp_core::crypto::AccountId32, + >, + }, + set_controller { + controller: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + set_validator_count { + #[codec(compact)] + new: ::core::primitive::u32, + }, + increase_validator_count { + #[codec(compact)] + additional: ::core::primitive::u32, + }, + scale_validator_count { + factor: runtime_types::sp_arithmetic::per_things::Percent, + }, + force_no_eras, + force_new_era, + set_invulnerables { + invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + }, + force_unstake { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + force_new_era_always, + cancel_deferred_slash { + era: ::core::primitive::u32, + slash_indices: Vec<::core::primitive::u32>, + }, + payout_stakers { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + }, + rebond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + set_history_depth { + #[codec(compact)] + new_history_depth: ::core::primitive::u32, + #[codec(compact)] + era_items_deleted: ::core::primitive::u32, + }, + reap_stash { + stash: ::subxt::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + kick { + who: Vec< + ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + }, + set_staking_limits { + min_nominator_bond: ::core::primitive::u128, + min_validator_bond: ::core::primitive::u128, + max_nominator_count: + ::core::option::Option<::core::primitive::u32>, + max_validator_count: + ::core::option::Option<::core::primitive::u32>, + threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + }, + chill_other { + controller: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub enum Error { + NotController, + NotStash, + AlreadyBonded, + AlreadyPaired, + EmptyTargets, + DuplicateIndex, + InvalidSlashIndex, + InsufficientBond, + NoMoreChunks, + NoUnlockChunk, + FundedTarget, + InvalidEraToReward, + InvalidNumberOfNominations, + NotSortedAndUnique, + AlreadyClaimed, + IncorrectHistoryDepth, + IncorrectSlashingSpans, + BadState, + TooManyTargets, + BadTarget, + CannotChillOther, + TooManyNominators, + TooManyValidators, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub enum Event { + EraPaid( + ::core::primitive::u32, + ::core::primitive::u128, + ::core::primitive::u128, + ), + Rewarded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Slashed( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + OldSlashingReportDiscarded(::core::primitive::u32), + StakersElected, + Bonded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Unbonded( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Withdrawn( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + Kicked( + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + StakingElectionFailed, + Chilled(::subxt::sp_core::crypto::AccountId32), + PayoutStarted( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + } + } + } + pub mod slashing { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SlashingSpans { + pub span_index: ::core::primitive::u32, + pub last_start: ::core::primitive::u32, + pub last_nonzero_slash: ::core::primitive::u32, + pub prior: Vec<::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct SpanRecord<_0> { + pub slashed: _0, + pub paid_out: _0, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ActiveEraInfo { + pub index: ::core::primitive::u32, + pub start: ::core::option::Option<::core::primitive::u64>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct EraRewardPoints<_0> { + pub total: ::core::primitive::u32, + pub individual: ::std::collections::BTreeMap<_0, ::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Exposure<_0, _1> { + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub own: _1, + pub others: + Vec>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Forcing { + NotForcing, + ForceNew, + ForceNone, + ForceAlways, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct IndividualExposure<_0, _1> { + pub who: _0, + #[codec(compact)] + pub value: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Nominations<_0> { + pub targets: Vec<_0>, + pub submitted_in: ::core::primitive::u32, + pub suppressed: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1_0_0Ancient, + V2_0_0, + V3_0_0, + V4_0_0, + V5_0_0, + V6_0_0, + V7_0_0, + V8_0_0, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum RewardDestination<_0> { + Staked, + Stash, + Controller, + Account(_0), + None, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct StakingLedger<_0, _1> { + pub stash: _0, + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub active: _1, + pub unlocking: Vec>, + pub claimed_rewards: Vec<::core::primitive::u32>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct UnappliedSlash<_0, _1> { + pub validator: _0, + pub own: _1, + pub others: Vec<(_0, _1)>, + pub reporters: Vec<_0>, + pub payout: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct UnlockChunk<_0> { + #[codec(compact)] + pub value: _0, + #[codec(compact)] + pub era: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ValidatorPrefs { + #[codec(compact)] + pub commission: ::subxt::sp_arithmetic::per_things::Perbill, + pub blocked: ::core::primitive::bool, + } + } + pub mod pallet_sudo { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + sudo { + call: ::std::boxed::Box, + }, + sudo_unchecked_weight { + call: ::std::boxed::Box, + weight: ::core::primitive::u64, + }, + set_key { + new: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + sudo_as { + who: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + call: ::std::boxed::Box, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + RequireSudo, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Sudid( + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + KeyChanged(::subxt::sp_core::crypto::AccountId32), + SudoAsDone( + ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + ), + } + } + } + pub mod pallet_timestamp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + 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)] + pub enum Call { + report_awesome { + reason: Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + }, + retract_tip { + hash: ::subxt::sp_core::H256, + }, + tip_new { + reason: Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + tip { + hash: ::subxt::sp_core::H256, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + close_tip { + hash: ::subxt::sp_core::H256, + }, + slash_tip { + hash: ::subxt::sp_core::H256, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + ReasonTooBig, + AlreadyKnown, + UnknownTip, + NotFinder, + StillOpen, + Premature, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + NewTip(::subxt::sp_core::H256), + TipClosing(::subxt::sp_core::H256), + TipClosed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + TipRetracted(::subxt::sp_core::H256), + TipSlashed( + ::subxt::sp_core::H256, + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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: 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)] + pub struct ChargeTransactionPayment(pub ::core::primitive::u128); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V1Ancient, + V2, + } + } + pub mod pallet_transaction_storage { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + store { data : Vec < :: core :: primitive :: u8 > , } , renew { block : :: core :: primitive :: u32 , index : :: core :: primitive :: u32 , } , check_proof { proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InsufficientFunds, + NotConfigured, + RenewedNotFound, + EmptyTransaction, + UnexpectedProof, + InvalidProof, + MissingProof, + MissingStateData, + DoubleCheck, + ProofNotChecked, + TransactionTooLarge, + TooManyTransactions, + BadContext, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Stored(::core::primitive::u32), + Renewed(::core::primitive::u32), + ProofChecked, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransactionInfo { + pub chunk_root: ::subxt::sp_core::H256, + pub content_hash: ::subxt::sp_core::H256, + pub size: ::core::primitive::u32, + pub block_chunks: ::core::primitive::u32, + } + } + pub mod pallet_treasury { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + propose_spend { + #[codec(compact)] + value: ::core::primitive::u128, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + reject_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + approve_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + InsufficientProposersBalance, + InvalidIndex, + TooManyApprovals, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Proposed(::core::primitive::u32), + Spending(::core::primitive::u128), + Awarded( + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::sp_core::crypto::AccountId32, + ), + Rejected(::core::primitive::u32, ::core::primitive::u128), + Burnt(::core::primitive::u128), + Rollover(::core::primitive::u128), + Deposit(::core::primitive::u128), + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Proposal<_0, _1> { + pub proposer: _0, + pub value: _1, + pub beneficiary: _0, + pub bond: _1, + } + } + pub mod pallet_uniques { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + create { # [codec (compact)] class : :: core :: primitive :: u32 , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , force_create { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , } , destroy { # [codec (compact)] class : :: core :: primitive :: u32 , witness : runtime_types :: pallet_uniques :: types :: DestroyWitness , } , mint { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , burn { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , check_owner : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , dest : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , redeposit { # [codec (compact)] class : :: core :: primitive :: u32 , instances : Vec < :: core :: primitive :: u32 > , } , freeze { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , thaw { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , freeze_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , thaw_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , transfer_ownership { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , set_team { # [codec (compact)] class : :: core :: primitive :: u32 , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , approve_transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , delegate : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , cancel_approval { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , maybe_check_delegate : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , force_asset_status { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , is_frozen : :: core :: primitive :: bool , } , set_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , value : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , clear_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , set_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , set_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , } , } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NoPermission, + Unknown, + AlreadyExists, + WrongOwner, + BadWitness, + InUse, + Frozen, + WrongDelegate, + NoDelegate, + Unapproved, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + Created( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + ForceCreated( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + Destroyed(::core::primitive::u32), + Issued( + ::core::primitive::u32, + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + Transferred( + ::core::primitive::u32, + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + Burned( + ::core::primitive::u32, + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + Frozen(::core::primitive::u32, ::core::primitive::u32), + Thawed(::core::primitive::u32, ::core::primitive::u32), + ClassFrozen(::core::primitive::u32), + ClassThawed(::core::primitive::u32), + OwnerChanged( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ), + TeamChanged( + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + ApprovedTransfer( + ::core::primitive::u32, + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + ApprovalCancelled( + ::core::primitive::u32, + ::core::primitive::u32, + ::subxt::sp_core::crypto::AccountId32, + ::subxt::sp_core::crypto::AccountId32, + ), + AssetStatusChanged(::core::primitive::u32), + ClassMetadataSet( + ::core::primitive::u32, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ::core::primitive::bool, + ), + ClassMetadataCleared(::core::primitive::u32), + MetadataSet( + ::core::primitive::u32, + ::core::primitive::u32, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ::core::primitive::bool, + ), + MetadataCleared(::core::primitive::u32, ::core::primitive::u32), + Redeposited(::core::primitive::u32, Vec<::core::primitive::u32>), + AttributeSet( + ::core::primitive::u32, + ::core::option::Option<::core::primitive::u32>, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ), + AttributeCleared( + ::core::primitive::u32, + ::core::option::Option<::core::primitive::u32>, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ), + } + } + pub mod types { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassDetails<_0, _1> { + pub owner: _0, + pub issuer: _0, + pub admin: _0, + pub freezer: _0, + pub total_deposit: _1, + pub free_holding: ::core::primitive::bool, + pub instances: ::core::primitive::u32, + pub instance_metadatas: ::core::primitive::u32, + pub attributes: ::core::primitive::u32, + pub is_frozen: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ClassMetadata<_0> { + pub deposit: _0, + pub data: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub is_frozen: ::core::primitive::bool, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct DestroyWitness { + #[codec(compact)] + pub instances: ::core::primitive::u32, + #[codec(compact)] + pub instance_metadatas: ::core::primitive::u32, + #[codec(compact)] + pub attributes: ::core::primitive::u32, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstanceDetails<_0, _1> { + pub owner: _0, + pub approved: ::core::option::Option<_0>, + pub is_frozen: ::core::primitive::bool, + pub deposit: _1, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct InstanceMetadata<_0> { + pub deposit: _0, + pub data: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub is_frozen: ::core::primitive::bool, + } + } + } + pub mod pallet_utility { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + batch { + calls: Vec, + }, + as_derivative { + index: ::core::primitive::u16, + call: ::std::boxed::Box, + }, + batch_all { + calls: Vec, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + TooManyCalls, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + BatchInterrupted( + ::core::primitive::u32, + runtime_types::sp_runtime::DispatchError, + ), + BatchCompleted, + ItemCompleted, + } + } + } + pub mod pallet_vesting { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Call { + vest, + vest_other { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + vested_transfer { + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + }, + force_vested_transfer { + source: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + target: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + schedule: + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + }, + merge_schedules { + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + }, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Error { + NotVesting, + AtMaxVestingSchedules, + AmountLow, + ScheduleIndexOutOfBounds, + InvalidScheduleParams, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Event { + VestingUpdated( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + VestingCompleted(::subxt::sp_core::crypto::AccountId32), + } + } + pub mod vesting_info { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct VestingInfo<_0, _1> { + pub locked: _0, + pub per_block: _0, + pub starting_block: _1, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Releases { + V0, + V1, + } + } + pub mod primitive_types { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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 :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct FixedU128(pub ::core::primitive::u128); + } + pub mod per_things { + use super::runtime_types; + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct PerU16(pub ::core::primitive::u16); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Perbill(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Percent(pub ::core::primitive::u8); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Permill(pub ::core::primitive::u32); + #[derive( + :: subxt :: codec :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Perquintill(pub ::core::primitive::u64); + } + } + pub mod sp_authority_discovery { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + pub mod digests { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum NextConfigDescriptor { + V1 { + c: (::core::primitive::u64, ::core::primitive::u64), + allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum AllowedSlots { + PrimarySlots, + PrimaryAndSecondaryPlainSlots, + PrimaryAndSecondaryVRFSlots, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + 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 :: CompactAs, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + )] + pub struct Slot(pub ::core::primitive::u64); + } + pub mod sp_core { + use super::runtime_types; + pub mod changes_trie { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct ChangesTrieConfiguration { + pub digest_interval: ::core::primitive::u32, + pub digest_levels: ::core::primitive::u32, + } + } + pub mod crypto { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct AccountId32(pub [::core::primitive::u8; 32usize]); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); + } + pub mod ecdsa { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Signature(pub [::core::primitive::u8; 65usize]); + } + pub mod ed25519 { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Public(pub [::core::primitive::u8; 32usize]); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Signature(pub [::core::primitive::u8; 64usize]); + } + pub mod offchain { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OpaqueMultiaddr(pub Vec<::core::primitive::u8>); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OpaqueNetworkState { + pub peer_id: runtime_types::sp_core::OpaquePeerId, + pub external_addresses: + Vec, + } + } + pub mod sr25519 { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Public(pub [::core::primitive::u8; 32usize]); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Signature(pub [::core::primitive::u8; 64usize]); + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct OpaquePeerId(pub Vec<::core::primitive::u8>); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + 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)] + pub struct Public(pub runtime_types::sp_core::ed25519::Public); + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum Equivocation<_0, _1> { + 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, + >, + ), + 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)] + 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)] + pub struct Support<_0> { + pub total: ::core::primitive::u128, + pub voters: 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, + )] + pub enum ChangesTrieSignal { + NewConfiguration (:: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > ,) , } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub struct Digest<_0> { + pub logs: Vec< + runtime_types::sp_runtime::generic::digest::DigestItem<_0>, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub enum DigestItem<_0> { + ChangesTrieRoot(_0), + PreRuntime( + [::core::primitive::u8; 4usize], + Vec<::core::primitive::u8>, + ), + Consensus( + [::core::primitive::u8; 4usize], + Vec<::core::primitive::u8>, + ), + Seal([::core::primitive::u8; 4usize], Vec<::core::primitive::u8>), + ChangesTrieSignal( + runtime_types::sp_runtime::generic::digest::ChangesTrieSignal, + ), + Other(Vec<::core::primitive::u8>), + RuntimeEnvironmentUpdated, + } + } + pub mod era { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + pub enum Era { + Immortal, + Mortal1(::core::primitive::u8), + Mortal2(::core::primitive::u8), + Mortal3(::core::primitive::u8), + Mortal4(::core::primitive::u8), + Mortal5(::core::primitive::u8), + Mortal6(::core::primitive::u8), + Mortal7(::core::primitive::u8), + Mortal8(::core::primitive::u8), + Mortal9(::core::primitive::u8), + Mortal10(::core::primitive::u8), + Mortal11(::core::primitive::u8), + Mortal12(::core::primitive::u8), + Mortal13(::core::primitive::u8), + Mortal14(::core::primitive::u8), + Mortal15(::core::primitive::u8), + Mortal16(::core::primitive::u8), + Mortal17(::core::primitive::u8), + Mortal18(::core::primitive::u8), + Mortal19(::core::primitive::u8), + Mortal20(::core::primitive::u8), + Mortal21(::core::primitive::u8), + Mortal22(::core::primitive::u8), + Mortal23(::core::primitive::u8), + Mortal24(::core::primitive::u8), + Mortal25(::core::primitive::u8), + Mortal26(::core::primitive::u8), + Mortal27(::core::primitive::u8), + Mortal28(::core::primitive::u8), + Mortal29(::core::primitive::u8), + Mortal30(::core::primitive::u8), + Mortal31(::core::primitive::u8), + Mortal32(::core::primitive::u8), + Mortal33(::core::primitive::u8), + Mortal34(::core::primitive::u8), + Mortal35(::core::primitive::u8), + Mortal36(::core::primitive::u8), + Mortal37(::core::primitive::u8), + Mortal38(::core::primitive::u8), + Mortal39(::core::primitive::u8), + Mortal40(::core::primitive::u8), + Mortal41(::core::primitive::u8), + Mortal42(::core::primitive::u8), + Mortal43(::core::primitive::u8), + Mortal44(::core::primitive::u8), + Mortal45(::core::primitive::u8), + Mortal46(::core::primitive::u8), + Mortal47(::core::primitive::u8), + Mortal48(::core::primitive::u8), + Mortal49(::core::primitive::u8), + Mortal50(::core::primitive::u8), + Mortal51(::core::primitive::u8), + Mortal52(::core::primitive::u8), + Mortal53(::core::primitive::u8), + Mortal54(::core::primitive::u8), + Mortal55(::core::primitive::u8), + Mortal56(::core::primitive::u8), + Mortal57(::core::primitive::u8), + Mortal58(::core::primitive::u8), + Mortal59(::core::primitive::u8), + Mortal60(::core::primitive::u8), + Mortal61(::core::primitive::u8), + Mortal62(::core::primitive::u8), + Mortal63(::core::primitive::u8), + Mortal64(::core::primitive::u8), + Mortal65(::core::primitive::u8), + Mortal66(::core::primitive::u8), + Mortal67(::core::primitive::u8), + Mortal68(::core::primitive::u8), + Mortal69(::core::primitive::u8), + Mortal70(::core::primitive::u8), + Mortal71(::core::primitive::u8), + Mortal72(::core::primitive::u8), + Mortal73(::core::primitive::u8), + Mortal74(::core::primitive::u8), + Mortal75(::core::primitive::u8), + Mortal76(::core::primitive::u8), + Mortal77(::core::primitive::u8), + Mortal78(::core::primitive::u8), + Mortal79(::core::primitive::u8), + Mortal80(::core::primitive::u8), + Mortal81(::core::primitive::u8), + Mortal82(::core::primitive::u8), + Mortal83(::core::primitive::u8), + Mortal84(::core::primitive::u8), + Mortal85(::core::primitive::u8), + Mortal86(::core::primitive::u8), + Mortal87(::core::primitive::u8), + Mortal88(::core::primitive::u8), + Mortal89(::core::primitive::u8), + Mortal90(::core::primitive::u8), + Mortal91(::core::primitive::u8), + Mortal92(::core::primitive::u8), + Mortal93(::core::primitive::u8), + Mortal94(::core::primitive::u8), + Mortal95(::core::primitive::u8), + Mortal96(::core::primitive::u8), + Mortal97(::core::primitive::u8), + Mortal98(::core::primitive::u8), + Mortal99(::core::primitive::u8), + Mortal100(::core::primitive::u8), + Mortal101(::core::primitive::u8), + Mortal102(::core::primitive::u8), + Mortal103(::core::primitive::u8), + Mortal104(::core::primitive::u8), + Mortal105(::core::primitive::u8), + Mortal106(::core::primitive::u8), + Mortal107(::core::primitive::u8), + Mortal108(::core::primitive::u8), + Mortal109(::core::primitive::u8), + Mortal110(::core::primitive::u8), + Mortal111(::core::primitive::u8), + Mortal112(::core::primitive::u8), + Mortal113(::core::primitive::u8), + Mortal114(::core::primitive::u8), + Mortal115(::core::primitive::u8), + Mortal116(::core::primitive::u8), + Mortal117(::core::primitive::u8), + Mortal118(::core::primitive::u8), + Mortal119(::core::primitive::u8), + Mortal120(::core::primitive::u8), + Mortal121(::core::primitive::u8), + Mortal122(::core::primitive::u8), + Mortal123(::core::primitive::u8), + Mortal124(::core::primitive::u8), + Mortal125(::core::primitive::u8), + Mortal126(::core::primitive::u8), + Mortal127(::core::primitive::u8), + Mortal128(::core::primitive::u8), + Mortal129(::core::primitive::u8), + Mortal130(::core::primitive::u8), + Mortal131(::core::primitive::u8), + Mortal132(::core::primitive::u8), + Mortal133(::core::primitive::u8), + Mortal134(::core::primitive::u8), + Mortal135(::core::primitive::u8), + Mortal136(::core::primitive::u8), + Mortal137(::core::primitive::u8), + Mortal138(::core::primitive::u8), + Mortal139(::core::primitive::u8), + Mortal140(::core::primitive::u8), + Mortal141(::core::primitive::u8), + Mortal142(::core::primitive::u8), + Mortal143(::core::primitive::u8), + Mortal144(::core::primitive::u8), + Mortal145(::core::primitive::u8), + Mortal146(::core::primitive::u8), + Mortal147(::core::primitive::u8), + Mortal148(::core::primitive::u8), + Mortal149(::core::primitive::u8), + Mortal150(::core::primitive::u8), + Mortal151(::core::primitive::u8), + Mortal152(::core::primitive::u8), + Mortal153(::core::primitive::u8), + Mortal154(::core::primitive::u8), + Mortal155(::core::primitive::u8), + Mortal156(::core::primitive::u8), + Mortal157(::core::primitive::u8), + Mortal158(::core::primitive::u8), + Mortal159(::core::primitive::u8), + Mortal160(::core::primitive::u8), + Mortal161(::core::primitive::u8), + Mortal162(::core::primitive::u8), + Mortal163(::core::primitive::u8), + Mortal164(::core::primitive::u8), + Mortal165(::core::primitive::u8), + Mortal166(::core::primitive::u8), + Mortal167(::core::primitive::u8), + Mortal168(::core::primitive::u8), + Mortal169(::core::primitive::u8), + Mortal170(::core::primitive::u8), + Mortal171(::core::primitive::u8), + Mortal172(::core::primitive::u8), + Mortal173(::core::primitive::u8), + Mortal174(::core::primitive::u8), + Mortal175(::core::primitive::u8), + Mortal176(::core::primitive::u8), + Mortal177(::core::primitive::u8), + Mortal178(::core::primitive::u8), + Mortal179(::core::primitive::u8), + Mortal180(::core::primitive::u8), + Mortal181(::core::primitive::u8), + Mortal182(::core::primitive::u8), + Mortal183(::core::primitive::u8), + Mortal184(::core::primitive::u8), + Mortal185(::core::primitive::u8), + Mortal186(::core::primitive::u8), + Mortal187(::core::primitive::u8), + Mortal188(::core::primitive::u8), + Mortal189(::core::primitive::u8), + Mortal190(::core::primitive::u8), + Mortal191(::core::primitive::u8), + Mortal192(::core::primitive::u8), + Mortal193(::core::primitive::u8), + Mortal194(::core::primitive::u8), + Mortal195(::core::primitive::u8), + Mortal196(::core::primitive::u8), + Mortal197(::core::primitive::u8), + Mortal198(::core::primitive::u8), + Mortal199(::core::primitive::u8), + Mortal200(::core::primitive::u8), + Mortal201(::core::primitive::u8), + Mortal202(::core::primitive::u8), + Mortal203(::core::primitive::u8), + Mortal204(::core::primitive::u8), + Mortal205(::core::primitive::u8), + Mortal206(::core::primitive::u8), + Mortal207(::core::primitive::u8), + Mortal208(::core::primitive::u8), + Mortal209(::core::primitive::u8), + Mortal210(::core::primitive::u8), + Mortal211(::core::primitive::u8), + Mortal212(::core::primitive::u8), + Mortal213(::core::primitive::u8), + Mortal214(::core::primitive::u8), + Mortal215(::core::primitive::u8), + Mortal216(::core::primitive::u8), + Mortal217(::core::primitive::u8), + Mortal218(::core::primitive::u8), + Mortal219(::core::primitive::u8), + Mortal220(::core::primitive::u8), + Mortal221(::core::primitive::u8), + Mortal222(::core::primitive::u8), + Mortal223(::core::primitive::u8), + Mortal224(::core::primitive::u8), + Mortal225(::core::primitive::u8), + Mortal226(::core::primitive::u8), + Mortal227(::core::primitive::u8), + Mortal228(::core::primitive::u8), + Mortal229(::core::primitive::u8), + Mortal230(::core::primitive::u8), + Mortal231(::core::primitive::u8), + Mortal232(::core::primitive::u8), + Mortal233(::core::primitive::u8), + Mortal234(::core::primitive::u8), + Mortal235(::core::primitive::u8), + Mortal236(::core::primitive::u8), + Mortal237(::core::primitive::u8), + Mortal238(::core::primitive::u8), + Mortal239(::core::primitive::u8), + Mortal240(::core::primitive::u8), + Mortal241(::core::primitive::u8), + Mortal242(::core::primitive::u8), + Mortal243(::core::primitive::u8), + Mortal244(::core::primitive::u8), + Mortal245(::core::primitive::u8), + Mortal246(::core::primitive::u8), + Mortal247(::core::primitive::u8), + Mortal248(::core::primitive::u8), + Mortal249(::core::primitive::u8), + Mortal250(::core::primitive::u8), + Mortal251(::core::primitive::u8), + Mortal252(::core::primitive::u8), + Mortal253(::core::primitive::u8), + Mortal254(::core::primitive::u8), + Mortal255(::core::primitive::u8), + } + } + pub mod header { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, + )] + 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< + ::subxt::sp_core::H256, + >, + #[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, + )] + pub struct UncheckedExtrinsic<_0, _1, _2, _3>( + 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)] + pub enum MultiAddress<_0, _1> { + Id(_0), + Index(_1), + Raw(Vec<::core::primitive::u8>), + Address32([::core::primitive::u8; 32usize]), + Address20([::core::primitive::u8; 20usize]), + } + } + pub mod traits { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct BlakeTwo256 {} + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum ArithmeticError { + Underflow, + Overflow, + DivisionByZero, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum DispatchError { + Other, + CannotLookup, + BadOrigin, + Module { + index: ::core::primitive::u8, + error: ::core::primitive::u8, + }, + ConsumerRemaining, + NoProviders, + Token(runtime_types::sp_runtime::TokenError), + Arithmetic(runtime_types::sp_runtime::ArithmeticError), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum MultiSignature { + Ed25519(runtime_types::sp_core::ed25519::Signature), + Sr25519(runtime_types::sp_core::sr25519::Signature), + Ecdsa(runtime_types::sp_core::ecdsa::Signature), + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub enum TokenError { + NoFunds, + WouldDie, + BelowMinimum, + CannotCreate, + UnknownAsset, + Frozen, + Unsupported, + } + } + pub mod sp_session { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct MembershipProof { + pub session: ::core::primitive::u32, + pub trie_nodes: Vec>, + 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)] + pub struct OffenceDetails<_0, _1> { + pub offender: _1, + pub reporters: Vec<_0>, + } + } + } + pub mod sp_transaction_storage_proof { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct TransactionStorageProof { + pub chunk: Vec<::core::primitive::u8>, + pub proof: Vec>, + } + } + pub mod sp_version { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] + pub struct RuntimeVersion { + pub spec_name: ::alloc::string::String, + pub impl_name: ::alloc::string::String, + pub authoring_version: ::core::primitive::u32, + pub spec_version: ::core::primitive::u32, + pub impl_version: ::core::primitive::u32, + pub apis: Vec<([::core::primitive::u8; 8usize], ::core::primitive::u32)>, + pub transaction_version: ::core::primitive::u32, + } + } + } + #[doc = r" Default configuration of common types for a target Substrate runtime."] + #[derive(Clone, Debug, Default, Eq, PartialEq)] + pub struct DefaultConfig; + impl ::subxt::Config for DefaultConfig { + type Index = u32; + type BlockNumber = u32; + type Hash = ::subxt::sp_core::H256; + type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; + type AccountId = ::subxt::sp_runtime::AccountId32; + type Address = ::subxt::sp_runtime::MultiAddress; + type Header = ::subxt::sp_runtime::generic::Header< + Self::BlockNumber, + ::subxt::sp_runtime::traits::BlakeTwo256, + >; + type Signature = ::subxt::sp_runtime::MultiSignature; + type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; + } + impl ::subxt::ExtrinsicExtraData for DefaultConfig { + type AccountData = AccountData; + type Extra = ::subxt::DefaultExtra; + } + pub type AccountData = self::system::storage::Account; + impl ::subxt::AccountData for AccountData { + fn nonce( + result: &::Value, + ) -> ::Index { + result.nonce + } + fn storage_entry( + account_id: ::AccountId, + ) -> Self { + Self(account_id) + } + } + pub struct RuntimeApi> { + pub client: ::subxt::Client, + } + impl ::core::convert::From<::subxt::Client> for RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + fn from(client: ::subxt::Client) -> Self { + Self { client } + } + } + impl<'a, T> RuntimeApi + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn storage(&'a self) -> StorageApi<'a, T> { + StorageApi { + client: &self.client, + } + } + pub fn tx(&'a self) -> TransactionApi<'a, T> { + TransactionApi { + client: &self.client, + } + } + } + pub struct StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + client: &'a ::subxt::Client, + } + impl<'a, T> StorageApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn system(&self) -> system::storage::StorageApi<'a, T> { + system::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 authorship(&self) -> authorship::storage::StorageApi<'a, T> { + authorship::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 election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { + election_provider_multi_phase::storage::StorageApi::new(self.client) + } + pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { + staking::storage::StorageApi::new(self.client) + } + pub fn session(&self) -> session::storage::StorageApi<'a, T> { + session::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 elections(&self) -> elections::storage::StorageApi<'a, T> { + elections::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 grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { + grandpa::storage::StorageApi::new(self.client) + } + pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { + treasury::storage::StorageApi::new(self.client) + } + pub fn contracts(&self) -> contracts::storage::StorageApi<'a, T> { + contracts::storage::StorageApi::new(self.client) + } + pub fn sudo(&self) -> sudo::storage::StorageApi<'a, T> { + sudo::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 offences(&self) -> offences::storage::StorageApi<'a, T> { + offences::storage::StorageApi::new(self.client) + } + pub fn randomness_collective_flip( + &self, + ) -> randomness_collective_flip::storage::StorageApi<'a, T> { + randomness_collective_flip::storage::StorageApi::new(self.client) + } + pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { + identity::storage::StorageApi::new(self.client) + } + pub fn society(&self) -> society::storage::StorageApi<'a, T> { + society::storage::StorageApi::new(self.client) + } + pub fn recovery(&self) -> recovery::storage::StorageApi<'a, T> { + recovery::storage::StorageApi::new(self.client) + } + pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { + vesting::storage::StorageApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { + scheduler::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 tips(&self) -> tips::storage::StorageApi<'a, T> { + tips::storage::StorageApi::new(self.client) + } + pub fn assets(&self) -> assets::storage::StorageApi<'a, T> { + assets::storage::StorageApi::new(self.client) + } + pub fn mmr(&self) -> mmr::storage::StorageApi<'a, T> { + mmr::storage::StorageApi::new(self.client) + } + pub fn lottery(&self) -> lottery::storage::StorageApi<'a, T> { + lottery::storage::StorageApi::new(self.client) + } + pub fn gilt(&self) -> gilt::storage::StorageApi<'a, T> { + gilt::storage::StorageApi::new(self.client) + } + pub fn uniques(&self) -> uniques::storage::StorageApi<'a, T> { + uniques::storage::StorageApi::new(self.client) + } + pub fn transaction_storage( + &self, + ) -> transaction_storage::storage::StorageApi<'a, T> { + transaction_storage::storage::StorageApi::new(self.client) + } + pub fn bags_list(&self) -> bags_list::storage::StorageApi<'a, T> { + bags_list::storage::StorageApi::new(self.client) + } + } + pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { + client: &'a ::subxt::Client, + } + impl<'a, T> TransactionApi<'a, T> + where + T: ::subxt::Config + ::subxt::ExtrinsicExtraData, + { + pub fn system(&self) -> system::calls::TransactionApi<'a, T> { + system::calls::TransactionApi::new(self.client) + } + pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { + utility::calls::TransactionApi::new(self.client) + } + pub fn babe(&self) -> babe::calls::TransactionApi<'a, T> { + babe::calls::TransactionApi::new(self.client) + } + pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T> { + timestamp::calls::TransactionApi::new(self.client) + } + pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { + authorship::calls::TransactionApi::new(self.client) + } + pub fn indices(&self) -> indices::calls::TransactionApi<'a, T> { + indices::calls::TransactionApi::new(self.client) + } + pub fn balances(&self) -> balances::calls::TransactionApi<'a, T> { + balances::calls::TransactionApi::new(self.client) + } + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::calls::TransactionApi<'a, T> { + election_provider_multi_phase::calls::TransactionApi::new(self.client) + } + pub fn staking(&self) -> staking::calls::TransactionApi<'a, T> { + staking::calls::TransactionApi::new(self.client) + } + pub fn session(&self) -> session::calls::TransactionApi<'a, T> { + session::calls::TransactionApi::new(self.client) + } + pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T> { + democracy::calls::TransactionApi::new(self.client) + } + pub fn council(&self) -> council::calls::TransactionApi<'a, T> { + council::calls::TransactionApi::new(self.client) + } + pub fn technical_committee( + &self, + ) -> technical_committee::calls::TransactionApi<'a, T> { + technical_committee::calls::TransactionApi::new(self.client) + } + pub fn elections(&self) -> elections::calls::TransactionApi<'a, T> { + elections::calls::TransactionApi::new(self.client) + } + pub fn technical_membership( + &self, + ) -> technical_membership::calls::TransactionApi<'a, T> { + technical_membership::calls::TransactionApi::new(self.client) + } + pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { + grandpa::calls::TransactionApi::new(self.client) + } + pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T> { + treasury::calls::TransactionApi::new(self.client) + } + pub fn contracts(&self) -> contracts::calls::TransactionApi<'a, T> { + contracts::calls::TransactionApi::new(self.client) + } + pub fn sudo(&self) -> sudo::calls::TransactionApi<'a, T> { + sudo::calls::TransactionApi::new(self.client) + } + pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { + im_online::calls::TransactionApi::new(self.client) + } + pub fn identity(&self) -> identity::calls::TransactionApi<'a, T> { + identity::calls::TransactionApi::new(self.client) + } + pub fn society(&self) -> society::calls::TransactionApi<'a, T> { + society::calls::TransactionApi::new(self.client) + } + pub fn recovery(&self) -> recovery::calls::TransactionApi<'a, T> { + recovery::calls::TransactionApi::new(self.client) + } + pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T> { + vesting::calls::TransactionApi::new(self.client) + } + pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T> { + scheduler::calls::TransactionApi::new(self.client) + } + pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T> { + proxy::calls::TransactionApi::new(self.client) + } + pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T> { + multisig::calls::TransactionApi::new(self.client) + } + pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T> { + bounties::calls::TransactionApi::new(self.client) + } + pub fn tips(&self) -> tips::calls::TransactionApi<'a, T> { + tips::calls::TransactionApi::new(self.client) + } + pub fn assets(&self) -> assets::calls::TransactionApi<'a, T> { + assets::calls::TransactionApi::new(self.client) + } + pub fn lottery(&self) -> lottery::calls::TransactionApi<'a, T> { + lottery::calls::TransactionApi::new(self.client) + } + pub fn gilt(&self) -> gilt::calls::TransactionApi<'a, T> { + gilt::calls::TransactionApi::new(self.client) + } + pub fn uniques(&self) -> uniques::calls::TransactionApi<'a, T> { + uniques::calls::TransactionApi::new(self.client) + } + pub fn transaction_storage( + &self, + ) -> transaction_storage::calls::TransactionApi<'a, T> { + transaction_storage::calls::TransactionApi::new(self.client) + } + pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T> { + bags_list::calls::TransactionApi::new(self.client) + } + } +} From d4a4ce03640b5c139e9ce0201cfbbb017ad15f6a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:29:28 +0200 Subject: [PATCH 184/216] Skip formatting of generated polkadot example code --- tests/integration/codegen/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/codegen/mod.rs b/tests/integration/codegen/mod.rs index 0d27f7d0fb..1120941d7c 100644 --- a/tests/integration/codegen/mod.rs +++ b/tests/integration/codegen/mod.rs @@ -21,4 +21,5 @@ /// /// - run `polkadot --dev --tmp` node locally /// - `cargo run --release -p subxt-cli -- codegen | rustfmt --edition=2018 --emit=stdout > tests/integration/codegen/polkadot.rs` +#[rustfmt::skip] mod polkadot; From cc1fdab7cfd4f0d29fe2f2cc748525a20a3feb88 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:31:38 +0200 Subject: [PATCH 185/216] Remove empty utility test file. --- tests/integration/frame/mod.rs | 3 +-- tests/integration/frame/utility.rs | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 tests/integration/frame/utility.rs diff --git a/tests/integration/frame/mod.rs b/tests/integration/frame/mod.rs index aee78ab82b..3ee6f54106 100644 --- a/tests/integration/frame/mod.rs +++ b/tests/integration/frame/mod.rs @@ -20,5 +20,4 @@ mod balances; mod contracts; mod staking; mod sudo; -mod system; -mod utility; +mod system; \ No newline at end of file diff --git a/tests/integration/frame/utility.rs b/tests/integration/frame/utility.rs deleted file mode 100644 index 8b13789179..0000000000 --- a/tests/integration/frame/utility.rs +++ /dev/null @@ -1 +0,0 @@ - From b570e390c0d6770e95c44975a097cb42a6757a91 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:34:58 +0200 Subject: [PATCH 186/216] Newline --- tests/integration/frame/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/frame/mod.rs b/tests/integration/frame/mod.rs index 3ee6f54106..8d18e46748 100644 --- a/tests/integration/frame/mod.rs +++ b/tests/integration/frame/mod.rs @@ -20,4 +20,4 @@ mod balances; mod contracts; mod staking; mod sudo; -mod system; \ No newline at end of file +mod system; From 9fd954048c5d2aa9e9c74bf9f65dd03d432380c0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:38:17 +0200 Subject: [PATCH 187/216] Update cli/src/main.rs Co-authored-by: David --- cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 35f21aa533..0781cab26d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -58,7 +58,7 @@ enum Command { #[structopt(long, short, default_value = "json")] format: String, }, - /// Generate runtime API code from metadata. + /// Generate runtime API client code from metadata. /// /// # Example (with code formatting) /// From 4657b57b2dd1d8654f5fde7e4d823c1540cdc7aa Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:44:47 +0200 Subject: [PATCH 188/216] Rename subxt-cli executable to subxt --- cli/Cargo.toml | 4 ++++ cli/src/main.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d952ff7125..ea153c53cd 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -3,6 +3,10 @@ name = "subxt-cli" version = "0.1.0" edition = "2021" +[[bin]] +name = "subxt" +path = "src/main.rs" + [dependencies] # perform subxt codegen subxt-codegen = { version = "0.1.0", path = "../codegen" } diff --git a/cli/src/main.rs b/cli/src/main.rs index 35f21aa533..7ffd411f83 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -62,7 +62,7 @@ enum Command { /// /// # Example (with code formatting) /// - /// `subxt-cli codegen | rustfmt --edition=2018 --emit=stdout` + /// `subxt codegen | rustfmt --edition=2018 --emit=stdout` Codegen { /// the url of the substrate node to query for metadata for codegen. #[structopt(name = "url", long, parse(try_from_str))] From 36d5e57d0569152f81acb00a88d729142ec88428 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 16:45:11 +0200 Subject: [PATCH 189/216] Update src/client.rs Co-authored-by: David --- src/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.rs b/src/client.rs index aa8a13828a..ae8a5a91c8 100644 --- a/src/client.rs +++ b/src/client.rs @@ -202,7 +202,7 @@ where Self { client, call } } - /// Creates and signs an extrinsic and submits to the chain. + /// Creates and signs an extrinsic and submits it to the chain. /// /// Returns when the extrinsic has successfully been included in the block, together with any /// events which were triggered by the extrinsic. From 9818d0d14e2b76a8767b79da038ead6f3e166f31 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 17:21:50 +0200 Subject: [PATCH 190/216] Add some code docs to TypeGenerator. --- codegen/src/types/mod.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 98607c5061..9ad0915c5c 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -44,11 +44,16 @@ use syn::parse_quote; #[cfg(test)] mod tests; +/// Generate a Rust module containing all types defined in the supplied [`PortableRegistry`]. #[derive(Debug)] pub struct TypeGenerator<'a> { - root_mod_ident: Ident, + /// The name of the module which will contain the generated types. + types_mod_ident: Ident, + /// Registry of type definitions to be transformed into Rust type definitions. type_registry: &'a PortableRegistry, + /// User defined overrides for generated types. type_substitutes: HashMap, + /// Set of derives with which to annotate generated types. derives: GeneratedTypeDerives, } @@ -62,7 +67,7 @@ impl<'a> TypeGenerator<'a> { ) -> Self { let root_mod_ident = Ident::new(root_mod, Span::call_site()); Self { - root_mod_ident, + types_mod_ident: root_mod_ident, type_registry, type_substitutes, derives, @@ -72,7 +77,7 @@ impl<'a> TypeGenerator<'a> { /// Generate a module containing all types defined in the supplied type registry. pub fn generate_types_mod(&'a self) -> Module<'a> { let mut root_mod = - Module::new(self.root_mod_ident.clone(), self.root_mod_ident.clone()); + Module::new(self.types_mod_ident.clone(), self.types_mod_ident.clone()); for (id, ty) in self.type_registry.types().iter().enumerate() { if ty.ty().path().namespace().is_empty() { @@ -83,7 +88,7 @@ impl<'a> TypeGenerator<'a> { ty.ty().clone(), id as u32, ty.ty().path().namespace().to_vec(), - &self.root_mod_ident, + &self.types_mod_ident, &mut root_mod, ) } @@ -189,7 +194,7 @@ impl<'a> TypeGenerator<'a> { TypePath::Type(TypePathType { ty, params, - root_mod_ident: self.root_mod_ident.clone(), + root_mod_ident: self.types_mod_ident.clone(), }) } } From 13915e2fe24ee4e3f33db754685f66481d3f9560 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 18:03:44 +0200 Subject: [PATCH 191/216] Extract TypePath to own file --- codegen/src/types/mod.rs | 235 ++---------------------------- codegen/src/types/type_path.rs | 257 +++++++++++++++++++++++++++++++++ 2 files changed, 267 insertions(+), 225 deletions(-) create mode 100644 codegen/src/types/type_path.rs diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 9ad0915c5c..368da595a4 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -14,6 +14,10 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . +#[cfg(test)] +mod tests; +mod type_path; + use super::GeneratedTypeDerives; use proc_macro2::{ Ident, @@ -41,8 +45,12 @@ use std::collections::{ }; use syn::parse_quote; -#[cfg(test)] -mod tests; +pub use self::type_path::{ + TypePath, + TypePathType, + TypeParameter, + TypePathSubstitute, +}; /// Generate a Rust module containing all types defined in the supplied [`PortableRegistry`]. #[derive(Debug)] @@ -531,226 +539,3 @@ impl<'a> ModuleType<'a> { quote! ( ::core::marker::PhantomData<#params> ) } } - -#[derive(Clone, Debug)] -pub enum TypePath { - Parameter(TypeParameter), - Type(TypePathType), - Substitute(TypePathSubstitute), -} - -impl quote::ToTokens for TypePath { - fn to_tokens(&self, tokens: &mut TokenStream) { - let syn_type = self.to_syn_type(); - syn_type.to_tokens(tokens) - } -} - -impl TypePath { - pub(crate) fn to_syn_type(&self) -> syn::Type { - match self { - TypePath::Parameter(ty_param) => syn::Type::Path(parse_quote! { #ty_param }), - TypePath::Type(ty) => ty.to_syn_type(), - TypePath::Substitute(sub) => sub.to_syn_type(), - } - } - - pub(crate) fn is_compact(&self) -> bool { - matches!(self, Self::Type(ty) if ty.is_compact()) - } - - /// Returns the type parameters in a path which are inherited from the containing type. - /// - /// # Example - /// - /// ```rust - /// struct S { - /// a: Vec>, // the parent type param here is `T` - /// } - /// ``` - fn parent_type_params(&self, acc: &mut HashSet) { - match self { - Self::Parameter(type_parameter) => { - acc.insert(type_parameter.clone()); - } - Self::Type(type_path) => type_path.parent_type_params(acc), - Self::Substitute(sub) => sub.parent_type_params(acc), - } - } -} - -#[derive(Clone, Debug)] -pub struct TypePathType { - ty: Type, - params: Vec, - root_mod_ident: Ident, -} - -impl TypePathType { - pub(crate) fn is_compact(&self) -> bool { - matches!(self.ty.type_def(), TypeDef::Compact(_)) - } - - fn to_syn_type(&self) -> syn::Type { - let params = &self.params; - match self.ty.type_def() { - TypeDef::Composite(_) | TypeDef::Variant(_) => { - let path_segments = self.ty.path().segments(); - - let ty_path: syn::TypePath = match path_segments { - [] => panic!("Type has no ident"), - [ident] => { - // paths to prelude types - match ident.as_str() { - "Option" => parse_quote!(::core::option::Option), - "Result" => parse_quote!(::core::result::Result), - "Cow" => parse_quote!(::std::borrow::Cow), - "BTreeMap" => parse_quote!(::std::collections::BTreeMap), - "BTreeSet" => parse_quote!(::std::collections::BTreeSet), - "Range" => parse_quote!(::core::ops::Range), - "RangeInclusive" => parse_quote!(::core::ops::RangeInclusive), - ident => panic!("Unknown prelude type '{}'", ident), - } - } - _ => { - // paths to generated types in the root types module - let mut ty_path = path_segments - .iter() - .map(|s| syn::PathSegment::from(format_ident!("{}", s))) - .collect::>(); - ty_path.insert( - 0, - syn::PathSegment::from(self.root_mod_ident.clone()), - ); - parse_quote!( #ty_path ) - } - }; - - let params = &self.params; - let path = if params.is_empty() { - parse_quote! { #ty_path } - } else { - parse_quote! { #ty_path< #( #params ),* > } - }; - syn::Type::Path(path) - } - TypeDef::Sequence(_) => { - let type_param = &self.params[0]; - let type_path = parse_quote! { Vec<#type_param> }; - syn::Type::Path(type_path) - } - TypeDef::Array(array) => { - let array_type = &self.params[0]; - let array_len = array.len() as usize; - let array = parse_quote! { [#array_type; #array_len] }; - syn::Type::Array(array) - } - TypeDef::Tuple(_) => { - let tuple = parse_quote! { (#( # params, )* ) }; - syn::Type::Tuple(tuple) - } - TypeDef::Primitive(primitive) => { - let path = match primitive { - TypeDefPrimitive::Bool => parse_quote!(::core::primitive::bool), - TypeDefPrimitive::Char => parse_quote!(::core::primitive::char), - TypeDefPrimitive::Str => parse_quote!(::alloc::string::String), - TypeDefPrimitive::U8 => parse_quote!(::core::primitive::u8), - TypeDefPrimitive::U16 => parse_quote!(::core::primitive::u16), - TypeDefPrimitive::U32 => parse_quote!(::core::primitive::u32), - TypeDefPrimitive::U64 => parse_quote!(::core::primitive::u64), - TypeDefPrimitive::U128 => parse_quote!(::core::primitive::u128), - TypeDefPrimitive::U256 => unimplemented!("not a rust primitive"), - TypeDefPrimitive::I8 => parse_quote!(::core::primitive::i8), - TypeDefPrimitive::I16 => parse_quote!(::core::primitive::i16), - TypeDefPrimitive::I32 => parse_quote!(::core::primitive::i32), - TypeDefPrimitive::I64 => parse_quote!(::core::primitive::i64), - TypeDefPrimitive::I128 => parse_quote!(::core::primitive::i128), - TypeDefPrimitive::I256 => unimplemented!("not a rust primitive"), - }; - syn::Type::Path(path) - } - TypeDef::Compact(_) => { - // todo: change the return type of this method to include info that it is compact - // and should be annotated with #[compact] for fields - let compact_type = &self.params[0]; - syn::Type::Path(parse_quote! ( #compact_type )) - } - TypeDef::BitSequence(_) => { - let bit_order_type = &self.params[0]; - let bit_store_type = &self.params[1]; - - let type_path = parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; - - syn::Type::Path(type_path) - } - } - } - - /// Returns the type parameters in a path which are inherited from the containing type. - /// - /// # Example - /// - /// ```rust - /// struct S { - /// a: Vec>, // the parent type param here is `T` - /// } - /// ``` - fn parent_type_params(&self, acc: &mut HashSet) { - for p in &self.params { - p.parent_type_params(acc); - } - } -} - -#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub struct TypeParameter { - concrete_type_id: u32, - name: proc_macro2::Ident, -} - -impl quote::ToTokens for TypeParameter { - fn to_tokens(&self, tokens: &mut TokenStream) { - self.name.to_tokens(tokens) - } -} - -#[derive(Clone, Debug)] -pub struct TypePathSubstitute { - path: syn::TypePath, - params: Vec, -} - -impl quote::ToTokens for TypePathSubstitute { - fn to_tokens(&self, tokens: &mut TokenStream) { - if self.params.is_empty() { - self.path.to_tokens(tokens) - } else { - let substitute_path = &self.path; - let params = &self.params; - tokens.extend(quote! { - #substitute_path< #( #params ),* > - }) - } - } -} - -impl TypePathSubstitute { - fn parent_type_params(&self, acc: &mut HashSet) { - for p in &self.params { - p.parent_type_params(acc); - } - } - - fn to_syn_type(&self) -> syn::Type { - if self.params.is_empty() { - syn::Type::Path(self.path.clone()) - } else { - let substitute_path = &self.path; - let params = &self.params; - parse_quote! ( #substitute_path< #( #params ),* > ) - } - } -} diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs new file mode 100644 index 0000000000..90a70f7ba7 --- /dev/null +++ b/codegen/src/types/type_path.rs @@ -0,0 +1,257 @@ +// Copyright 2019-2021 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 proc_macro2::{ + TokenStream, + Ident, +}; +use quote::{ + format_ident, + quote, +}; +use scale_info::{ + form::PortableForm, + Type, + TypeDef, + TypeDefPrimitive, +}; +use std::collections::{ + HashSet, +}; +use syn::parse_quote; + +#[derive(Clone, Debug)] +pub enum TypePath { + Parameter(TypeParameter), + Type(TypePathType), + Substitute(TypePathSubstitute), +} + +impl quote::ToTokens for TypePath { + fn to_tokens(&self, tokens: &mut TokenStream) { + let syn_type = self.to_syn_type(); + syn_type.to_tokens(tokens) + } +} + +impl TypePath { + pub(crate) fn to_syn_type(&self) -> syn::Type { + match self { + TypePath::Parameter(ty_param) => syn::Type::Path(parse_quote! { #ty_param }), + TypePath::Type(ty) => ty.to_syn_type(), + TypePath::Substitute(sub) => sub.to_syn_type(), + } + } + + pub(crate) fn is_compact(&self) -> bool { + matches!(self, Self::Type(ty) if ty.is_compact()) + } + + /// Returns the type parameters in a path which are inherited from the containing type. + /// + /// # Example + /// + /// ```rust + /// struct S { + /// a: Vec>, // the parent type param here is `T` + /// } + /// ``` + pub fn parent_type_params(&self, acc: &mut HashSet) { + match self { + Self::Parameter(type_parameter) => { + acc.insert(type_parameter.clone()); + } + Self::Type(type_path) => type_path.parent_type_params(acc), + Self::Substitute(sub) => sub.parent_type_params(acc), + } + } +} + +#[derive(Clone, Debug)] +pub struct TypePathType { + pub(super) ty: Type, + pub(super) params: Vec, + pub(super) root_mod_ident: Ident, +} + +impl TypePathType { + pub(crate) fn is_compact(&self) -> bool { + matches!(self.ty.type_def(), TypeDef::Compact(_)) + } + + fn to_syn_type(&self) -> syn::Type { + let params = &self.params; + match self.ty.type_def() { + TypeDef::Composite(_) | TypeDef::Variant(_) => { + let path_segments = self.ty.path().segments(); + + let ty_path: syn::TypePath = match path_segments { + [] => panic!("Type has no ident"), + [ident] => { + // paths to prelude types + match ident.as_str() { + "Option" => parse_quote!(::core::option::Option), + "Result" => parse_quote!(::core::result::Result), + "Cow" => parse_quote!(::std::borrow::Cow), + "BTreeMap" => parse_quote!(::std::collections::BTreeMap), + "BTreeSet" => parse_quote!(::std::collections::BTreeSet), + "Range" => parse_quote!(::core::ops::Range), + "RangeInclusive" => parse_quote!(::core::ops::RangeInclusive), + ident => panic!("Unknown prelude type '{}'", ident), + } + } + _ => { + // paths to generated types in the root types module + let mut ty_path = path_segments + .iter() + .map(|s| syn::PathSegment::from(format_ident!("{}", s))) + .collect::>(); + ty_path.insert( + 0, + syn::PathSegment::from(self.root_mod_ident.clone()), + ); + parse_quote!( #ty_path ) + } + }; + + let params = &self.params; + let path = if params.is_empty() { + parse_quote! { #ty_path } + } else { + parse_quote! { #ty_path< #( #params ),* > } + }; + syn::Type::Path(path) + } + TypeDef::Sequence(_) => { + let type_param = &self.params[0]; + let type_path = parse_quote! { Vec<#type_param> }; + syn::Type::Path(type_path) + } + TypeDef::Array(array) => { + let array_type = &self.params[0]; + let array_len = array.len() as usize; + let array = parse_quote! { [#array_type; #array_len] }; + syn::Type::Array(array) + } + TypeDef::Tuple(_) => { + let tuple = parse_quote! { (#( # params, )* ) }; + syn::Type::Tuple(tuple) + } + TypeDef::Primitive(primitive) => { + let path = match primitive { + TypeDefPrimitive::Bool => parse_quote!(::core::primitive::bool), + TypeDefPrimitive::Char => parse_quote!(::core::primitive::char), + TypeDefPrimitive::Str => parse_quote!(::alloc::string::String), + TypeDefPrimitive::U8 => parse_quote!(::core::primitive::u8), + TypeDefPrimitive::U16 => parse_quote!(::core::primitive::u16), + TypeDefPrimitive::U32 => parse_quote!(::core::primitive::u32), + TypeDefPrimitive::U64 => parse_quote!(::core::primitive::u64), + TypeDefPrimitive::U128 => parse_quote!(::core::primitive::u128), + TypeDefPrimitive::U256 => unimplemented!("not a rust primitive"), + TypeDefPrimitive::I8 => parse_quote!(::core::primitive::i8), + TypeDefPrimitive::I16 => parse_quote!(::core::primitive::i16), + TypeDefPrimitive::I32 => parse_quote!(::core::primitive::i32), + TypeDefPrimitive::I64 => parse_quote!(::core::primitive::i64), + TypeDefPrimitive::I128 => parse_quote!(::core::primitive::i128), + TypeDefPrimitive::I256 => unimplemented!("not a rust primitive"), + }; + syn::Type::Path(path) + } + TypeDef::Compact(_) => { + // todo: change the return type of this method to include info that it is compact + // and should be annotated with #[compact] for fields + let compact_type = &self.params[0]; + syn::Type::Path(parse_quote! ( #compact_type )) + } + TypeDef::BitSequence(_) => { + let bit_order_type = &self.params[0]; + let bit_store_type = &self.params[1]; + + let type_path = parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; + + syn::Type::Path(type_path) + } + } + } + + /// Returns the type parameters in a path which are inherited from the containing type. + /// + /// # Example + /// + /// ```rust + /// struct S { + /// a: Vec>, // the parent type param here is `T` + /// } + /// ``` + fn parent_type_params(&self, acc: &mut HashSet) { + for p in &self.params { + p.parent_type_params(acc); + } + } +} + +#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct TypeParameter { + pub(super) concrete_type_id: u32, + pub(super) name: proc_macro2::Ident, +} + +impl quote::ToTokens for TypeParameter { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.name.to_tokens(tokens) + } +} + +#[derive(Clone, Debug)] +pub struct TypePathSubstitute { + pub(super) path: syn::TypePath, + pub(super) params: Vec, +} + +impl quote::ToTokens for TypePathSubstitute { + fn to_tokens(&self, tokens: &mut TokenStream) { + if self.params.is_empty() { + self.path.to_tokens(tokens) + } else { + let substitute_path = &self.path; + let params = &self.params; + tokens.extend(quote! { + #substitute_path< #( #params ),* > + }) + } + } +} + +impl TypePathSubstitute { + fn parent_type_params(&self, acc: &mut HashSet) { + for p in &self.params { + p.parent_type_params(acc); + } + } + + fn to_syn_type(&self) -> syn::Type { + if self.params.is_empty() { + syn::Type::Path(self.path.clone()) + } else { + let substitute_path = &self.path; + let params = &self.params; + parse_quote! ( #substitute_path< #( #params ),* > ) + } + } +} \ No newline at end of file From 69ee2da5e8b0368181f5c9fbab1aec21cdebcd7e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 18:17:58 +0200 Subject: [PATCH 192/216] Extract type def generation to separate file --- codegen/src/types/mod.rs | 305 +------------------------------- codegen/src/types/type_def.rs | 323 ++++++++++++++++++++++++++++++++++ 2 files changed, 332 insertions(+), 296 deletions(-) create mode 100644 codegen/src/types/type_def.rs diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 368da595a4..1910d0a3c5 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -17,39 +17,37 @@ #[cfg(test)] mod tests; mod type_path; +mod type_def; use super::GeneratedTypeDerives; use proc_macro2::{ Ident, Span, - TokenStream as TokenStream2, TokenStream, }; use quote::{ - format_ident, quote, ToTokens, }; use scale_info::{ form::PortableForm, - Field, PortableRegistry, Type, TypeDef, - TypeDefPrimitive, }; use std::collections::{ BTreeMap, HashMap, - HashSet, }; -use syn::parse_quote; -pub use self::type_path::{ - TypePath, - TypePathType, - TypeParameter, - TypePathSubstitute, +pub use self::{ + type_def::ModuleType, + type_path::{ + TypePath, + TypePathType, + TypeParameter, + TypePathSubstitute, + } }; /// Generate a Rust module containing all types defined in the supplied [`PortableRegistry`]. @@ -254,288 +252,3 @@ impl<'a> Module<'a> { &self.name } } - -#[derive(Debug)] -pub struct ModuleType<'a> { - type_gen: &'a TypeGenerator<'a>, - ty: Type, -} - -impl<'a> quote::ToTokens for ModuleType<'a> { - fn to_tokens(&self, tokens: &mut TokenStream) { - let type_params = self - .ty - .type_params() - .iter() - .enumerate() - .filter_map(|(i, tp)| { - match tp.ty() { - Some(ty) => { - let tp_name = format_ident!("_{}", i); - Some(TypeParameter { - concrete_type_id: ty.id(), - name: tp_name, - }) - } - None => None, - } - }) - .collect::>(); - - let type_name = self.ty.path().ident().map(|ident| { - let type_params = if !type_params.is_empty() { - quote! { < #( #type_params ),* > } - } else { - quote! {} - }; - let ty = format_ident!("{}", ident); - let path = parse_quote! { #ty #type_params}; - syn::Type::Path(path) - }); - - let derives = self.type_gen.derives(); - - match self.ty.type_def() { - TypeDef::Composite(composite) => { - let type_name = type_name.expect("structs should have a name"); - let (fields, _) = - self.composite_fields(composite.fields(), &type_params, true); - let derive_as_compact = if composite.fields().len() == 1 { - // any single field wrapper struct with a concrete unsigned int type can derive - // CompactAs. - let field = &composite.fields()[0]; - if !self - .ty - .type_params() - .iter() - .any(|tp| Some(tp.name()) == field.type_name()) - { - let ty = self.type_gen.resolve_type(field.ty().id()); - if matches!( - ty.type_def(), - TypeDef::Primitive( - TypeDefPrimitive::U8 - | TypeDefPrimitive::U16 - | TypeDefPrimitive::U32 - | TypeDefPrimitive::U64 - | TypeDefPrimitive::U128 - ) - ) { - Some(quote!( #[derive(::subxt::codec::CompactAs)] )) - } else { - None - } - } else { - None - } - } else { - None - }; - - let ty_toks = quote! { - #derive_as_compact - #derives - pub struct #type_name #fields - }; - tokens.extend(ty_toks); - } - TypeDef::Variant(variant) => { - let type_name = type_name.expect("variants should have a name"); - let mut variants = Vec::new(); - let mut used_type_params = HashSet::new(); - let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); - - for v in variant.variants() { - let variant_name = format_ident!("{}", v.name()); - let (fields, unused_type_params) = if v.fields().is_empty() { - let unused = type_params_set.iter().cloned().collect::>(); - (quote! {}, unused) - } else { - self.composite_fields(v.fields(), &type_params, false) - }; - variants.push(quote! { #variant_name #fields }); - let unused_params_set = unused_type_params.iter().cloned().collect(); - let used_params = type_params_set.difference(&unused_params_set); - - for used_param in used_params { - used_type_params.insert(used_param.clone()); - } - } - - let unused_type_params = type_params_set - .difference(&used_type_params) - .cloned() - .collect::>(); - if !unused_type_params.is_empty() { - let phantom = Self::phantom_data(&unused_type_params); - variants.push(quote! { - __Ignore(#phantom) - }) - } - - let ty_toks = quote! { - #derives - pub enum #type_name { - #( #variants, )* - } - }; - tokens.extend(ty_toks); - } - _ => (), // all built-in types should already be in scope - } - } -} - -impl<'a> ModuleType<'a> { - fn composite_fields( - &self, - fields: &'a [Field], - type_params: &'a [TypeParameter], - is_struct: bool, - ) -> (TokenStream2, Vec) { - let named = fields.iter().all(|f| f.name().is_some()); - let unnamed = fields.iter().all(|f| f.name().is_none()); - - fn unused_type_params<'a>( - type_params: &'a [TypeParameter], - types: impl Iterator, - ) -> Vec { - let mut used_type_params = HashSet::new(); - for ty in types { - ty.parent_type_params(&mut used_type_params) - } - let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); - let mut unused = type_params_set - .difference(&used_type_params) - .cloned() - .collect::>(); - unused.sort(); - unused - } - - let ty_toks = |ty_name: &str, ty_path: &TypePath| { - if ty_name.contains("Box<") { - // todo [AJ] remove this hack once scale-info can represent Box somehow - quote! { ::std::boxed::Box<#ty_path> } - } else { - quote! { #ty_path } - } - }; - - if named { - let fields = fields - .iter() - .map(|field| { - let name = format_ident!( - "{}", - field.name().expect("named field without a name") - ); - let ty = self - .type_gen - .resolve_type_path(field.ty().id(), type_params); - (name, ty, field.type_name()) - }) - .collect::>(); - - let mut fields_tokens = fields - .iter() - .map(|(name, ty, ty_name)| { - let field_type = match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! ( pub #name: #ty ) - } else { - quote! ( #name: #ty ) - } - } - None => { - quote! ( #name: #ty ) - } - }; - if ty.is_compact() { - // todo: [AJ] figure out way to ensure AsCompact generated for target type in scale_info. - quote!( #[codec(compact)] #field_type ) - } else { - quote!( #field_type ) - } - }) - .collect::>(); - - let unused_params = - unused_type_params(type_params, fields.iter().map(|(_, ty, _)| ty)); - - if is_struct && !unused_params.is_empty() { - let phantom = Self::phantom_data(&unused_params); - fields_tokens.push(quote! { - #[codec(skip)] pub __subxt_unused_type_params: #phantom - }) - } - - let fields = quote! { - { - #( #fields_tokens, )* - } - }; - (fields, unused_params) - } else if unnamed { - let type_paths = fields - .iter() - .map(|field| { - let ty = self - .type_gen - .resolve_type_path(field.ty().id(), type_params); - (ty, field.type_name()) - }) - .collect::>(); - let mut fields_tokens = type_paths - .iter() - .map(|(ty, ty_name)| { - match ty_name { - Some(ty_name) => { - let ty = ty_toks(ty_name, ty); - if is_struct { - quote! { pub #ty } - } else { - quote! { #ty } - } - } - None => { - quote! { #ty } - } - } - }) - .collect::>(); - - let unused_params = - unused_type_params(type_params, type_paths.iter().map(|(ty, _)| ty)); - - if is_struct && !unused_params.is_empty() { - let phantom_data = Self::phantom_data(&unused_params); - fields_tokens.push(quote! { #[codec(skip)] pub #phantom_data }) - } - - let fields = quote! { ( #( #fields_tokens, )* ) }; - let fields_tokens = if is_struct { - // add a semicolon for tuple structs - quote! { #fields; } - } else { - fields - }; - - (fields_tokens, unused_params) - } else { - panic!("Fields must be either all named or all unnamed") - } - } - - fn phantom_data(params: &[TypeParameter]) -> TokenStream2 { - let params = if params.len() == 1 { - let param = ¶ms[0]; - quote! { #param } - } else { - quote! { ( #( #params ), * ) } - }; - quote! ( ::core::marker::PhantomData<#params> ) - } -} diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs new file mode 100644 index 0000000000..512627ea4c --- /dev/null +++ b/codegen/src/types/type_def.rs @@ -0,0 +1,323 @@ +// Copyright 2019-2021 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::{ + TypeGenerator, + TypePath, + TypeParameter, +}; +use proc_macro2::{ + TokenStream as TokenStream2, + TokenStream, +}; +use quote::{ + format_ident, + quote, +}; +use scale_info::{ + form::PortableForm, + Field, + Type, + TypeDef, + TypeDefPrimitive, +}; +use std::collections::HashSet; +use syn::parse_quote; + +#[derive(Debug)] +pub struct ModuleType<'a> { + pub(super) type_gen: &'a TypeGenerator<'a>, + pub(super) ty: Type, +} + +impl<'a> quote::ToTokens for ModuleType<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + let type_params = self + .ty + .type_params() + .iter() + .enumerate() + .filter_map(|(i, tp)| { + match tp.ty() { + Some(ty) => { + let tp_name = format_ident!("_{}", i); + Some(TypeParameter { + concrete_type_id: ty.id(), + name: tp_name, + }) + } + None => None, + } + }) + .collect::>(); + + let type_name = self.ty.path().ident().map(|ident| { + let type_params = if !type_params.is_empty() { + quote! { < #( #type_params ),* > } + } else { + quote! {} + }; + let ty = format_ident!("{}", ident); + let path = parse_quote! { #ty #type_params}; + syn::Type::Path(path) + }); + + let derives = self.type_gen.derives(); + + match self.ty.type_def() { + TypeDef::Composite(composite) => { + let type_name = type_name.expect("structs should have a name"); + let (fields, _) = + self.composite_fields(composite.fields(), &type_params, true); + let derive_as_compact = if composite.fields().len() == 1 { + // any single field wrapper struct with a concrete unsigned int type can derive + // CompactAs. + let field = &composite.fields()[0]; + if !self + .ty + .type_params() + .iter() + .any(|tp| Some(tp.name()) == field.type_name()) + { + let ty = self.type_gen.resolve_type(field.ty().id()); + if matches!( + ty.type_def(), + TypeDef::Primitive( + TypeDefPrimitive::U8 + | TypeDefPrimitive::U16 + | TypeDefPrimitive::U32 + | TypeDefPrimitive::U64 + | TypeDefPrimitive::U128 + ) + ) { + Some(quote!( #[derive(::subxt::codec::CompactAs)] )) + } else { + None + } + } else { + None + } + } else { + None + }; + + let ty_toks = quote! { + #derive_as_compact + #derives + pub struct #type_name #fields + }; + tokens.extend(ty_toks); + } + TypeDef::Variant(variant) => { + let type_name = type_name.expect("variants should have a name"); + let mut variants = Vec::new(); + let mut used_type_params = HashSet::new(); + let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); + + for v in variant.variants() { + let variant_name = format_ident!("{}", v.name()); + let (fields, unused_type_params) = if v.fields().is_empty() { + let unused = type_params_set.iter().cloned().collect::>(); + (quote! {}, unused) + } else { + self.composite_fields(v.fields(), &type_params, false) + }; + variants.push(quote! { #variant_name #fields }); + let unused_params_set = unused_type_params.iter().cloned().collect(); + let used_params = type_params_set.difference(&unused_params_set); + + for used_param in used_params { + used_type_params.insert(used_param.clone()); + } + } + + let unused_type_params = type_params_set + .difference(&used_type_params) + .cloned() + .collect::>(); + if !unused_type_params.is_empty() { + let phantom = Self::phantom_data(&unused_type_params); + variants.push(quote! { + __Ignore(#phantom) + }) + } + + let ty_toks = quote! { + #derives + pub enum #type_name { + #( #variants, )* + } + }; + tokens.extend(ty_toks); + } + _ => (), // all built-in types should already be in scope + } + } +} + +impl<'a> ModuleType<'a> { + fn composite_fields( + &self, + fields: &'a [Field], + type_params: &'a [TypeParameter], + is_struct: bool, + ) -> (TokenStream2, Vec) { + let named = fields.iter().all(|f| f.name().is_some()); + let unnamed = fields.iter().all(|f| f.name().is_none()); + + fn unused_type_params<'a>( + type_params: &'a [TypeParameter], + types: impl Iterator, + ) -> Vec { + let mut used_type_params = HashSet::new(); + for ty in types { + ty.parent_type_params(&mut used_type_params) + } + let type_params_set: HashSet<_> = type_params.iter().cloned().collect(); + let mut unused = type_params_set + .difference(&used_type_params) + .cloned() + .collect::>(); + unused.sort(); + unused + } + + let ty_toks = |ty_name: &str, ty_path: &TypePath| { + if ty_name.contains("Box<") { + // todo [AJ] remove this hack once scale-info can represent Box somehow + quote! { ::std::boxed::Box<#ty_path> } + } else { + quote! { #ty_path } + } + }; + + if named { + let fields = fields + .iter() + .map(|field| { + let name = format_ident!( + "{}", + field.name().expect("named field without a name") + ); + let ty = self + .type_gen + .resolve_type_path(field.ty().id(), type_params); + (name, ty, field.type_name()) + }) + .collect::>(); + + let mut fields_tokens = fields + .iter() + .map(|(name, ty, ty_name)| { + let field_type = match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! ( pub #name: #ty ) + } else { + quote! ( #name: #ty ) + } + } + None => { + quote! ( #name: #ty ) + } + }; + if ty.is_compact() { + // todo: [AJ] figure out way to ensure AsCompact generated for target type in scale_info. + quote!( #[codec(compact)] #field_type ) + } else { + quote!( #field_type ) + } + }) + .collect::>(); + + let unused_params = + unused_type_params(type_params, fields.iter().map(|(_, ty, _)| ty)); + + if is_struct && !unused_params.is_empty() { + let phantom = Self::phantom_data(&unused_params); + fields_tokens.push(quote! { + #[codec(skip)] pub __subxt_unused_type_params: #phantom + }) + } + + let fields = quote! { + { + #( #fields_tokens, )* + } + }; + (fields, unused_params) + } else if unnamed { + let type_paths = fields + .iter() + .map(|field| { + let ty = self + .type_gen + .resolve_type_path(field.ty().id(), type_params); + (ty, field.type_name()) + }) + .collect::>(); + let mut fields_tokens = type_paths + .iter() + .map(|(ty, ty_name)| { + match ty_name { + Some(ty_name) => { + let ty = ty_toks(ty_name, ty); + if is_struct { + quote! { pub #ty } + } else { + quote! { #ty } + } + } + None => { + quote! { #ty } + } + } + }) + .collect::>(); + + let unused_params = + unused_type_params(type_params, type_paths.iter().map(|(ty, _)| ty)); + + if is_struct && !unused_params.is_empty() { + let phantom_data = Self::phantom_data(&unused_params); + fields_tokens.push(quote! { #[codec(skip)] pub #phantom_data }) + } + + let fields = quote! { ( #( #fields_tokens, )* ) }; + let fields_tokens = if is_struct { + // add a semicolon for tuple structs + quote! { #fields; } + } else { + fields + }; + + (fields_tokens, unused_params) + } else { + panic!("Fields must be either all named or all unnamed") + } + } + + fn phantom_data(params: &[TypeParameter]) -> TokenStream2 { + let params = if params.len() == 1 { + let param = ¶ms[0]; + quote! { #param } + } else { + quote! { ( #( #params ), * ) } + }; + quote! ( ::core::marker::PhantomData<#params> ) + } +} \ No newline at end of file From e8a83766a9fb1e6973a64f851fff315478bc06bc Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 18:25:34 +0200 Subject: [PATCH 193/216] Renamed ModuleType to TypeDefGen --- codegen/src/types/mod.rs | 6 +++--- codegen/src/types/type_def.rs | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 1910d0a3c5..2c2077386f 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -41,7 +41,7 @@ use std::collections::{ }; pub use self::{ - type_def::ModuleType, + type_def::TypeDefGen, type_path::{ TypePath, TypePathType, @@ -126,7 +126,7 @@ impl<'a> TypeGenerator<'a> { if path.len() == 1 { child_mod .types - .insert(ty.path().clone(), ModuleType { ty, type_gen: self }); + .insert(ty.path().clone(), TypeDefGen { ty, type_gen: self }); } else { self.insert_type(ty, id, path[1..].to_vec(), root_mod_ident, child_mod) } @@ -216,7 +216,7 @@ pub struct Module<'a> { name: Ident, root_mod: Ident, children: BTreeMap>, - types: BTreeMap, ModuleType<'a>>, + types: BTreeMap, TypeDefGen<'a>>, } impl<'a> ToTokens for Module<'a> { diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index 512627ea4c..665a66ec70 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -37,13 +37,20 @@ use scale_info::{ use std::collections::HashSet; use syn::parse_quote; +/// Generates a Rust `struct` or `enum` definition based on the supplied [`scale-info::Type`]. +/// +/// Field type paths are resolved via the `TypeGenerator`, which contains the registry of all +/// generated types in the module. #[derive(Debug)] -pub struct ModuleType<'a> { +pub struct TypeDefGen<'a> { + /// The type generation context, allows resolving of type paths for the fields of the + /// generated type. pub(super) type_gen: &'a TypeGenerator<'a>, + /// Contains the definition of the type to be generated. pub(super) ty: Type, } -impl<'a> quote::ToTokens for ModuleType<'a> { +impl<'a> quote::ToTokens for TypeDefGen<'a> { fn to_tokens(&self, tokens: &mut TokenStream) { let type_params = self .ty @@ -168,7 +175,7 @@ impl<'a> quote::ToTokens for ModuleType<'a> { } } -impl<'a> ModuleType<'a> { +impl<'a> TypeDefGen<'a> { fn composite_fields( &self, fields: &'a [Field], From 4f3de30dd8cea14e316e8995e93ff156ebee76b3 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sat, 30 Oct 2021 18:25:59 +0200 Subject: [PATCH 194/216] Fmt --- codegen/src/types/mod.rs | 8 ++++---- codegen/src/types/type_def.rs | 9 +++------ codegen/src/types/type_path.rs | 8 +++----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index 2c2077386f..c59501de1f 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -16,8 +16,8 @@ #[cfg(test)] mod tests; -mod type_path; mod type_def; +mod type_path; use super::GeneratedTypeDerives; use proc_macro2::{ @@ -43,11 +43,11 @@ use std::collections::{ pub use self::{ type_def::TypeDefGen, type_path::{ - TypePath, - TypePathType, TypeParameter, + TypePath, TypePathSubstitute, - } + TypePathType, + }, }; /// Generate a Rust module containing all types defined in the supplied [`PortableRegistry`]. diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index 665a66ec70..1bcb2efb53 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -16,13 +16,10 @@ use super::{ TypeGenerator, - TypePath, TypeParameter, + TypePath, }; -use proc_macro2::{ - TokenStream as TokenStream2, - TokenStream, -}; +use proc_macro2::TokenStream as TokenStream2; use quote::{ format_ident, quote, @@ -327,4 +324,4 @@ impl<'a> TypeDefGen<'a> { }; quote! ( ::core::marker::PhantomData<#params> ) } -} \ No newline at end of file +} diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs index 90a70f7ba7..e63916c7fe 100644 --- a/codegen/src/types/type_path.rs +++ b/codegen/src/types/type_path.rs @@ -15,8 +15,8 @@ // along with subxt. If not, see . use proc_macro2::{ - TokenStream, Ident, + TokenStream, }; use quote::{ format_ident, @@ -28,9 +28,7 @@ use scale_info::{ TypeDef, TypeDefPrimitive, }; -use std::collections::{ - HashSet, -}; +use std::collections::HashSet; use syn::parse_quote; #[derive(Clone, Debug)] @@ -254,4 +252,4 @@ impl TypePathSubstitute { parse_quote! ( #substitute_path< #( #params ),* > ) } } -} \ No newline at end of file +} From 1d1fffe0e3bad5009006ed65cf557556d7183318 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 10:55:32 +0100 Subject: [PATCH 195/216] Factor out type parameter from final_key --- src/storage.rs | 6 ++--- tests/integration/frame/contracts.rs | 38 +++++++++------------------- 2 files changed, 15 insertions(+), 29 deletions(-) diff --git a/src/storage.rs b/src/storage.rs index 487119fe34..e94d640926 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -79,8 +79,7 @@ pub enum StorageEntryKey { impl StorageEntryKey { /// Construct the final [`sp_core::storage::StorageKey`] for the storage entry. - pub fn final_key(&self) -> sp_core::storage::StorageKey { - let prefix = StorageKeyPrefix::new::(); + pub fn final_key(&self, prefix: StorageKeyPrefix) -> sp_core::storage::StorageKey { let mut bytes = prefix.0; if let Self::Map(map_keys) = self { for map_key in map_keys { @@ -178,7 +177,8 @@ impl<'a, T: Config> StorageClient<'a, T> { store: &F, hash: Option, ) -> Result, Error> { - let key = store.key().final_key::(); // todo: [AJ] can we factor this type param on final key out + let prefix = StorageKeyPrefix::new::(); + let key = store.key().final_key(prefix); self.fetch_unhashed::(key, hash).await } diff --git a/tests/integration/frame/contracts.rs b/tests/integration/frame/contracts.rs index ca91f5cd4b..75e18d38d0 100644 --- a/tests/integration/frame/contracts.rs +++ b/tests/integration/frame/contracts.rs @@ -37,7 +37,6 @@ use subxt::{ Error, ExtrinsicSuccess, PairSigner, - StorageEntry, }; struct ContractsTestContext { @@ -184,32 +183,19 @@ async fn tx_instantiate() { #[async_std::test] async fn tx_call() { - let ctx = ContractsTestContext::init().await; - let (_, contract) = ctx.instantiate_with_code().await.unwrap(); - - // let contract_info = ctx - // .api() - // .storage - // .contracts - // .contract_info_of(contract.clone(), None) - // .await; - // assert!(contract_info.is_ok()); - - let contract_info_of = storage::ContractInfoOf(contract.clone()); - let storage_entry_key = - ::key(&contract_info_of); - let final_key = storage_entry_key.final_key::(); - println!("contract_info_key key {:?}", hex::encode(&final_key.0)); - - let res = ctx - .client() + let cxt = ContractsTestContext::init().await; + let (_, contract) = cxt.instantiate_with_code().await.unwrap(); + + let contract_info = cxt + .cxt + .api .storage() - .fetch_raw(final_key, None) - .await - .unwrap(); - println!("Result {:?}", res); + .contracts() + .contract_info_of(contract.clone(), None) + .await; + assert!(contract_info.is_ok()); - let keys = ctx + let keys = cxt .client() .storage() .fetch_keys::(5, None, None) @@ -220,7 +206,7 @@ async fn tx_call() { .collect::>(); println!("keys post: {:?}", keys); - let executed = ctx.call(contract, vec![]).await; + let executed = cxt.call(contract, vec![]).await; assert!(executed.is_ok(), "Error calling contract: {:?}", executed); } From b301a85928b1fbb09e6f6a181dd8a3e614be61d9 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 10:56:40 +0100 Subject: [PATCH 196/216] Fix some type paths --- codegen/src/types/type_def.rs | 6 +- codegen/src/types/type_path.rs | 4 +- tests/integration/codegen/polkadot.rs | 717 ++++++++++++++------------ 3 files changed, 398 insertions(+), 329 deletions(-) diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index 1bcb2efb53..ee9f9b1c82 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -19,7 +19,7 @@ use super::{ TypeParameter, TypePath, }; -use proc_macro2::TokenStream as TokenStream2; +use proc_macro2::TokenStream; use quote::{ format_ident, quote, @@ -178,7 +178,7 @@ impl<'a> TypeDefGen<'a> { fields: &'a [Field], type_params: &'a [TypeParameter], is_struct: bool, - ) -> (TokenStream2, Vec) { + ) -> (TokenStream, Vec) { let named = fields.iter().all(|f| f.name().is_some()); let unnamed = fields.iter().all(|f| f.name().is_none()); @@ -315,7 +315,7 @@ impl<'a> TypeDefGen<'a> { } } - fn phantom_data(params: &[TypeParameter]) -> TokenStream2 { + fn phantom_data(params: &[TypeParameter]) -> TokenStream { let params = if params.len() == 1 { let param = ¶ms[0]; quote! { #param } diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs index e63916c7fe..983b8283e0 100644 --- a/codegen/src/types/type_path.rs +++ b/codegen/src/types/type_path.rs @@ -138,7 +138,7 @@ impl TypePathType { } TypeDef::Sequence(_) => { let type_param = &self.params[0]; - let type_path = parse_quote! { Vec<#type_param> }; + let type_path = parse_quote! { ::std::vec::Vec<#type_param> }; syn::Type::Path(type_path) } TypeDef::Array(array) => { @@ -155,7 +155,7 @@ impl TypePathType { let path = match primitive { TypeDefPrimitive::Bool => parse_quote!(::core::primitive::bool), TypeDefPrimitive::Char => parse_quote!(::core::primitive::char), - TypeDefPrimitive::Str => parse_quote!(::alloc::string::String), + TypeDefPrimitive::Str => parse_quote!(::std::string::String), TypeDefPrimitive::U8 => parse_quote!(::core::primitive::u8), TypeDefPrimitive::U16 => parse_quote!(::core::primitive::u16), TypeDefPrimitive::U32 => parse_quote!(::core::primitive::u32), diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index ed9813482a..99f9894af7 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -83,7 +83,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Remark { - pub remark: Vec<::core::primitive::u8>, + pub remark: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for Remark { const PALLET: &'static str = "System"; @@ -99,7 +99,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetCode { - pub code: Vec<::core::primitive::u8>, + pub code: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for SetCode { const PALLET: &'static str = "System"; @@ -107,7 +107,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetCodeWithoutChecks { - pub code: Vec<::core::primitive::u8>, + pub code: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for SetCodeWithoutChecks { const PALLET: &'static str = "System"; @@ -125,7 +125,10 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetStorage { - pub items: Vec<(Vec<::core::primitive::u8>, Vec<::core::primitive::u8>)>, + 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"; @@ -133,7 +136,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KillStorage { - pub keys: Vec>, + pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, } impl ::subxt::Call for KillStorage { const PALLET: &'static str = "System"; @@ -141,7 +144,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct KillPrefix { - pub prefix: Vec<::core::primitive::u8>, + pub prefix: ::std::vec::Vec<::core::primitive::u8>, pub subkeys: ::core::primitive::u32, } impl ::subxt::Call for KillPrefix { @@ -150,7 +153,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RemarkWithEvent { - pub remark: Vec<::core::primitive::u8>, + pub remark: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for RemarkWithEvent { const PALLET: &'static str = "System"; @@ -178,7 +181,7 @@ pub mod api { } pub fn remark( &self, - remark: Vec<::core::primitive::u8>, + remark: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = Remark { remark }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -192,14 +195,14 @@ pub mod api { } pub fn set_code( &self, - code: Vec<::core::primitive::u8>, + code: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = SetCode { code }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn set_code_without_checks( &self, - code: Vec<::core::primitive::u8>, + code: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = SetCodeWithoutChecks { code }; @@ -219,21 +222,24 @@ pub mod api { } pub fn set_storage( &self, - items: Vec<(Vec<::core::primitive::u8>, Vec<::core::primitive::u8>)>, + items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, ) -> ::subxt::SubmittableExtrinsic { let call = SetStorage { items }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn kill_storage( &self, - keys: Vec>, + keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, ) -> ::subxt::SubmittableExtrinsic { let call = KillStorage { keys }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn kill_prefix( &self, - prefix: Vec<::core::primitive::u8>, + prefix: ::std::vec::Vec<::core::primitive::u8>, subkeys: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic { let call = KillPrefix { prefix, subkeys }; @@ -241,7 +247,7 @@ pub mod api { } pub fn remark_with_event( &self, - remark: Vec<::core::primitive::u8>, + remark: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = RemarkWithEvent { remark }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -358,7 +364,7 @@ pub mod api { impl ::subxt::StorageEntry for ExtrinsicData { const PALLET: &'static str = "System"; const STORAGE: &'static str = "ExtrinsicData"; - type Value = Vec<::core::primitive::u8>; + type Value = ::std::vec::Vec<::core::primitive::u8>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -399,7 +405,7 @@ pub mod api { impl ::subxt::StorageEntry for Events { const PALLET: &'static str = "System"; const STORAGE: &'static str = "Events"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::frame_system::EventRecord< runtime_types::node_runtime::Event, ::subxt::sp_core::H256, @@ -422,7 +428,8 @@ pub mod api { impl ::subxt::StorageEntry for EventTopics { const PALLET: &'static str = "System"; const STORAGE: &'static str = "EventTopics"; - type Value = Vec<(::core::primitive::u32, ::core::primitive::u32)>; + 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, @@ -552,8 +559,10 @@ pub mod api { &self, _0: ::core::primitive::u32, hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u8>, + ::subxt::Error, + > { let entry = ExtrinsicData(_0); self.client.storage().fetch_or_default(&entry, hash).await } @@ -598,7 +607,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::frame_system::EventRecord< runtime_types::node_runtime::Event, ::subxt::sp_core::H256, @@ -622,7 +631,7 @@ pub mod api { _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(::core::primitive::u32, ::core::primitive::u32)>, + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, ::subxt::Error, > { let entry = EventTopics(_0); @@ -684,7 +693,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Batch { - pub calls: Vec, + pub calls: ::std::vec::Vec, } impl ::subxt::Call for Batch { const PALLET: &'static str = "Utility"; @@ -701,7 +710,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct BatchAll { - pub calls: Vec, + pub calls: ::std::vec::Vec, } impl ::subxt::Call for BatchAll { const PALLET: &'static str = "Utility"; @@ -722,7 +731,7 @@ pub mod api { } pub fn batch( &self, - calls: Vec, + calls: ::std::vec::Vec, ) -> ::subxt::SubmittableExtrinsic { let call = Batch { calls }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -737,7 +746,7 @@ pub mod api { } pub fn batch_all( &self, - calls: Vec, + calls: ::std::vec::Vec, ) -> ::subxt::SubmittableExtrinsic { let call = BatchAll { calls }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -1271,7 +1280,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetUncles { - pub new_uncles: Vec< + pub new_uncles: ::std::vec::Vec< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -1297,7 +1306,7 @@ pub mod api { } pub fn set_uncles( &self, - new_uncles: Vec< + new_uncles: ::std::vec::Vec< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -1315,7 +1324,7 @@ pub mod api { impl ::subxt::StorageEntry for Uncles { const PALLET: &'static str = "Authorship"; const STORAGE: &'static str = "Uncles"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_authorship::UncleEntryItem< ::core::primitive::u32, ::subxt::sp_core::H256, @@ -1355,7 +1364,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_authorship::UncleEntryItem< ::core::primitive::u32, ::subxt::sp_core::H256, @@ -2065,7 +2074,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetEmergencyElectionResult { - pub supports: Vec<( + pub supports: ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::sp_npos_elections::Support< ::subxt::sp_core::crypto::AccountId32, @@ -2124,7 +2133,7 @@ pub mod api { } pub fn set_emergency_election_result( &self, - supports: Vec<( + supports: ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::sp_npos_elections::Support< ::subxt::sp_core::crypto::AccountId32, @@ -2443,7 +2452,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Nominate { - pub targets: Vec< + pub targets: ::std::vec::Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u32, @@ -2521,7 +2530,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetInvulnerables { - pub invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + pub invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, } impl ::subxt::Call for SetInvulnerables { const PALLET: &'static str = "Staking"; @@ -2545,7 +2554,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CancelDeferredSlash { pub era: ::core::primitive::u32, - pub slash_indices: Vec<::core::primitive::u32>, + pub slash_indices: ::std::vec::Vec<::core::primitive::u32>, } impl ::subxt::Call for CancelDeferredSlash { const PALLET: &'static str = "Staking"; @@ -2591,7 +2600,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Kick { - pub who: Vec< + pub who: ::std::vec::Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u32, @@ -2685,7 +2694,7 @@ pub mod api { } pub fn nominate( &self, - targets: Vec< + targets: ::std::vec::Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u32, @@ -2755,7 +2764,7 @@ pub mod api { } pub fn set_invulnerables( &self, - invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ) -> ::subxt::SubmittableExtrinsic { let call = SetInvulnerables { invulnerables }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -2780,7 +2789,7 @@ pub mod api { pub fn cancel_deferred_slash( &self, era: ::core::primitive::u32, - slash_indices: Vec<::core::primitive::u32>, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, ) -> ::subxt::SubmittableExtrinsic { let call = CancelDeferredSlash { era, slash_indices }; @@ -2828,7 +2837,7 @@ pub mod api { } pub fn kick( &self, - who: Vec< + who: ::std::vec::Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u32, @@ -3000,7 +3009,7 @@ pub mod api { impl ::subxt::StorageEntry for Invulnerables { const PALLET: &'static str = "Staking"; const STORAGE: &'static str = "Invulnerables"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -3294,7 +3303,7 @@ pub mod api { impl ::subxt::StorageEntry for UnappliedSlashes { const PALLET: &'static str = "Staking"; const STORAGE: &'static str = "UnappliedSlashes"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_staking::UnappliedSlash< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -3311,7 +3320,8 @@ pub mod api { impl ::subxt::StorageEntry for BondedEras { const PALLET: &'static str = "Staking"; const STORAGE: &'static str = "BondedEras"; - type Value = Vec<(::core::primitive::u32, ::core::primitive::u32)>; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -3412,7 +3422,8 @@ pub mod api { impl ::subxt::StorageEntry for OffendingValidators { const PALLET: &'static str = "Staking"; const STORAGE: &'static str = "OffendingValidators"; - type Value = Vec<(::core::primitive::u32, ::core::primitive::bool)>; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -3470,7 +3481,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { let entry = Invulnerables; @@ -3835,7 +3846,7 @@ pub mod api { _0: ::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_staking::UnappliedSlash< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -3859,7 +3870,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(::core::primitive::u32, ::core::primitive::u32)>, + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, ::subxt::Error, > { let entry = BondedEras; @@ -3977,7 +3988,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(::core::primitive::u32, ::core::primitive::bool)>, + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, ::subxt::Error, > { let entry = OffendingValidators; @@ -4015,7 +4026,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetKeys { pub keys: runtime_types::node_runtime::SessionKeys, - pub proof: Vec<::core::primitive::u8>, + pub proof: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for SetKeys { const PALLET: &'static str = "Session"; @@ -4043,7 +4054,7 @@ pub mod api { pub fn set_keys( &self, keys: runtime_types::node_runtime::SessionKeys, - proof: Vec<::core::primitive::u8>, + proof: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = SetKeys { keys, proof }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -4070,7 +4081,7 @@ pub mod api { impl ::subxt::StorageEntry for Validators { const PALLET: &'static str = "Session"; const STORAGE: &'static str = "Validators"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -4097,7 +4108,7 @@ pub mod api { impl ::subxt::StorageEntry for QueuedKeys { const PALLET: &'static str = "Session"; const STORAGE: &'static str = "QueuedKeys"; - type Value = Vec<( + type Value = ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::node_runtime::SessionKeys, )>; @@ -4109,7 +4120,7 @@ pub mod api { impl ::subxt::StorageEntry for DisabledValidators { const PALLET: &'static str = "Session"; const STORAGE: &'static str = "DisabledValidators"; - type Value = Vec<::core::primitive::u32>; + type Value = ::std::vec::Vec<::core::primitive::u32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -4128,7 +4139,7 @@ pub mod api { } pub struct KeyOwner( runtime_types::sp_core::crypto::KeyTypeId, - Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, ); impl ::subxt::StorageEntry for KeyOwner { const PALLET: &'static str = "Session"; @@ -4152,7 +4163,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { let entry = Validators; @@ -4178,7 +4189,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<( + ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::node_runtime::SessionKeys, )>, @@ -4190,8 +4201,10 @@ pub mod api { pub async fn disabled_validators( &self, hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u32>, + ::subxt::Error, + > { let entry = DisabledValidators; self.client.storage().fetch_or_default(&entry, hash).await } @@ -4218,7 +4231,7 @@ pub mod api { pub async fn key_owner( &self, _0: runtime_types::sp_core::crypto::KeyTypeId, - _1: Vec<::core::primitive::u8>, + _1: ::std::vec::Vec<::core::primitive::u8>, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, @@ -4367,7 +4380,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NotePreimage { - pub encoded_proposal: Vec<::core::primitive::u8>, + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for NotePreimage { const PALLET: &'static str = "Democracy"; @@ -4375,7 +4388,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NotePreimageOperational { - pub encoded_proposal: Vec<::core::primitive::u8>, + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for NotePreimageOperational { const PALLET: &'static str = "Democracy"; @@ -4383,7 +4396,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NoteImminentPreimage { - pub encoded_proposal: Vec<::core::primitive::u8>, + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for NoteImminentPreimage { const PALLET: &'static str = "Democracy"; @@ -4391,7 +4404,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NoteImminentPreimageOperational { - pub encoded_proposal: Vec<::core::primitive::u8>, + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for NoteImminentPreimageOperational { const PALLET: &'static str = "Democracy"; @@ -4594,14 +4607,14 @@ pub mod api { } pub fn note_preimage( &self, - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = NotePreimage { encoded_proposal }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn note_preimage_operational( &self, - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = NotePreimageOperational { encoded_proposal }; @@ -4609,7 +4622,7 @@ pub mod api { } pub fn note_imminent_preimage( &self, - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = NoteImminentPreimage { encoded_proposal }; @@ -4617,7 +4630,7 @@ pub mod api { } pub fn note_imminent_preimage_operational( &self, - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = NoteImminentPreimageOperational { encoded_proposal }; @@ -4700,7 +4713,7 @@ pub mod api { pub struct Tabled( pub ::core::primitive::u32, pub ::core::primitive::u128, - pub Vec<::subxt::sp_core::crypto::AccountId32>, + pub ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ); impl ::subxt::Event for Tabled { const PALLET: &'static str = "Democracy"; @@ -4844,7 +4857,7 @@ pub mod api { impl ::subxt::StorageEntry for PublicProps { const PALLET: &'static str = "Democracy"; const STORAGE: &'static str = "PublicProps"; - type Value = Vec<( + type Value = ::std::vec::Vec<( ::core::primitive::u32, ::subxt::sp_core::H256, ::subxt::sp_core::crypto::AccountId32, @@ -4858,7 +4871,7 @@ pub mod api { const PALLET: &'static str = "Democracy"; const STORAGE: &'static str = "DepositOf"; type Value = ( - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::core::primitive::u128, ); fn key(&self) -> ::subxt::StorageEntryKey { @@ -4973,7 +4986,7 @@ pub mod api { const STORAGE: &'static str = "Blacklist"; type Value = ( ::core::primitive::u32, - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ); fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( @@ -5022,7 +5035,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<( + ::std::vec::Vec<( ::core::primitive::u32, ::subxt::sp_core::H256, ::subxt::sp_core::crypto::AccountId32, @@ -5038,7 +5051,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<( - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::core::primitive::u128, )>, ::subxt::Error, @@ -5193,7 +5206,7 @@ pub mod api { ) -> ::core::result::Result< ::core::option::Option<( ::core::primitive::u32, - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, )>, ::subxt::Error, > { @@ -5246,7 +5259,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetMembers { - pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + 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, } @@ -5324,7 +5337,7 @@ pub mod api { } pub fn set_members( &self, - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, old_count: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic { @@ -5518,7 +5531,7 @@ pub mod api { impl ::subxt::StorageEntry for Members { const PALLET: &'static str = "Council"; const STORAGE: &'static str = "Members"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -5606,7 +5619,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { let entry = Members; @@ -5631,7 +5644,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetMembers { - pub new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + 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, } @@ -5709,7 +5722,7 @@ pub mod api { } pub fn set_members( &self, - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + new_members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, old_count: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic { @@ -5903,7 +5916,7 @@ pub mod api { impl ::subxt::StorageEntry for Members { const PALLET: &'static str = "TechnicalCommittee"; const STORAGE: &'static str = "Members"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -5991,7 +6004,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { let entry = Members; @@ -6016,7 +6029,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Vote { - pub votes: Vec<::subxt::sp_core::crypto::AccountId32>, + pub votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, #[codec(compact)] pub value: ::core::primitive::u128, } @@ -6083,7 +6096,7 @@ pub mod api { } pub fn vote( &self, - votes: Vec<::subxt::sp_core::crypto::AccountId32>, + votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, value: ::core::primitive::u128, ) -> ::subxt::SubmittableExtrinsic { let call = Vote { votes, value }; @@ -6142,7 +6155,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NewTerm( - pub Vec<( + pub ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, @@ -6200,7 +6213,7 @@ pub mod api { impl ::subxt::StorageEntry for Members { const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "Members"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_elections_phragmen::SeatHolder< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -6214,7 +6227,7 @@ pub mod api { impl ::subxt::StorageEntry for RunnersUp { const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "RunnersUp"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_elections_phragmen::SeatHolder< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -6228,7 +6241,7 @@ pub mod api { impl ::subxt::StorageEntry for Candidates { const PALLET: &'static str = "Elections"; const STORAGE: &'static str = "Candidates"; - type Value = Vec<( + type Value = ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, )>; @@ -6271,7 +6284,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_elections_phragmen::SeatHolder< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -6286,7 +6299,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_elections_phragmen::SeatHolder< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -6301,7 +6314,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<( + ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, @@ -6373,7 +6386,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ResetMembers { - pub members: Vec<::subxt::sp_core::crypto::AccountId32>, + pub members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, } impl ::subxt::Call for ResetMembers { const PALLET: &'static str = "TechnicalMembership"; @@ -6438,7 +6451,7 @@ pub mod api { } pub fn reset_members( &self, - members: Vec<::subxt::sp_core::crypto::AccountId32>, + members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ) -> ::subxt::SubmittableExtrinsic { let call = ResetMembers { members }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -6511,7 +6524,7 @@ pub mod api { impl ::subxt::StorageEntry for Members { const PALLET: &'static str = "TechnicalMembership"; const STORAGE: &'static str = "Members"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -6536,7 +6549,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { let entry = Members; @@ -6649,7 +6662,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NewAuthorities( - pub Vec<( + pub ::std::vec::Vec<( runtime_types::sp_finality_grandpa::app::Public, ::core::primitive::u64, )>, @@ -7050,7 +7063,7 @@ pub mod api { pub value: ::core::primitive::u128, #[codec(compact)] pub gas_limit: ::core::primitive::u64, - pub data: Vec<::core::primitive::u8>, + pub data: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for Call { const PALLET: &'static str = "Contracts"; @@ -7062,9 +7075,9 @@ pub mod api { pub endowment: ::core::primitive::u128, #[codec(compact)] pub gas_limit: ::core::primitive::u64, - pub code: Vec<::core::primitive::u8>, - pub data: Vec<::core::primitive::u8>, - pub salt: Vec<::core::primitive::u8>, + pub code: ::std::vec::Vec<::core::primitive::u8>, + pub data: ::std::vec::Vec<::core::primitive::u8>, + pub salt: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for InstantiateWithCode { const PALLET: &'static str = "Contracts"; @@ -7077,8 +7090,8 @@ pub mod api { #[codec(compact)] pub gas_limit: ::core::primitive::u64, pub code_hash: ::subxt::sp_core::H256, - pub data: Vec<::core::primitive::u8>, - pub salt: Vec<::core::primitive::u8>, + pub data: ::std::vec::Vec<::core::primitive::u8>, + pub salt: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for Instantiate { const PALLET: &'static str = "Contracts"; @@ -7105,7 +7118,7 @@ pub mod api { >, value: ::core::primitive::u128, gas_limit: ::core::primitive::u64, - data: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = Call { dest, @@ -7119,9 +7132,9 @@ pub mod api { &self, endowment: ::core::primitive::u128, gas_limit: ::core::primitive::u64, - code: Vec<::core::primitive::u8>, - data: Vec<::core::primitive::u8>, - salt: Vec<::core::primitive::u8>, + code: ::std::vec::Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = InstantiateWithCode { @@ -7138,8 +7151,8 @@ pub mod api { endowment: ::core::primitive::u128, gas_limit: ::core::primitive::u64, code_hash: ::subxt::sp_core::H256, - data: Vec<::core::primitive::u8>, - salt: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = Instantiate { endowment, @@ -7192,7 +7205,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ContractEmitted { pub contract: ::subxt::sp_core::crypto::AccountId32, - pub data: Vec<::core::primitive::u8>, + pub data: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Event for ContractEmitted { const PALLET: &'static str = "Contracts"; @@ -7213,7 +7226,7 @@ pub mod api { impl ::subxt::StorageEntry for PristineCode { const PALLET: &'static str = "Contracts"; const STORAGE: &'static str = "PristineCode"; - type Value = Vec<::core::primitive::u8>; + type Value = ::std::vec::Vec<::core::primitive::u8>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -7260,8 +7273,9 @@ pub mod api { impl ::subxt::StorageEntry for DeletionQueue { const PALLET: &'static str = "Contracts"; const STORAGE: &'static str = "DeletionQueue"; - type Value = - Vec; + type Value = ::std::vec::Vec< + runtime_types::pallet_contracts::storage::DeletedContract, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -7278,7 +7292,7 @@ pub mod api { _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option>, + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, ::subxt::Error, > { let entry = PristineCode(_0); @@ -7351,7 +7365,9 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::std::vec::Vec< + runtime_types::pallet_contracts::storage::DeletedContract, + >, ::subxt::Error, > { let entry = DeletionQueue; @@ -7575,7 +7591,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SomeOffline( - pub Vec<( + pub ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::pallet_staking::Exposure< ::subxt::sp_core::crypto::AccountId32, @@ -7725,7 +7741,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Offence( pub [::core::primitive::u8; 16usize], - pub Vec<::core::primitive::u8>, + pub ::std::vec::Vec<::core::primitive::u8>, ); impl ::subxt::Event for Offence { const PALLET: &'static str = "Offences"; @@ -7757,12 +7773,12 @@ pub mod api { } pub struct ConcurrentReportsIndex( [::core::primitive::u8; 16usize], - Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, ); impl ::subxt::StorageEntry for ConcurrentReportsIndex { const PALLET: &'static str = "Offences"; const STORAGE: &'static str = "ConcurrentReportsIndex"; - type Value = Vec<::subxt::sp_core::H256>; + type Value = ::std::vec::Vec<::subxt::sp_core::H256>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![ ::subxt::StorageMapKey::new( @@ -7780,7 +7796,7 @@ pub mod api { impl ::subxt::StorageEntry for ReportsByKindIndex { const PALLET: &'static str = "Offences"; const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = Vec<::core::primitive::u8>; + type Value = ::std::vec::Vec<::core::primitive::u8>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -7829,10 +7845,12 @@ pub mod api { pub async fn concurrent_reports_index( &self, _0: [::core::primitive::u8; 16usize], - _1: Vec<::core::primitive::u8>, + _1: ::std::vec::Vec<::core::primitive::u8>, hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::H256>, + ::subxt::Error, + > { let entry = ConcurrentReportsIndex(_0, _1); self.client.storage().fetch_or_default(&entry, hash).await } @@ -7849,8 +7867,10 @@ pub mod api { &self, _0: [::core::primitive::u8; 16usize], hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u8>, + ::subxt::Error, + > { let entry = ReportsByKindIndex(_0); self.client.storage().fetch_or_default(&entry, hash).await } @@ -7877,7 +7897,7 @@ pub mod api { impl ::subxt::StorageEntry for RandomMaterial { const PALLET: &'static str = "RandomnessCollectiveFlip"; const STORAGE: &'static str = "RandomMaterial"; - type Value = Vec<::subxt::sp_core::H256>; + type Value = ::std::vec::Vec<::subxt::sp_core::H256>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -7892,8 +7912,10 @@ pub mod api { pub async fn random_material( &self, hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { + ) -> ::core::result::Result< + ::std::vec::Vec<::subxt::sp_core::H256>, + ::subxt::Error, + > { let entry = RandomMaterial; self.client.storage().fetch_or_default(&entry, hash).await } @@ -7922,7 +7944,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetSubs { - pub subs: Vec<( + pub subs: ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::pallet_identity::types::Data, )>, @@ -8086,7 +8108,7 @@ pub mod api { } pub fn set_subs( &self, - subs: Vec<( + subs: ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::pallet_identity::types::Data, )>, @@ -8528,7 +8550,7 @@ pub mod api { pub struct Found { pub founder: ::subxt::sp_core::crypto::AccountId32, pub max_members: ::core::primitive::u32, - pub rules: Vec<::core::primitive::u8>, + pub rules: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for Found { const PALLET: &'static str = "Society"; @@ -8635,7 +8657,7 @@ pub mod api { &self, founder: ::subxt::sp_core::crypto::AccountId32, max_members: ::core::primitive::u32, - rules: Vec<::core::primitive::u8>, + rules: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = Found { founder, @@ -8724,7 +8746,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Inducted( pub ::subxt::sp_core::crypto::AccountId32, - pub Vec<::subxt::sp_core::crypto::AccountId32>, + pub ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ); impl ::subxt::Event for Inducted { const PALLET: &'static str = "Society"; @@ -8819,7 +8841,7 @@ pub mod api { impl ::subxt::StorageEntry for Candidates { const PALLET: &'static str = "Society"; const STORAGE: &'static str = "Candidates"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_society::Bid< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -8869,7 +8891,7 @@ pub mod api { impl ::subxt::StorageEntry for Members { const PALLET: &'static str = "Society"; const STORAGE: &'static str = "Members"; - type Value = Vec<::subxt::sp_core::crypto::AccountId32>; + type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -8890,7 +8912,7 @@ pub mod api { impl ::subxt::StorageEntry for Bids { const PALLET: &'static str = "Society"; const STORAGE: &'static str = "Bids"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_society::Bid< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -8916,7 +8938,8 @@ pub mod api { impl ::subxt::StorageEntry for Payouts { const PALLET: &'static str = "Society"; const STORAGE: &'static str = "Payouts"; - type Value = Vec<(::core::primitive::u32, ::core::primitive::u128)>; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -9018,7 +9041,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_society::Bid< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -9077,7 +9100,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ::subxt::Error, > { let entry = Members; @@ -9105,7 +9128,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_society::Bid< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, @@ -9141,7 +9164,7 @@ pub mod api { _0: ::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(::core::primitive::u32, ::core::primitive::u128)>, + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>, ::subxt::Error, > { let entry = Payouts(_0); @@ -9258,7 +9281,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CreateRecovery { - pub friends: Vec<::subxt::sp_core::crypto::AccountId32>, + pub friends: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, pub threshold: ::core::primitive::u16, pub delay_period: ::core::primitive::u32, } @@ -9344,7 +9367,7 @@ pub mod api { } pub fn create_recovery( &self, - friends: Vec<::subxt::sp_core::crypto::AccountId32>, + friends: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, threshold: ::core::primitive::u16, delay_period: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic { @@ -9853,7 +9876,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ScheduleNamed { - pub id: Vec<::core::primitive::u8>, + pub id: ::std::vec::Vec<::core::primitive::u8>, pub when: ::core::primitive::u32, pub maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -9868,7 +9891,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CancelNamed { - pub id: Vec<::core::primitive::u8>, + pub id: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for CancelNamed { const PALLET: &'static str = "Scheduler"; @@ -9890,7 +9913,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ScheduleNamedAfter { - pub id: Vec<::core::primitive::u8>, + pub id: ::std::vec::Vec<::core::primitive::u8>, pub after: ::core::primitive::u32, pub maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -9944,7 +9967,7 @@ pub mod api { } pub fn schedule_named( &self, - id: Vec<::core::primitive::u8>, + id: ::std::vec::Vec<::core::primitive::u8>, when: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -9964,7 +9987,7 @@ pub mod api { } pub fn cancel_named( &self, - id: Vec<::core::primitive::u8>, + id: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = CancelNamed { id }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -9989,7 +10012,7 @@ pub mod api { } pub fn schedule_named_after( &self, - id: Vec<::core::primitive::u8>, + id: ::std::vec::Vec<::core::primitive::u8>, after: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -10028,7 +10051,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Dispatched( pub (::core::primitive::u32, ::core::primitive::u32), - pub ::core::option::Option>, + pub ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, ); impl ::subxt::Event for Dispatched { @@ -10042,7 +10065,7 @@ pub mod api { impl ::subxt::StorageEntry for Agenda { const PALLET: &'static str = "Scheduler"; const STORAGE: &'static str = "Agenda"; - type Value = Vec< + type Value = ::std::vec::Vec< ::core::option::Option< runtime_types::pallet_scheduler::ScheduledV2< runtime_types::node_runtime::Call, @@ -10059,7 +10082,7 @@ pub mod api { )]) } } - pub struct Lookup(pub Vec<::core::primitive::u8>); + pub struct Lookup(pub ::std::vec::Vec<::core::primitive::u8>); impl ::subxt::StorageEntry for Lookup { const PALLET: &'static str = "Scheduler"; const STORAGE: &'static str = "Lookup"; @@ -10092,7 +10115,7 @@ pub mod api { _0: ::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< ::core::option::Option< runtime_types::pallet_scheduler::ScheduledV2< runtime_types::node_runtime::Call, @@ -10116,7 +10139,7 @@ pub mod api { } pub async fn lookup( &self, - _0: Vec<::core::primitive::u8>, + _0: ::std::vec::Vec<::core::primitive::u8>, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option<( @@ -10552,7 +10575,8 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct AsMultiThreshold1 { - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + pub other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, pub call: runtime_types::node_runtime::Call, } impl ::subxt::Call for AsMultiThreshold1 { @@ -10562,7 +10586,8 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct AsMulti { pub threshold: ::core::primitive::u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + 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>, >, @@ -10577,7 +10602,8 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ApproveAsMulti { pub threshold: ::core::primitive::u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + 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>, >, @@ -10591,7 +10617,8 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct CancelAsMulti { pub threshold: ::core::primitive::u16, - pub other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + 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], @@ -10615,7 +10642,9 @@ pub mod api { } pub fn as_multi_threshold1( &self, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, call: runtime_types::node_runtime::Call, ) -> ::subxt::SubmittableExtrinsic { let call = AsMultiThreshold1 { @@ -10627,7 +10656,9 @@ pub mod api { pub fn as_multi( &self, threshold: ::core::primitive::u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, @@ -10648,7 +10679,9 @@ pub mod api { pub fn approve_as_multi( &self, threshold: ::core::primitive::u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, @@ -10667,7 +10700,9 @@ pub mod api { pub fn cancel_as_multi( &self, threshold: ::core::primitive::u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: ::std::vec::Vec< + ::subxt::sp_core::crypto::AccountId32, + >, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, @@ -10841,7 +10876,7 @@ pub mod api { pub struct ProposeBounty { #[codec(compact)] pub value: ::core::primitive::u128, - pub description: Vec<::core::primitive::u8>, + pub description: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for ProposeBounty { const PALLET: &'static str = "Bounties"; @@ -10924,7 +10959,7 @@ pub mod api { pub struct ExtendBountyExpiry { #[codec(compact)] pub bounty_id: ::core::primitive::u32, - pub remark: Vec<::core::primitive::u8>, + pub remark: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for ExtendBountyExpiry { const PALLET: &'static str = "Bounties"; @@ -10946,7 +10981,7 @@ pub mod api { pub fn propose_bounty( &self, value: ::core::primitive::u128, - description: Vec<::core::primitive::u8>, + description: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = ProposeBounty { value, description }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -11019,7 +11054,7 @@ pub mod api { pub fn extend_bounty_expiry( &self, bounty_id: ::core::primitive::u32, - remark: Vec<::core::primitive::u8>, + remark: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = ExtendBountyExpiry { bounty_id, remark }; @@ -11114,7 +11149,7 @@ pub mod api { impl ::subxt::StorageEntry for BountyDescriptions { const PALLET: &'static str = "Bounties"; const STORAGE: &'static str = "BountyDescriptions"; - type Value = Vec<::core::primitive::u8>; + type Value = ::std::vec::Vec<::core::primitive::u8>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -11126,7 +11161,7 @@ pub mod api { impl ::subxt::StorageEntry for BountyApprovals { const PALLET: &'static str = "Bounties"; const STORAGE: &'static str = "BountyApprovals"; - type Value = Vec<::core::primitive::u32>; + type Value = ::std::vec::Vec<::core::primitive::u32>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -11177,7 +11212,7 @@ pub mod api { _0: ::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option>, + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, ::subxt::Error, > { let entry = BountyDescriptions(_0); @@ -11195,8 +11230,10 @@ pub mod api { pub async fn bounty_approvals( &self, hash: ::core::option::Option, - ) -> ::core::result::Result, ::subxt::Error> - { + ) -> ::core::result::Result< + ::std::vec::Vec<::core::primitive::u32>, + ::subxt::Error, + > { let entry = BountyApprovals; self.client.storage().fetch_or_default(&entry, hash).await } @@ -11209,7 +11246,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ReportAwesome { - pub reason: Vec<::core::primitive::u8>, + pub reason: ::std::vec::Vec<::core::primitive::u8>, pub who: ::subxt::sp_core::crypto::AccountId32, } impl ::subxt::Call for ReportAwesome { @@ -11226,7 +11263,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct TipNew { - pub reason: Vec<::core::primitive::u8>, + pub reason: ::std::vec::Vec<::core::primitive::u8>, pub who: ::subxt::sp_core::crypto::AccountId32, #[codec(compact)] pub tip_value: ::core::primitive::u128, @@ -11276,7 +11313,7 @@ pub mod api { } pub fn report_awesome( &self, - reason: Vec<::core::primitive::u8>, + reason: ::std::vec::Vec<::core::primitive::u8>, who: ::subxt::sp_core::crypto::AccountId32, ) -> ::subxt::SubmittableExtrinsic { let call = ReportAwesome { reason, who }; @@ -11291,7 +11328,7 @@ pub mod api { } pub fn tip_new( &self, - reason: Vec<::core::primitive::u8>, + reason: ::std::vec::Vec<::core::primitive::u8>, who: ::subxt::sp_core::crypto::AccountId32, tip_value: ::core::primitive::u128, ) -> ::subxt::SubmittableExtrinsic { @@ -11391,7 +11428,7 @@ pub mod api { impl ::subxt::StorageEntry for Reasons { const PALLET: &'static str = "Tips"; const STORAGE: &'static str = "Reasons"; - type Value = Vec<::core::primitive::u8>; + type Value = ::std::vec::Vec<::core::primitive::u8>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -11436,7 +11473,7 @@ pub mod api { _0: ::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option>, + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, ::subxt::Error, > { let entry = Reasons(_0); @@ -11659,8 +11696,8 @@ pub mod api { pub struct SetMetadata { #[codec(compact)] pub id: ::core::primitive::u32, - pub name: Vec<::core::primitive::u8>, - pub symbol: Vec<::core::primitive::u8>, + pub name: ::std::vec::Vec<::core::primitive::u8>, + pub symbol: ::std::vec::Vec<::core::primitive::u8>, pub decimals: ::core::primitive::u8, } impl ::subxt::Call for SetMetadata { @@ -11680,8 +11717,8 @@ pub mod api { pub struct ForceSetMetadata { #[codec(compact)] pub id: ::core::primitive::u32, - pub name: Vec<::core::primitive::u8>, - pub symbol: Vec<::core::primitive::u8>, + pub name: ::std::vec::Vec<::core::primitive::u8>, + pub symbol: ::std::vec::Vec<::core::primitive::u8>, pub decimals: ::core::primitive::u8, pub is_frozen: ::core::primitive::bool, } @@ -11993,8 +12030,8 @@ pub mod api { pub fn set_metadata( &self, id: ::core::primitive::u32, - name: Vec<::core::primitive::u8>, - symbol: Vec<::core::primitive::u8>, + name: ::std::vec::Vec<::core::primitive::u8>, + symbol: ::std::vec::Vec<::core::primitive::u8>, decimals: ::core::primitive::u8, ) -> ::subxt::SubmittableExtrinsic { let call = SetMetadata { @@ -12015,8 +12052,8 @@ pub mod api { pub fn force_set_metadata( &self, id: ::core::primitive::u32, - name: Vec<::core::primitive::u8>, - symbol: Vec<::core::primitive::u8>, + name: ::std::vec::Vec<::core::primitive::u8>, + symbol: ::std::vec::Vec<::core::primitive::u8>, decimals: ::core::primitive::u8, is_frozen: ::core::primitive::bool, ) -> ::subxt::SubmittableExtrinsic { @@ -12254,8 +12291,8 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MetadataSet( pub ::core::primitive::u32, - pub Vec<::core::primitive::u8>, - pub Vec<::core::primitive::u8>, + pub ::std::vec::Vec<::core::primitive::u8>, + pub ::std::vec::Vec<::core::primitive::u8>, pub ::core::primitive::u8, pub ::core::primitive::bool, ); @@ -12599,7 +12636,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SetCalls { - pub calls: Vec, + pub calls: ::std::vec::Vec, } impl ::subxt::Call for SetCalls { const PALLET: &'static str = "Lottery"; @@ -12644,7 +12681,7 @@ pub mod api { } pub fn set_calls( &self, - calls: Vec, + calls: ::std::vec::Vec, ) -> ::subxt::SubmittableExtrinsic { let call = SetCalls { calls }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -12735,7 +12772,7 @@ pub mod api { const STORAGE: &'static str = "Participants"; type Value = ( ::core::primitive::u32, - Vec<(::core::primitive::u8, ::core::primitive::u8)>, + ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>, ); fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( @@ -12769,7 +12806,8 @@ pub mod api { impl ::subxt::StorageEntry for CallIndices { const PALLET: &'static str = "Lottery"; const STORAGE: &'static str = "CallIndices"; - type Value = Vec<(::core::primitive::u8, ::core::primitive::u8)>; + type Value = + ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -12811,7 +12849,7 @@ pub mod api { ) -> ::core::result::Result< ( ::core::primitive::u32, - Vec<(::core::primitive::u8, ::core::primitive::u8)>, + ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>, ), ::subxt::Error, > { @@ -12859,7 +12897,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(::core::primitive::u8, ::core::primitive::u8)>, + ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>, ::subxt::Error, > { let entry = CallIndices; @@ -13007,7 +13045,8 @@ pub mod api { impl ::subxt::StorageEntry for QueueTotals { const PALLET: &'static str = "Gilt"; const STORAGE: &'static str = "QueueTotals"; - type Value = Vec<(::core::primitive::u32, ::core::primitive::u128)>; + type Value = + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -13016,7 +13055,7 @@ pub mod api { impl ::subxt::StorageEntry for Queues { const PALLET: &'static str = "Gilt"; const STORAGE: &'static str = "Queues"; - type Value = Vec< + type Value = ::std::vec::Vec< runtime_types::pallet_gilt::pallet::GiltBid< ::core::primitive::u128, ::subxt::sp_core::crypto::AccountId32, @@ -13067,7 +13106,7 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec<(::core::primitive::u32, ::core::primitive::u128)>, + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>, ::subxt::Error, > { let entry = QueueTotals; @@ -13078,7 +13117,7 @@ pub mod api { _0: ::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec< + ::std::vec::Vec< runtime_types::pallet_gilt::pallet::GiltBid< ::core::primitive::u128, ::subxt::sp_core::crypto::AccountId32, @@ -13227,7 +13266,7 @@ pub mod api { pub struct Redeposit { #[codec(compact)] pub class: ::core::primitive::u32, - pub instances: Vec<::core::primitive::u32>, + pub instances: ::std::vec::Vec<::core::primitive::u32>, } impl ::subxt::Call for Redeposit { const PALLET: &'static str = "Uniques"; @@ -13544,7 +13583,7 @@ pub mod api { pub fn redeposit( &self, class: ::core::primitive::u32, - instances: Vec<::core::primitive::u32>, + instances: ::std::vec::Vec<::core::primitive::u32>, ) -> ::subxt::SubmittableExtrinsic { let call = Redeposit { class, instances }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -13939,7 +13978,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Redeposited( pub ::core::primitive::u32, - pub Vec<::core::primitive::u32>, + pub ::std::vec::Vec<::core::primitive::u32>, ); impl ::subxt::Event for Redeposited { const PALLET: &'static str = "Uniques"; @@ -14265,7 +14304,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Store { - pub data: Vec<::core::primitive::u8>, + pub data: ::std::vec::Vec<::core::primitive::u8>, } impl ::subxt::Call for Store { const PALLET: &'static str = "TransactionStorage"; @@ -14304,7 +14343,7 @@ pub mod api { } pub fn store( &self, - data: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic { let call = Store { data }; ::subxt::SubmittableExtrinsic::new(self.client, call) @@ -14354,8 +14393,9 @@ pub mod api { impl ::subxt::StorageEntry for Transactions { const PALLET: &'static str = "TransactionStorage"; const STORAGE: &'static str = "Transactions"; - type Value = - Vec; + type Value = ::std::vec::Vec< + runtime_types::pallet_transaction_storage::TransactionInfo, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -14424,8 +14464,9 @@ pub mod api { impl ::subxt::StorageEntry for BlockTransactions { const PALLET: &'static str = "TransactionStorage"; const STORAGE: &'static str = "BlockTransactions"; - type Value = - Vec; + type Value = ::std::vec::Vec< + runtime_types::pallet_transaction_storage::TransactionInfo, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -14452,7 +14493,9 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - Vec, + ::std::vec::Vec< + runtime_types::pallet_transaction_storage::TransactionInfo, + >, >, ::subxt::Error, > { @@ -14534,7 +14577,9 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - Vec, + ::std::vec::Vec< + runtime_types::pallet_transaction_storage::TransactionInfo, + >, ::subxt::Error, > { let entry = BlockTransactions; @@ -14732,14 +14777,14 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] - pub struct BoundedVec<_0>(pub Vec<_0>); + 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, )] - pub struct WeakBoundedVec<_0>(pub Vec<_0>); + pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); } } pub mod traits { @@ -14888,7 +14933,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : Vec < :: core :: primitive :: u8 > , } , set_heap_pages { pages : :: core :: primitive :: u64 , } , set_code { code : Vec < :: core :: primitive :: u8 > , } , set_code_without_checks { code : Vec < :: core :: primitive :: u8 > , } , set_changes_trie_config { changes_trie_config : :: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : Vec < (Vec < :: core :: primitive :: u8 > , Vec < :: core :: primitive :: u8 > ,) > , } , kill_storage { keys : Vec < Vec < :: core :: primitive :: u8 > > , } , kill_prefix { prefix : Vec < :: core :: primitive :: u8 > , subkeys : :: core :: primitive :: u32 , } , remark_with_event { remark : Vec < :: core :: primitive :: u8 > , } , } + fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , set_heap_pages { pages : :: core :: primitive :: u64 , } , set_code { code : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , set_code_without_checks { code : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , set_changes_trie_config { changes_trie_config : :: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : :: std :: vec :: Vec < (:: std :: vec :: Vec < :: core :: primitive :: u8 > , :: std :: vec :: Vec < :: core :: primitive :: u8 > ,) > , } , kill_storage { keys : :: std :: vec :: Vec < :: std :: vec :: Vec < :: core :: primitive :: u8 > > , } , kill_prefix { prefix : :: std :: vec :: Vec < :: core :: primitive :: u8 > , subkeys : :: core :: primitive :: u32 , } , remark_with_event { remark : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { InvalidSpecName, @@ -14925,13 +14970,13 @@ pub mod api { pub struct EventRecord<_0, _1> { pub phase: runtime_types::frame_system::Phase, pub event: _0, - pub topics: Vec<_1>, + pub topics: ::std::vec::Vec<_1>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct LastRuntimeUpgradeInfo { #[codec(compact)] pub spec_version: ::core::primitive::u32, - pub spec_name: ::alloc::string::String, + pub spec_name: ::std::string::String, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Phase { @@ -15032,8 +15077,8 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct NposSolution16 { - votes1: Vec<(::core::primitive::u32, ::core::primitive::u16)>, - votes2: Vec<( + votes1: ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u16)>, + votes2: ::std::vec::Vec<( ::core::primitive::u32, ( ::core::primitive::u16, @@ -15041,7 +15086,7 @@ pub mod api { ), ::core::primitive::u16, )>, - votes3: Vec<( + votes3: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15049,7 +15094,7 @@ pub mod api { ); 2usize], ::core::primitive::u16, )>, - votes4: Vec<( + votes4: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15057,7 +15102,7 @@ pub mod api { ); 3usize], ::core::primitive::u16, )>, - votes5: Vec<( + votes5: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15065,7 +15110,7 @@ pub mod api { ); 4usize], ::core::primitive::u16, )>, - votes6: Vec<( + votes6: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15073,7 +15118,7 @@ pub mod api { ); 5usize], ::core::primitive::u16, )>, - votes7: Vec<( + votes7: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15081,7 +15126,7 @@ pub mod api { ); 6usize], ::core::primitive::u16, )>, - votes8: Vec<( + votes8: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15089,7 +15134,7 @@ pub mod api { ); 7usize], ::core::primitive::u16, )>, - votes9: Vec<( + votes9: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15097,7 +15142,7 @@ pub mod api { ); 8usize], ::core::primitive::u16, )>, - votes10: Vec<( + votes10: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15105,7 +15150,7 @@ pub mod api { ); 9usize], ::core::primitive::u16, )>, - votes11: Vec<( + votes11: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15113,7 +15158,7 @@ pub mod api { ); 10usize], ::core::primitive::u16, )>, - votes12: Vec<( + votes12: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15121,7 +15166,7 @@ pub mod api { ); 11usize], ::core::primitive::u16, )>, - votes13: Vec<( + votes13: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15129,7 +15174,7 @@ pub mod api { ); 12usize], ::core::primitive::u16, )>, - votes14: Vec<( + votes14: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15137,7 +15182,7 @@ pub mod api { ); 13usize], ::core::primitive::u16, )>, - votes15: Vec<( + votes15: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15145,7 +15190,7 @@ pub mod api { ); 14usize], ::core::primitive::u16, )>, - votes16: Vec<( + votes16: ::std::vec::Vec<( ::core::primitive::u32, [( ::core::primitive::u16, @@ -15328,8 +15373,8 @@ pub mod api { set_metadata { #[codec(compact)] id: ::core::primitive::u32, - name: Vec<::core::primitive::u8>, - symbol: Vec<::core::primitive::u8>, + name: ::std::vec::Vec<::core::primitive::u8>, + symbol: ::std::vec::Vec<::core::primitive::u8>, decimals: ::core::primitive::u8, }, clear_metadata { @@ -15339,8 +15384,8 @@ pub mod api { force_set_metadata { #[codec(compact)] id: ::core::primitive::u32, - name: Vec<::core::primitive::u8>, - symbol: Vec<::core::primitive::u8>, + name: ::std::vec::Vec<::core::primitive::u8>, + symbol: ::std::vec::Vec<::core::primitive::u8>, decimals: ::core::primitive::u8, is_frozen: ::core::primitive::bool, }, @@ -15482,8 +15527,8 @@ pub mod api { ), MetadataSet( ::core::primitive::u32, - Vec<::core::primitive::u8>, - Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, ::core::primitive::u8, ::core::primitive::bool, ), @@ -15564,7 +15609,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { set_uncles { - new_uncles: Vec< + new_uncles: ::std::vec::Vec< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -15800,7 +15845,7 @@ pub mod api { propose_bounty { #[codec(compact)] value: ::core::primitive::u128, - description: Vec<::core::primitive::u8>, + description: ::std::vec::Vec<::core::primitive::u8>, }, approve_bounty { #[codec(compact)] @@ -15843,7 +15888,7 @@ pub mod api { extend_bounty_expiry { #[codec(compact)] bounty_id: ::core::primitive::u32, - remark: Vec<::core::primitive::u8>, + remark: ::std::vec::Vec<::core::primitive::u8>, }, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] @@ -15911,7 +15956,8 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { set_members { - new_members: Vec<::subxt::sp_core::crypto::AccountId32>, + new_members: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, prime: ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, old_count: ::core::primitive::u32, @@ -16008,8 +16054,8 @@ pub mod api { pub struct Votes<_0, _1> { pub index: _1, pub threshold: _1, - pub ayes: Vec<_0>, - pub nays: Vec<_0>, + pub ayes: ::std::vec::Vec<_0>, + pub nays: ::std::vec::Vec<_0>, pub end: _1, } } @@ -16028,16 +16074,16 @@ pub mod api { value: ::core::primitive::u128, #[codec(compact)] gas_limit: ::core::primitive::u64, - data: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, }, instantiate_with_code { #[codec(compact)] endowment: ::core::primitive::u128, #[codec(compact)] gas_limit: ::core::primitive::u64, - code: Vec<::core::primitive::u8>, - data: Vec<::core::primitive::u8>, - salt: Vec<::core::primitive::u8>, + code: ::std::vec::Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, }, instantiate { #[codec(compact)] @@ -16045,8 +16091,8 @@ pub mod api { #[codec(compact)] gas_limit: ::core::primitive::u64, code_hash: ::subxt::sp_core::H256, - data: Vec<::core::primitive::u8>, - salt: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, }, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] @@ -16096,7 +16142,7 @@ pub mod api { }, ContractEmitted { contract: ::subxt::sp_core::crypto::AccountId32, - data: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, }, CodeRemoved { code_hash: ::subxt::sp_core::H256, @@ -16234,11 +16280,11 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct DeletedContract { - pub trie_id: Vec<::core::primitive::u8>, + pub trie_id: ::std::vec::Vec<::core::primitive::u8>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RawContractInfo<_0> { - pub trie_id: Vec<::core::primitive::u8>, + pub trie_id: ::std::vec::Vec<::core::primitive::u8>, pub code_hash: _0, pub _reserved: ::core::option::Option<()>, } @@ -16256,7 +16302,7 @@ pub mod api { #[codec(compact)] pub refcount: ::core::primitive::u64, pub _reserved: ::core::option::Option<()>, - pub code: Vec<::core::primitive::u8>, + pub code: ::std::vec::Vec<::core::primitive::u8>, pub original_code_len: ::core::primitive::u32, } } @@ -16334,16 +16380,16 @@ pub mod api { undelegate, clear_public_proposals, note_preimage { - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, }, note_preimage_operational { - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, }, note_imminent_preimage { - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, }, note_imminent_preimage_operational { - encoded_proposal: Vec<::core::primitive::u8>, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, }, reap_preimage { proposal_hash: ::subxt::sp_core::H256, @@ -16410,7 +16456,7 @@ pub mod api { Tabled( ::core::primitive::u32, ::core::primitive::u128, - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ), ExternalTabled, Started( @@ -16519,7 +16565,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Voting<_0, _1, _2> { Direct { - votes: Vec<( + votes: ::std::vec::Vec<( _2, runtime_types::pallet_democracy::vote::AccountVote<_0>, )>, @@ -16551,7 +16597,7 @@ pub mod api { pub enum PreimageStatus<_0, _1, _2> { Missing(_2), Available { - data: Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, provider: _0, deposit: _1, since: _2, @@ -16569,7 +16615,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , set_emergency_election_result { supports : Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } + submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { PreDispatchEarlySubmission, @@ -16624,15 +16670,17 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ReadySolution<_0> { - pub supports: Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub supports: + ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, pub score: [::core::primitive::u128; 3usize], pub compute: runtime_types::pallet_election_provider_multi_phase::ElectionCompute, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RoundSnapshot<_0> { - pub voters: Vec<(_0, ::core::primitive::u64, Vec<_0>)>, - pub targets: Vec<_0>, + pub voters: + ::std::vec::Vec<(_0, ::core::primitive::u64, ::std::vec::Vec<_0>)>, + pub targets: ::std::vec::Vec<_0>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SolutionOrSnapshotSize { @@ -16649,7 +16697,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { vote { - votes: Vec<::subxt::sp_core::crypto::AccountId32>, + votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, #[codec(compact)] value: ::core::primitive::u128, }, @@ -16696,7 +16744,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { NewTerm( - Vec<( + ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, )>, @@ -16729,7 +16777,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Voter<_0, _1> { - pub votes: Vec<_0>, + pub votes: ::std::vec::Vec<_0>, pub stake: _1, pub deposit: _1, } @@ -16858,7 +16906,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { NewAuthorities( - Vec<( + ::std::vec::Vec<( runtime_types::sp_finality_grandpa::app::Public, ::core::primitive::u64, )>, @@ -16892,7 +16940,7 @@ pub mod api { >, }, set_subs { - subs: Vec<( + subs: ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::pallet_identity::types::Data, )>, @@ -17153,7 +17201,7 @@ pub mod api { ), AllGood, SomeOffline( - Vec<( + ::std::vec::Vec<( ::subxt::sp_core::crypto::AccountId32, runtime_types::pallet_staking::Exposure< ::subxt::sp_core::crypto::AccountId32, @@ -17245,7 +17293,7 @@ pub mod api { call: ::std::boxed::Box, }, set_calls { - calls: Vec, + calls: ::std::vec::Vec, }, start_lottery { price: ::core::primitive::u128, @@ -17305,7 +17353,7 @@ pub mod api { add: ::subxt::sp_core::crypto::AccountId32, }, reset_members { - members: Vec<::subxt::sp_core::crypto::AccountId32>, + members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, }, change_key { new: ::subxt::sp_core::crypto::AccountId32, @@ -17338,12 +17386,14 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { as_multi_threshold_1 { - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, call: ::std::boxed::Box, }, as_multi { threshold: ::core::primitive::u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, @@ -17356,7 +17406,8 @@ pub mod api { }, approve_as_multi { threshold: ::core::primitive::u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, @@ -17367,7 +17418,8 @@ pub mod api { }, cancel_as_multi { threshold: ::core::primitive::u16, - other_signatories: Vec<::subxt::sp_core::crypto::AccountId32>, + other_signatories: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, timepoint: runtime_types::pallet_multisig::Timepoint< ::core::primitive::u32, >, @@ -17427,7 +17479,7 @@ pub mod api { pub when: runtime_types::pallet_multisig::Timepoint<_0>, pub deposit: _1, pub depositor: _2, - pub approvals: Vec<_2>, + pub approvals: ::std::vec::Vec<_2>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Timepoint<_0> { @@ -17441,7 +17493,10 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Event { - Offence([::core::primitive::u8; 16usize], Vec<::core::primitive::u8>), + Offence( + [::core::primitive::u8; 16usize], + ::std::vec::Vec<::core::primitive::u8>, + ), } } } @@ -17570,7 +17625,7 @@ pub mod api { rescuer: ::subxt::sp_core::crypto::AccountId32, }, create_recovery { - friends: Vec<::subxt::sp_core::crypto::AccountId32>, + friends: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, threshold: ::core::primitive::u16, delay_period: ::core::primitive::u32, }, @@ -17638,13 +17693,13 @@ pub mod api { pub struct ActiveRecovery<_0, _1, _2> { pub created: _0, pub deposit: _1, - pub friends: Vec<_2>, + pub friends: ::std::vec::Vec<_2>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RecoveryConfig<_0, _1, _2> { pub delay_period: _0, pub deposit: _1, - pub friends: Vec<_2>, + pub friends: ::std::vec::Vec<_2>, pub threshold: ::core::primitive::u16, } } @@ -17668,7 +17723,7 @@ pub mod api { index: ::core::primitive::u32, }, schedule_named { - id: Vec<::core::primitive::u8>, + id: ::std::vec::Vec<::core::primitive::u8>, when: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -17678,7 +17733,7 @@ pub mod api { call: ::std::boxed::Box, }, cancel_named { - id: Vec<::core::primitive::u8>, + id: ::std::vec::Vec<::core::primitive::u8>, }, schedule_after { after: ::core::primitive::u32, @@ -17690,7 +17745,7 @@ pub mod api { call: ::std::boxed::Box, }, schedule_named_after { - id: Vec<::core::primitive::u8>, + id: ::std::vec::Vec<::core::primitive::u8>, after: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -17713,7 +17768,7 @@ pub mod api { Canceled(::core::primitive::u32, ::core::primitive::u32), Dispatched( (::core::primitive::u32, ::core::primitive::u32), - ::core::option::Option>, + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, ::core::result::Result< (), runtime_types::sp_runtime::DispatchError, @@ -17728,7 +17783,8 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct ScheduledV2<_0, _1, _2, _3> { - pub maybe_id: ::core::option::Option>, + 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)>, @@ -17745,7 +17801,7 @@ pub mod api { pub enum Call { set_keys { keys: runtime_types::node_runtime::SessionKeys, - proof: Vec<::core::primitive::u8>, + proof: ::std::vec::Vec<::core::primitive::u8>, }, purge_keys, } @@ -17797,7 +17853,7 @@ pub mod api { found { founder: ::subxt::sp_core::crypto::AccountId32, max_members: ::core::primitive::u32, - rules: Vec<::core::primitive::u8>, + rules: ::std::vec::Vec<::core::primitive::u8>, }, unfound, judge_suspended_member { @@ -17850,7 +17906,7 @@ pub mod api { Unvouch(::subxt::sp_core::crypto::AccountId32), Inducted( ::subxt::sp_core::crypto::AccountId32, - Vec<::subxt::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, ), SuspendedMemberJudgement( ::subxt::sp_core::crypto::AccountId32, @@ -17938,7 +17994,7 @@ pub mod api { prefs: runtime_types::pallet_staking::ValidatorPrefs, }, nominate { - targets: Vec< + targets: ::std::vec::Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u32, @@ -17971,7 +18027,8 @@ pub mod api { force_no_eras, force_new_era, set_invulnerables { - invulnerables: Vec<::subxt::sp_core::crypto::AccountId32>, + invulnerables: + ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, }, force_unstake { stash: ::subxt::sp_core::crypto::AccountId32, @@ -17980,7 +18037,7 @@ pub mod api { force_new_era_always, cancel_deferred_slash { era: ::core::primitive::u32, - slash_indices: Vec<::core::primitive::u32>, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, }, payout_stakers { validator_stash: ::subxt::sp_core::crypto::AccountId32, @@ -18001,7 +18058,7 @@ pub mod api { num_slashing_spans: ::core::primitive::u32, }, kick { - who: Vec< + who: ::std::vec::Vec< ::subxt::sp_runtime::MultiAddress< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u32, @@ -18102,7 +18159,7 @@ pub mod api { pub span_index: ::core::primitive::u32, pub last_start: ::core::primitive::u32, pub last_nonzero_slash: ::core::primitive::u32, - pub prior: Vec<::core::primitive::u32>, + pub prior: ::std::vec::Vec<::core::primitive::u32>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct SpanRecord<_0> { @@ -18126,8 +18183,9 @@ pub mod api { pub total: _1, #[codec(compact)] pub own: _1, - pub others: - Vec>, + pub others: ::std::vec::Vec< + runtime_types::pallet_staking::IndividualExposure<_0, _1>, + >, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Forcing { @@ -18144,7 +18202,7 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Nominations<_0> { - pub targets: Vec<_0>, + pub targets: ::std::vec::Vec<_0>, pub submitted_in: ::core::primitive::u32, pub suppressed: ::core::primitive::bool, } @@ -18174,15 +18232,16 @@ pub mod api { pub total: _1, #[codec(compact)] pub active: _1, - pub unlocking: Vec>, - pub claimed_rewards: Vec<::core::primitive::u32>, + pub unlocking: + ::std::vec::Vec>, + pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct UnappliedSlash<_0, _1> { pub validator: _0, pub own: _1, - pub others: Vec<(_0, _1)>, - pub reporters: Vec<_0>, + pub others: ::std::vec::Vec<(_0, _1)>, + pub reporters: ::std::vec::Vec<_0>, pub payout: _1, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] @@ -18268,14 +18327,14 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { report_awesome { - reason: Vec<::core::primitive::u8>, + reason: ::std::vec::Vec<::core::primitive::u8>, who: ::subxt::sp_core::crypto::AccountId32, }, retract_tip { hash: ::subxt::sp_core::H256, }, tip_new { - reason: Vec<::core::primitive::u8>, + reason: ::std::vec::Vec<::core::primitive::u8>, who: ::subxt::sp_core::crypto::AccountId32, #[codec(compact)] tip_value: ::core::primitive::u128, @@ -18325,7 +18384,7 @@ pub mod api { pub finder: _0, pub deposit: _1, pub closes: ::core::option::Option<_2>, - pub tips: Vec<(_0, _1)>, + pub tips: ::std::vec::Vec<(_0, _1)>, pub finders_fee: ::core::primitive::bool, } } @@ -18345,7 +18404,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - store { data : Vec < :: core :: primitive :: u8 > , } , renew { block : :: core :: primitive :: u32 , index : :: core :: primitive :: u32 , } , check_proof { proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof , } , } + store { data : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , renew { block : :: core :: primitive :: u32 , index : :: core :: primitive :: u32 , } , check_proof { proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof , } , } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { InsufficientFunds, @@ -18435,7 +18494,7 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { - create { # [codec (compact)] class : :: core :: primitive :: u32 , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , force_create { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , } , destroy { # [codec (compact)] class : :: core :: primitive :: u32 , witness : runtime_types :: pallet_uniques :: types :: DestroyWitness , } , mint { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , burn { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , check_owner : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , dest : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , redeposit { # [codec (compact)] class : :: core :: primitive :: u32 , instances : Vec < :: core :: primitive :: u32 > , } , freeze { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , thaw { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , freeze_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , thaw_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , transfer_ownership { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , set_team { # [codec (compact)] class : :: core :: primitive :: u32 , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , approve_transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , delegate : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , cancel_approval { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , maybe_check_delegate : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , force_asset_status { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , is_frozen : :: core :: primitive :: bool , } , set_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , value : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , clear_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , set_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , set_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , } , } + create { # [codec (compact)] class : :: core :: primitive :: u32 , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , force_create { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , } , destroy { # [codec (compact)] class : :: core :: primitive :: u32 , witness : runtime_types :: pallet_uniques :: types :: DestroyWitness , } , mint { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , burn { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , check_owner : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , dest : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , redeposit { # [codec (compact)] class : :: core :: primitive :: u32 , instances : :: std :: vec :: Vec < :: core :: primitive :: u32 > , } , freeze { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , thaw { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , freeze_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , thaw_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , transfer_ownership { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , set_team { # [codec (compact)] class : :: core :: primitive :: u32 , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , approve_transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , delegate : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , cancel_approval { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , maybe_check_delegate : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , force_asset_status { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , is_frozen : :: core :: primitive :: bool , } , set_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , value : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , clear_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , set_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , set_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , } , } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Error { NoPermission, @@ -18521,7 +18580,10 @@ pub mod api { ::core::primitive::bool, ), MetadataCleared(::core::primitive::u32, ::core::primitive::u32), - Redeposited(::core::primitive::u32, Vec<::core::primitive::u32>), + Redeposited( + ::core::primitive::u32, + ::std::vec::Vec<::core::primitive::u32>, + ), AttributeSet( ::core::primitive::u32, ::core::option::Option<::core::primitive::u32>, @@ -18599,14 +18661,14 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Call { batch { - calls: Vec, + calls: ::std::vec::Vec, }, as_derivative { index: ::core::primitive::u16, call: ::std::boxed::Box, }, batch_all { - calls: Vec, + calls: ::std::vec::Vec, }, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] @@ -18835,12 +18897,13 @@ pub mod api { pub mod offchain { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaqueMultiaddr(pub Vec<::core::primitive::u8>); + pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OpaqueNetworkState { pub peer_id: runtime_types::sp_core::OpaquePeerId, - pub external_addresses: - Vec, + pub external_addresses: ::std::vec::Vec< + runtime_types::sp_core::offchain::OpaqueMultiaddr, + >, } } pub mod sr25519 { @@ -18851,7 +18914,7 @@ pub mod api { pub struct Signature(pub [::core::primitive::u8; 64usize]); } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaquePeerId(pub Vec<::core::primitive::u8>); + pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub enum Void {} } @@ -18893,7 +18956,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct Support<_0> { pub total: ::core::primitive::u128, - pub voters: Vec<(_0, ::core::primitive::u128)>, + pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, } } pub mod sp_runtime { @@ -18911,7 +18974,7 @@ pub mod api { :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub struct Digest<_0> { - pub logs: Vec< + pub logs: ::std::vec::Vec< runtime_types::sp_runtime::generic::digest::DigestItem<_0>, >, } @@ -18922,17 +18985,20 @@ pub mod api { ChangesTrieRoot(_0), PreRuntime( [::core::primitive::u8; 4usize], - Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, ), Consensus( [::core::primitive::u8; 4usize], - Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + ), + Seal( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, ), - Seal([::core::primitive::u8; 4usize], Vec<::core::primitive::u8>), ChangesTrieSignal( runtime_types::sp_runtime::generic::digest::ChangesTrieSignal, ), - Other(Vec<::core::primitive::u8>), + Other(::std::vec::Vec<::core::primitive::u8>), RuntimeEnvironmentUpdated, } } @@ -19224,7 +19290,7 @@ pub mod api { :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, )] pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, ); } @@ -19235,7 +19301,7 @@ pub mod api { pub enum MultiAddress<_0, _1> { Id(_0), Index(_1), - Raw(Vec<::core::primitive::u8>), + Raw(::std::vec::Vec<::core::primitive::u8>), Address32([::core::primitive::u8; 32usize]), Address20([::core::primitive::u8; 20usize]), } @@ -19287,7 +19353,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct MembershipProof { pub session: ::core::primitive::u32, - pub trie_nodes: Vec>, + pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, pub validator_count: ::core::primitive::u32, } } @@ -19298,7 +19364,7 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct OffenceDetails<_0, _1> { pub offender: _1, - pub reporters: Vec<_0>, + pub reporters: ::std::vec::Vec<_0>, } } } @@ -19306,20 +19372,23 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct TransactionStorageProof { - pub chunk: Vec<::core::primitive::u8>, - pub proof: Vec>, + pub chunk: ::std::vec::Vec<::core::primitive::u8>, + pub proof: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, } } pub mod sp_version { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] pub struct RuntimeVersion { - pub spec_name: ::alloc::string::String, - pub impl_name: ::alloc::string::String, + 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: Vec<([::core::primitive::u8; 8usize], ::core::primitive::u32)>, + pub apis: ::std::vec::Vec<( + [::core::primitive::u8; 8usize], + ::core::primitive::u32, + )>, pub transaction_version: ::core::primitive::u32, } } From c1f6d53d486613ef0b80456fae5675374e05e631 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 11:11:48 +0100 Subject: [PATCH 197/216] Resolve some todos --- src/events.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events.rs b/src/events.rs index 02dbd52a6a..c7165f495f 100644 --- a/src/events.rs +++ b/src/events.rs @@ -201,10 +201,10 @@ where Ok(()) } TypeDef::Variant(variant) => { - // todo: [AJ] handle if variant is DispatchError? let variant_index = u8::decode(input)?; variant_index.encode_to(output); - let variant = variant.variants().get(variant_index as usize).unwrap(); // todo: ok_or + let variant = variant.variants().get(variant_index as usize) + .ok_or(Error::Other(format!("Variant {} not found", variant_index)))?; for field in variant.fields() { self.decode_type(field.ty().id(), input, output)?; } From a97fb2ed1acea1f1b3c59e4b25d7864ed56c60b0 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 11:20:24 +0100 Subject: [PATCH 198/216] Resolve some panic todos in events --- src/events.rs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/events.rs b/src/events.rs index c7165f495f..abf184ddec 100644 --- a/src/events.rs +++ b/src/events.rs @@ -203,8 +203,9 @@ where TypeDef::Variant(variant) => { let variant_index = u8::decode(input)?; variant_index.encode_to(output); - let variant = variant.variants().get(variant_index as usize) - .ok_or(Error::Other(format!("Variant {} not found", variant_index)))?; + let variant = variant.variants().get(variant_index as usize).ok_or( + Error::Other(format!("Variant {} not found", variant_index)), + )?; for field in variant.fields() { self.decode_type(field.ty().id(), input, output)?; } @@ -234,7 +235,9 @@ where match primitive { TypeDefPrimitive::Bool => decode_raw::(input, output), TypeDefPrimitive::Char => { - todo!("Err: scale codec not implemented for char") + return Err(Error::Other( + "scale codec not implemented for char".to_string(), + )) } TypeDefPrimitive::Str => decode_raw::(input, output), TypeDefPrimitive::U8 => decode_raw::(input, output), @@ -242,13 +245,21 @@ where TypeDefPrimitive::U32 => decode_raw::(input, output), TypeDefPrimitive::U64 => decode_raw::(input, output), TypeDefPrimitive::U128 => decode_raw::(input, output), - TypeDefPrimitive::U256 => todo!("Err: U256 currently not supported"), + TypeDefPrimitive::U256 => { + return Err(Error::Other( + "U256 currently not supported".to_string(), + )) + } TypeDefPrimitive::I8 => decode_raw::(input, output), TypeDefPrimitive::I16 => decode_raw::(input, output), TypeDefPrimitive::I32 => decode_raw::(input, output), TypeDefPrimitive::I64 => decode_raw::(input, output), TypeDefPrimitive::I128 => decode_raw::(input, output), - TypeDefPrimitive::I256 => todo!("Err(I256 currently not supported)"), + TypeDefPrimitive::I256 => { + return Err(Error::Other( + "I256 currently not supported".to_string(), + )) + } } } TypeDef::Compact(_compact) => { From d58834b334fa4866fb30fe70e498fb945a49ee00 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 11:42:55 +0100 Subject: [PATCH 199/216] Add EventsDecodingError --- src/error.rs | 4 ++++ src/events.rs | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/error.rs b/src/error.rs index 538592dcff..5fbfa1897c 100644 --- a/src/error.rs +++ b/src/error.rs @@ -15,6 +15,7 @@ // along with subxt. If not, see . use crate::{ + events::EventsDecodingError, metadata::{ InvalidMetadataError, MetadataError, @@ -59,6 +60,9 @@ pub enum Error { /// Runtime error. #[error("Runtime error: {0}")] Runtime(#[from] RuntimeError), + /// Events decoding error. + #[error("Events decoding error: {0}")] + EventsDecoding(#[from] EventsDecodingError), /// Other error. #[error("Other error: {0}")] Other(String), diff --git a/src/events.rs b/src/events.rs index abf184ddec..b64d77a0cc 100644 --- a/src/events.rs +++ b/src/events.rs @@ -235,9 +235,7 @@ where match primitive { TypeDefPrimitive::Bool => decode_raw::(input, output), TypeDefPrimitive::Char => { - return Err(Error::Other( - "scale codec not implemented for char".to_string(), - )) + Err(EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::Char).into()) } TypeDefPrimitive::Str => decode_raw::(input, output), TypeDefPrimitive::U8 => decode_raw::(input, output), @@ -246,9 +244,7 @@ where TypeDefPrimitive::U64 => decode_raw::(input, output), TypeDefPrimitive::U128 => decode_raw::(input, output), TypeDefPrimitive::U256 => { - return Err(Error::Other( - "U256 currently not supported".to_string(), - )) + Err(EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::U256).into()) } TypeDefPrimitive::I8 => decode_raw::(input, output), TypeDefPrimitive::I16 => decode_raw::(input, output), @@ -256,9 +252,7 @@ where TypeDefPrimitive::I64 => decode_raw::(input, output), TypeDefPrimitive::I128 => decode_raw::(input, output), TypeDefPrimitive::I256 => { - return Err(Error::Other( - "I256 currently not supported".to_string(), - )) + Err(EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::I256).into()) } } } @@ -299,6 +293,16 @@ pub enum Raw { Error(RuntimeError), } +#[derive(Debug, thiserror::Error)] +pub enum EventsDecodingError { + /// Unsupported primitive type + #[error("Unsupported primitive type {0:?}")] + UnsupportedPrimitive(TypeDefPrimitive), + /// Invalid compact type, must be an unsigned int. + #[error("Invalid compact primitive {0:?}")] + InvalidCompactPrimitive(TypeDefPrimitive), +} + // #[cfg(test)] // mod tests { // use super::*; From d0f5e69219910aa19cae937df720362a2ce7f845 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 12:03:19 +0100 Subject: [PATCH 200/216] Decode compact composite types with a single primitive field --- src/events.rs | 66 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 13 deletions(-) diff --git a/src/events.rs b/src/events.rs index b64d77a0cc..84ed08d895 100644 --- a/src/events.rs +++ b/src/events.rs @@ -235,7 +235,10 @@ where match primitive { TypeDefPrimitive::Bool => decode_raw::(input, output), TypeDefPrimitive::Char => { - Err(EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::Char).into()) + Err(EventsDecodingError::UnsupportedPrimitive( + TypeDefPrimitive::Char, + ) + .into()) } TypeDefPrimitive::Str => decode_raw::(input, output), TypeDefPrimitive::U8 => decode_raw::(input, output), @@ -244,7 +247,10 @@ where TypeDefPrimitive::U64 => decode_raw::(input, output), TypeDefPrimitive::U128 => decode_raw::(input, output), TypeDefPrimitive::U256 => { - Err(EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::U256).into()) + Err(EventsDecodingError::UnsupportedPrimitive( + TypeDefPrimitive::U256, + ) + .into()) } TypeDefPrimitive::I8 => decode_raw::(input, output), TypeDefPrimitive::I16 => decode_raw::(input, output), @@ -252,7 +258,10 @@ where TypeDefPrimitive::I64 => decode_raw::(input, output), TypeDefPrimitive::I128 => decode_raw::(input, output), TypeDefPrimitive::I256 => { - Err(EventsDecodingError::UnsupportedPrimitive(TypeDefPrimitive::I256).into()) + Err(EventsDecodingError::UnsupportedPrimitive( + TypeDefPrimitive::I256, + ) + .into()) } } } @@ -261,19 +270,48 @@ where .metadata .resolve_type(type_id) .ok_or(MetadataError::TypeNotFound(type_id))?; + let decode_compact_primitive = |primitive| { + match primitive { + TypeDefPrimitive::U8 => decode_raw::>(input, output), + TypeDefPrimitive::U16 => { + decode_raw::>(input, output) + } + TypeDefPrimitive::U32 => { + decode_raw::>(input, output) + } + TypeDefPrimitive::U64 => { + decode_raw::>(input, output) + } + TypeDefPrimitive::U128 => { + decode_raw::>(input, output) + } + prim => { + Err(EventsDecodingError::InvalidCompactPrimitive( + prim.clone(), + ) + .into()) + } + } + }; match inner.type_def() { - TypeDef::Primitive(primitive) => { - match primitive { - TypeDefPrimitive::U8 => decode_raw::>(input, output), - TypeDefPrimitive::U16 => decode_raw::>(input, output), - TypeDefPrimitive::U32 => decode_raw::>(input, output), - TypeDefPrimitive::U64 => decode_raw::>(input, output), - TypeDefPrimitive::U128 => decode_raw::>(input, output), - _ => todo!("Add custom err: Compact only supported for unsigned int primitives"), + TypeDef::Primitive(primitive) => decode_compact_primitive(primitive), + TypeDef::Composite(composite) => { + match composite.fields() { + [field] => { + let field_ty = self + .metadata + .resolve_type(field.ty().id()) + .ok_or(MetadataError::TypeNotFound(field.ty().id()))?; + if let TypeDef::Primitive(primitive) = field_ty.type_def() { + decode_compact_primitive(primitive) + } else { + Err(EventsDecodingError::InvalidCompactType("Composite type must have a single primitive field".into()).into()) + } + } + _ => Err(EventsDecodingError::InvalidCompactType("Composite type must have a single field".into()).into()) } } - // todo: [AJ] single field struct with primitive?, extract primitive decoding as above - _ => todo!("Add custom err: Compact only supported for unsigned int primitives"), + _ => Err(EventsDecodingError::InvalidCompactType("Compact type must be a primitive or a composite type".into()).into()), } } TypeDef::BitSequence(_bitseq) => { @@ -301,6 +339,8 @@ pub enum EventsDecodingError { /// Invalid compact type, must be an unsigned int. #[error("Invalid compact primitive {0:?}")] InvalidCompactPrimitive(TypeDefPrimitive), + #[error("Invalid compact composite type {0}")] + InvalidCompactType(String), } // #[cfg(test)] From 9da0bccca5ce0ccba04630bc634d82b7f6a0ea48 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 31 Oct 2021 12:11:41 +0100 Subject: [PATCH 201/216] Decode compact composite types with a single primitive field --- src/events.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events.rs b/src/events.rs index 84ed08d895..a56e3851ce 100644 --- a/src/events.rs +++ b/src/events.rs @@ -270,7 +270,7 @@ where .metadata .resolve_type(type_id) .ok_or(MetadataError::TypeNotFound(type_id))?; - let decode_compact_primitive = |primitive| { + let mut decode_compact_primitive = |primitive: &TypeDefPrimitive| { match primitive { TypeDefPrimitive::U8 => decode_raw::>(input, output), TypeDefPrimitive::U16 => { From 346504b649c31ed439ae32abb83207755e7a7572 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Tue, 2 Nov 2021 10:37:26 +0100 Subject: [PATCH 202/216] Update src/metadata.rs Co-authored-by: Andrew Plaza --- src/metadata.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metadata.rs b/src/metadata.rs index 84deef0130..7aeb26cfa4 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -87,7 +87,7 @@ pub struct Metadata { } impl Metadata { - /// Returns `PalletMetadata`. + /// Returns a reference to [`PalletMetadata`]. pub fn pallet(&self, name: &'static str) -> Result<&PalletMetadata, MetadataError> { self.pallets .get(name) From 2f36a89749e086a0721a1a5b02309de62045cf4b Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 09:39:19 +0000 Subject: [PATCH 203/216] Remove Perbill compact substitute types --- codegen/src/api/mod.rs | 9 - tests/integration/codegen/polkadot.rs | 19715 +----------------------- tests/integration/runtime.rs | 5 +- 3 files changed, 5 insertions(+), 19724 deletions(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 3576fb37c6..5b96cdea23 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -118,15 +118,6 @@ impl RuntimeGenerator { "sp_runtime::multiaddress::MultiAddress", parse_quote!(::subxt::sp_runtime::MultiAddress), ), - // todo: [AJ] remove the requirement for these by implementing Compact handling properly - ( - "sp_arithmetic::per_things::Perbill", - parse_quote!(::subxt::sp_arithmetic::per_things::Perbill), - ), - ( - "sp_arithmetic::per_things::Perquintill", - parse_quote!(::subxt::sp_arithmetic::per_things::Perquintill), - ), ( "frame_support::traits::misc::WrapperKeepOpaque", parse_quote!(::subxt::WrapperKeepOpaque), diff --git a/tests/integration/codegen/polkadot.rs b/tests/integration/codegen/polkadot.rs index 99f9894af7..8b13789179 100644 --- a/tests/integration/codegen/polkadot.rs +++ b/tests/integration/codegen/polkadot.rs @@ -1,19714 +1 @@ -#[allow(dead_code, unused_imports, non_camel_case_types)] -pub mod api { - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - #[codec(index = 0)] - System(system::Event), - #[codec(index = 1)] - Utility(utility::Event), - #[codec(index = 5)] - Indices(indices::Event), - #[codec(index = 6)] - Balances(balances::Event), - #[codec(index = 8)] - ElectionProviderMultiPhase(election_provider_multi_phase::Event), - #[codec(index = 9)] - Staking(staking::Event), - #[codec(index = 10)] - Session(session::Event), - #[codec(index = 11)] - Democracy(democracy::Event), - #[codec(index = 12)] - Council(council::Event), - #[codec(index = 13)] - TechnicalCommittee(technical_committee::Event), - #[codec(index = 14)] - Elections(elections::Event), - #[codec(index = 15)] - TechnicalMembership(technical_membership::Event), - #[codec(index = 16)] - Grandpa(grandpa::Event), - #[codec(index = 17)] - Treasury(treasury::Event), - #[codec(index = 18)] - Contracts(contracts::Event), - #[codec(index = 19)] - Sudo(sudo::Event), - #[codec(index = 20)] - ImOnline(im_online::Event), - #[codec(index = 22)] - Offences(offences::Event), - #[codec(index = 25)] - Identity(identity::Event), - #[codec(index = 26)] - Society(society::Event), - #[codec(index = 27)] - Recovery(recovery::Event), - #[codec(index = 28)] - Vesting(vesting::Event), - #[codec(index = 29)] - Scheduler(scheduler::Event), - #[codec(index = 30)] - Proxy(proxy::Event), - #[codec(index = 31)] - Multisig(multisig::Event), - #[codec(index = 32)] - Bounties(bounties::Event), - #[codec(index = 33)] - Tips(tips::Event), - #[codec(index = 34)] - Assets(assets::Event), - #[codec(index = 36)] - Lottery(lottery::Event), - #[codec(index = 37)] - Gilt(gilt::Event), - #[codec(index = 38)] - Uniques(uniques::Event), - #[codec(index = 39)] - TransactionStorage(transaction_storage::Event), - #[codec(index = 40)] - BagsList(bags_list::Event), - } - pub mod system { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct FillBlock { - pub ratio: ::subxt::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)] - 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)] - 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)] - 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)] - 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)] - pub struct SetChangesTrieConfig { - pub changes_trie_config: ::core::option::Option< - runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, - >, - } - impl ::subxt::Call for SetChangesTrieConfig { - const PALLET: &'static str = "System"; - const FUNCTION: &'static str = "set_changes_trie_config"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn fill_block( - &self, - ratio: ::subxt::sp_arithmetic::per_things::Perbill, - ) -> ::subxt::SubmittableExtrinsic { - let call = FillBlock { ratio }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remark( - &self, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Remark { remark }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_heap_pages( - &self, - pages: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetHeapPages { pages }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_code( - &self, - code: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetCode { code }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_code_without_checks( - &self, - code: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetCodeWithoutChecks { code }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_changes_trie_config( - &self, - changes_trie_config: ::core::option::Option< - runtime_types::sp_core::changes_trie::ChangesTrieConfiguration, - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetChangesTrieConfig { - changes_trie_config, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_storage( - &self, - items: ::std::vec::Vec<( - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - )>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetStorage { items }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_storage( - &self, - keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillStorage { keys }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_prefix( - &self, - prefix: ::std::vec::Vec<::core::primitive::u8>, - subkeys: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillPrefix { prefix, subkeys }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remark_with_event( - &self, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemarkWithEvent { remark }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::frame_system::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ExtrinsicSuccess( - pub 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)] - pub struct ExtrinsicFailed( - pub runtime_types::sp_runtime::DispatchError, - pub 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)] - 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)] - pub struct NewAccount(pub ::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)] - pub struct KilledAccount(pub ::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)] - pub struct Remarked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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(pub ::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(pub ::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(pub ::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< - ::subxt::sp_core::H256, - >; - 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::node_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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for EventTopics { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "EventTopics"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct LastRuntimeUpgrade; - impl ::subxt::StorageEntry for LastRuntimeUpgrade { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "LastRuntimeUpgrade"; - type Value = runtime_types::frame_system::LastRuntimeUpgradeInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToU32RefCount; - impl ::subxt::StorageEntry for UpgradedToU32RefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToU32RefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct UpgradedToTripleRefCount; - impl ::subxt::StorageEntry for UpgradedToTripleRefCount { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "UpgradedToTripleRefCount"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ExecutionPhase; - impl ::subxt::StorageEntry for ExecutionPhase { - const PALLET: &'static str = "System"; - const STORAGE: &'static str = "ExecutionPhase"; - type Value = runtime_types::frame_system::Phase; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn account( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_system::AccountInfo< - ::core::primitive::u32, - runtime_types::pallet_balances::AccountData< - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Account(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn extrinsic_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = ExtrinsicCount; - self.client.storage().fetch(&entry, hash).await - } - pub async fn block_weight( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u64, - >, - ::subxt::Error, - > { - let entry = BlockWeight; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn all_extrinsics_len( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = AllExtrinsicsLen; - self.client.storage().fetch(&entry, hash).await - } - pub async fn block_hash( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = BlockHash(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn block_hash_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BlockHash>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn extrinsic_data( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::Error, - > { - let entry = ExtrinsicData(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn extrinsic_data_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ExtrinsicData>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn number( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = Number; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn parent_hash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = ParentHash; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn digest( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_runtime::generic::digest::Digest< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Digest; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn events( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::frame_system::EventRecord< - runtime_types::node_runtime::Event, - ::subxt::sp_core::H256, - >, - >, - ::subxt::Error, - > { - let entry = Events; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn event_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = EventCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn event_topics( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::Error, - > { - let entry = EventTopics(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn event_topics_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, EventTopics>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn last_runtime_upgrade( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_system::LastRuntimeUpgradeInfo, - >, - ::subxt::Error, - > { - let entry = LastRuntimeUpgrade; - self.client.storage().fetch(&entry, hash).await - } - pub async fn upgraded_to_u32_ref_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = UpgradedToU32RefCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn upgraded_to_triple_ref_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = UpgradedToTripleRefCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn execution_phase( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ExecutionPhase; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod utility { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct AsDerivative { - pub index: ::core::primitive::u16, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for AsDerivative { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "as_derivative"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchAll { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for BatchAll { - const PALLET: &'static str = "Utility"; - const FUNCTION: &'static str = "batch_all"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn batch( - &self, - calls: ::std::vec::Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = Batch { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn as_derivative( - &self, - index: ::core::primitive::u16, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsDerivative { index, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn batch_all( - &self, - calls: ::std::vec::Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = BatchAll { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_utility::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BatchInterrupted( - pub ::core::primitive::u32, - pub 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)] - 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)] - pub struct ItemCompleted {} - impl ::subxt::Event for ItemCompleted { - const PALLET: &'static str = "Utility"; - const EVENT: &'static str = "ItemCompleted"; - } - } - } - pub mod babe { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReportEquivocation { - pub 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, - >, - 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)] - pub struct ReportEquivocationUnsigned { - pub 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, - >, - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocation { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocationUnsigned { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn plan_config_change( - &self, - config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor, - ) -> ::subxt::SubmittableExtrinsic { - let call = PlanConfigChange { config }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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(pub ::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 } - } - pub async fn epoch_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = EpochIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn authorities (& self , 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 :: Error >{ - let entry = Authorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn genesis_slot( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::Error, - > { - let entry = GenesisSlot; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_slot( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_consensus_slots::Slot, - ::subxt::Error, - > { - let entry = CurrentSlot; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn randomness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::Error, - > { - let entry = Randomness; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn pending_epoch_config_change( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, - >, - ::subxt::Error, - > { - let entry = PendingEpochConfigChange; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_randomness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - [::core::primitive::u8; 32usize], - ::subxt::Error, - > { - let entry = NextRandomness; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn next_authorities (& self , 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 :: Error >{ - let entry = NextAuthorities; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn segment_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = SegmentIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn under_construction( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - [::core::primitive::u8; 32usize], - >, - ::subxt::Error, - > { - let entry = UnderConstruction(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn under_construction_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnderConstruction>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn initialized( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - ::core::option::Option<[::core::primitive::u8; 32usize]>, - >, - ::subxt::Error, - > { - let entry = Initialized; - self.client.storage().fetch(&entry, hash).await - } - pub async fn author_vrf_randomness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<[::core::primitive::u8; 32usize]>, - ::subxt::Error, - > { - let entry = AuthorVrfRandomness; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn epoch_start( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - (::core::primitive::u32, ::core::primitive::u32), - ::subxt::Error, - > { - let entry = EpochStart; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lateness( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = Lateness; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn epoch_config( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::Error, - > { - let entry = EpochConfig; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_epoch_config( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_consensus_babe::BabeEpochConfiguration, - >, - ::subxt::Error, - > { - let entry = NextEpochConfig; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod timestamp { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set( - &self, - now: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Set { now }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub mod storage { - use super::runtime_types; - pub struct Now; - impl ::subxt::StorageEntry for Now { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "Now"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DidUpdate; - impl ::subxt::StorageEntry for DidUpdate { - const PALLET: &'static str = "Timestamp"; - const STORAGE: &'static str = "DidUpdate"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn now( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = Now; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn did_update( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = DidUpdate; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod authorship { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetUncles { new_uncles }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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 } - } - pub async fn uncles( - &self, - 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::Error, - > { - let entry = Uncles; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn author( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Author; - self.client.storage().fetch(&entry, hash).await - } - pub async fn did_set_uncles( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = DidSetUncles; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod indices { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn claim( - &self, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Claim { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { new, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn free( - &self, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Free { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_transfer( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - freeze: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceTransfer { new, index, freeze }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze( - &self, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Freeze { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_indices::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IndexAssigned( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct IndexFreed(pub ::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)] - pub struct IndexFrozen( - pub ::core::primitive::u32, - pub ::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(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Accounts { - const PALLET: &'static str = "Indices"; - const STORAGE: &'static str = "Accounts"; - type Value = ( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn accounts( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::bool, - )>, - ::subxt::Error, - > { - let entry = Accounts(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn accounts_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Accounts>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod balances { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[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)] - pub struct SetBalance { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[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)] - pub struct ForceTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[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)] - pub struct TransferKeepAlive { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[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)] - pub struct TransferAll { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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)] - pub struct ForceUnreserve { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn transfer( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { dest, value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_balance( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - new_free: ::core::primitive::u128, - new_reserved: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetBalance { - who, - new_free, - new_reserved, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceTransfer { - source, - dest, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_keep_alive( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferKeepAlive { dest, value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_all( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - keep_alive: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferAll { dest, keep_alive }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_unreserve( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceUnreserve { who, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_balances::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Endowed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct DustLost( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Transfer( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct BalanceSet( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::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)] - pub struct Reserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Unreserved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct ReserveRepatriated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub 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)] - pub struct Deposit( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Withdraw( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Slashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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(pub ::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(pub ::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(pub ::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 } - } - pub async fn total_issuance( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> - { - let entry = TotalIssuance; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::AccountData<::core::primitive::u128>, - ::subxt::Error, - > { - let entry = Account(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } pub async fn locks (& self , _0 : :: subxt :: sp_core :: crypto :: AccountId32 , 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 :: Error >{ - let entry = Locks(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn locks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn reserves( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::Error, - > { - let entry = Reserves(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn reserves_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reserves>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_balances::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod transaction_payment { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct NextFeeMultiplier; - impl ::subxt::StorageEntry for NextFeeMultiplier { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "NextFeeMultiplier"; - type Value = runtime_types::sp_arithmetic::fixed_point::FixedU128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "TransactionPayment"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_transaction_payment::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn next_fee_multiplier( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::fixed_point::FixedU128, - ::subxt::Error, - > { - let entry = NextFeeMultiplier; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_transaction_payment::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod election_provider_multi_phase { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubmitUnsigned { pub raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > , 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)] - pub struct SetMinimumUntrustedScore { - pub maybe_next_score: - ::core::option::Option<[::core::primitive::u128; 3usize]>, - } - 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)] - 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)] - pub struct Submit { - pub raw_solution: - runtime_types::pallet_election_provider_multi_phase::RawSolution< - runtime_types::node_runtime::NposSolution16, - >, - pub num_signed_submissions: ::core::primitive::u32, - } - impl ::subxt::Call for Submit { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn submit_unsigned( - &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, - witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, - ) -> ::subxt::SubmittableExtrinsic { - let call = SubmitUnsigned { - raw_solution, - witness, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_minimum_untrusted_score( - &self, - maybe_next_score: ::core::option::Option< - [::core::primitive::u128; 3usize], - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetMinimumUntrustedScore { maybe_next_score }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - >, - )>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SetEmergencyElectionResult { supports }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn submit( - &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 >, - num_signed_submissions: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Submit { - raw_solution, - num_signed_submissions, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - 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)] - pub struct SolutionStored( - pub runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - pub ::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)] - pub struct ElectionFinalized( - pub ::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)] - pub struct Rewarded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Slashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct SignedPhaseStarted(pub ::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)] - pub struct UnsignedPhaseStarted(pub ::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< - ::subxt::sp_core::crypto::AccountId32, - >; - 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 < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionsMap(pub ::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 :: node_runtime :: NposSolution16 > ; - 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 = [::core::primitive::u128; 3usize]; - 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 round( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = Round; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_phase( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_election_provider_multi_phase::Phase< - ::core::primitive::u32, - >, - ::subxt::Error, - > { - let entry = CurrentPhase; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn queued_solution (& self , 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 :: Error >{ - let entry = QueuedSolution; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: Error >{ - let entry = Snapshot; - self.client.storage().fetch(&entry, hash).await - } - pub async fn desired_targets( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = DesiredTargets; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: Error >{ - let entry = SnapshotMetadata; - self.client.storage().fetch(&entry, hash).await - } - pub async fn signed_submission_next_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = SignedSubmissionNextIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > , :: subxt :: Error >{ - let entry = SignedSubmissionIndices; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submissions_map (& self , _0 : :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: node_runtime :: NposSolution16 > , :: subxt :: Error >{ - let entry = SignedSubmissionsMap(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn signed_submissions_map_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SignedSubmissionsMap>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn minimum_untrusted_score( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<[::core::primitive::u128; 3usize]>, - ::subxt::Error, - > { - let entry = MinimumUntrustedScore; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod staking { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bond { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[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)] - 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)] - 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)] - 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)] - 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)] - pub struct Nominate { - pub targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - } - impl ::subxt::Call for Nominate { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "nominate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub struct SetController { - pub controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for SetController { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_controller"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - pub struct Kick { - pub who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - } - impl ::subxt::Call for Kick { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "kick"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetStakingLimits { - pub min_nominator_bond: ::core::primitive::u128, - pub min_validator_bond: ::core::primitive::u128, - pub max_nominator_count: ::core::option::Option<::core::primitive::u32>, - pub max_validator_count: ::core::option::Option<::core::primitive::u32>, - pub threshold: ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - } - impl ::subxt::Call for SetStakingLimits { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "set_staking_limits"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ChillOther { - pub controller: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ChillOther { - const PALLET: &'static str = "Staking"; - const FUNCTION: &'static str = "chill_other"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn bond( - &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - value: ::core::primitive::u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Bond { - controller, - value, - payee, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn bond_extra( - &self, - max_additional: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = BondExtra { max_additional }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unbond( - &self, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unbond { value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn withdraw_unbonded( - &self, - num_slashing_spans: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = WithdrawUnbonded { num_slashing_spans }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn validate( - &self, - prefs: runtime_types::pallet_staking::ValidatorPrefs, - ) -> ::subxt::SubmittableExtrinsic { - let call = Validate { prefs }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn nominate( - &self, - targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Nominate { targets }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn chill(&self) -> ::subxt::SubmittableExtrinsic { - let call = Chill {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_payee( - &self, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetPayee { payee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_controller( - &self, - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetController { controller }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_validator_count( - &self, - new: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetValidatorCount { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn increase_validator_count( - &self, - additional: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = IncreaseValidatorCount { additional }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn scale_validator_count( - &self, - factor: runtime_types::sp_arithmetic::per_things::Percent, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ScaleValidatorCount { factor }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_no_eras( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNoEras {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_new_era( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNewEra {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_invulnerables( - &self, - invulnerables: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetInvulnerables { invulnerables }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_unstake( - &self, - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceUnstake { - stash, - num_slashing_spans, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_new_era_always( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceNewEraAlways {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_deferred_slash( - &self, - era: ::core::primitive::u32, - slash_indices: ::std::vec::Vec<::core::primitive::u32>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = CancelDeferredSlash { era, slash_indices }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn payout_stakers( - &self, - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = PayoutStakers { - validator_stash, - era, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn rebond( - &self, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Rebond { value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_history_depth( - &self, - new_history_depth: ::core::primitive::u32, - era_items_deleted: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetHistoryDepth { - new_history_depth, - era_items_deleted, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reap_stash( - &self, - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReapStash { - stash, - num_slashing_spans, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kick( - &self, - who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Kick { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_staking_limits( - &self, - min_nominator_bond: ::core::primitive::u128, - min_validator_bond: ::core::primitive::u128, - max_nominator_count: ::core::option::Option<::core::primitive::u32>, - max_validator_count: ::core::option::Option<::core::primitive::u32>, - threshold: ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetStakingLimits { - min_nominator_bond, - min_validator_bond, - max_nominator_count, - max_validator_count, - threshold, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn chill_other( - &self, - controller: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ChillOther { controller }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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(pub ::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 Ledger(pub ::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(pub ::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(pub ::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(pub ::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< - ::subxt::sp_core::crypto::AccountId32, - >; - 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(pub ::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( - ::core::primitive::u32, - ::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( - ::core::primitive::u32, - ::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( - ::core::primitive::u32, - ::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(pub ::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(pub ::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(pub ::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 = ::subxt::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(pub ::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( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ValidatorSlashInEra { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ValidatorSlashInEra"; - type Value = ( - ::subxt::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( - ::core::primitive::u32, - ::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(pub ::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( - ::subxt::sp_core::crypto::AccountId32, - ::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, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct EarliestUnappliedSlash; - impl ::subxt::StorageEntry for EarliestUnappliedSlash { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "EarliestUnappliedSlash"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentPlannedSession; - impl ::subxt::StorageEntry for CurrentPlannedSession { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "CurrentPlannedSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct OffendingValidators; - impl ::subxt::StorageEntry for OffendingValidators { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "OffendingValidators"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_staking::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ChillThreshold; - impl ::subxt::StorageEntry for ChillThreshold { - const PALLET: &'static str = "Staking"; - const STORAGE: &'static str = "ChillThreshold"; - type Value = runtime_types::sp_arithmetic::per_things::Percent; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn history_depth( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = HistoryDepth; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validator_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ValidatorCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn minimum_validator_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = MinimumValidatorCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn invulnerables( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Invulnerables; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn bonded( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Bonded(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn bonded_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Bonded>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn min_nominator_bond( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> - { - let entry = MinNominatorBond; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn min_validator_bond( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> - { - let entry = MinValidatorBond; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn ledger( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::StakingLedger< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Ledger(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn ledger_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Ledger>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn payee( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::Error, - > { - let entry = Payee(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn payee_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Payee>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn validators( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::Error, - > { - let entry = Validators(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validators_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Validators>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn counter_for_validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = CounterForValidators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn max_validators_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = MaxValidatorsCount; - self.client.storage().fetch(&entry, hash).await - } - pub async fn nominators( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::Nominations< - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Nominators(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nominators_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Nominators>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn counter_for_nominators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = CounterForNominators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn max_nominators_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = MaxNominatorsCount; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_era( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = CurrentEra; - self.client.storage().fetch(&entry, hash).await - } - pub async fn active_era( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ActiveEra; - self.client.storage().fetch(&entry, hash).await - } - pub async fn eras_start_session_index( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = ErasStartSessionIndex(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn eras_start_session_index_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStartSessionIndex>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_stakers( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ::subxt::Error, - > { - let entry = ErasStakers(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_stakers_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakers>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_stakers_clipped( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Exposure< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ::subxt::Error, - > { - let entry = ErasStakersClipped(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_stakers_clipped_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasStakersClipped>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_validator_prefs( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::ValidatorPrefs, - ::subxt::Error, - > { - let entry = ErasValidatorPrefs(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_validator_prefs_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorPrefs>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_validator_reward( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::Error, - > { - let entry = ErasValidatorReward(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn eras_validator_reward_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasValidatorReward>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_reward_points( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::EraRewardPoints< - ::subxt::sp_core::crypto::AccountId32, - >, - ::subxt::Error, - > { - let entry = ErasRewardPoints(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_reward_points_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasRewardPoints>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn eras_total_stake( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> - { - let entry = ErasTotalStake(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn eras_total_stake_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ErasTotalStake>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn force_era( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Forcing, - ::subxt::Error, - > { - let entry = ForceEra; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn slash_reward_fraction( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::sp_arithmetic::per_things::Perbill, - ::subxt::Error, - > { - let entry = SlashRewardFraction; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn canceled_slash_payout( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> - { - let entry = CanceledSlashPayout; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn unapplied_slashes( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_staking::UnappliedSlash< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = UnappliedSlashes(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn unapplied_slashes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, UnappliedSlashes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bonded_eras( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, - ::subxt::Error, - > { - let entry = BondedEras; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn validator_slash_in_era( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_arithmetic::per_things::Perbill, - ::core::primitive::u128, - )>, - ::subxt::Error, - > { - let entry = ValidatorSlashInEra(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn validator_slash_in_era_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ValidatorSlashInEra>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn nominator_slash_in_era( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::Error, - > { - let entry = NominatorSlashInEra(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nominator_slash_in_era_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NominatorSlashInEra>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn slashing_spans( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::slashing::SlashingSpans, - >, - ::subxt::Error, - > { - let entry = SlashingSpans(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn slashing_spans_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SlashingSpans>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn span_slash( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::slashing::SpanRecord< - ::core::primitive::u128, - >, - ::subxt::Error, - > { - let entry = SpanSlash(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn span_slash_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SpanSlash>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn earliest_unapplied_slash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = EarliestUnappliedSlash; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_planned_session( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = CurrentPlannedSession; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn offending_validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, - ::subxt::Error, - > { - let entry = OffendingValidators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_staking::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn chill_threshold( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - ::subxt::Error, - > { - let entry = ChillThreshold; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod session { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetKeys { - pub keys: runtime_types::node_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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn set_keys( - &self, - keys: runtime_types::node_runtime::SessionKeys, - proof: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetKeys { keys, proof }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn purge_keys(&self) -> ::subxt::SubmittableExtrinsic { - let call = PurgeKeys {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_session::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewSession(pub ::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::node_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(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for NextKeys { - const PALLET: &'static str = "Session"; - const STORAGE: &'static str = "NextKeys"; - type Value = runtime_types::node_runtime::SessionKeys; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct KeyOwner( - runtime_types::sp_core::crypto::KeyTypeId, - ::std::vec::Vec<::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, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Validators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = CurrentIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queued_changed( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = QueuedChanged; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queued_keys( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_runtime::SessionKeys, - )>, - ::subxt::Error, - > { - let entry = QueuedKeys; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn disabled_validators( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = DisabledValidators; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn next_keys( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = NextKeys(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_keys_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, NextKeys>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn key_owner( - &self, - _0: runtime_types::sp_core::crypto::KeyTypeId, - _1: ::std::vec::Vec<::core::primitive::u8>, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = KeyOwner(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn key_owner_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, KeyOwner>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod democracy { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - proposal_hash, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn second( - &self, - proposal: ::core::primitive::u32, - seconds_upper_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Second { - proposal, - seconds_upper_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - ref_index: ::core::primitive::u32, - vote: runtime_types::pallet_democracy::vote::AccountVote< - ::core::primitive::u128, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { ref_index, vote }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn emergency_cancel( - &self, - ref_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = EmergencyCancel { ref_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = ExternalPropose { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose_majority( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExternalProposeMajority { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn external_propose_default( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExternalProposeDefault { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn fast_track( - &self, - proposal_hash: ::subxt::sp_core::H256, - voting_period: ::core::primitive::u32, - delay: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FastTrack { - proposal_hash, - voting_period, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn veto_external( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = VetoExternal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_referendum( - &self, - ref_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelReferendum { ref_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_queued( - &self, - which: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelQueued { which }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn delegate( - &self, - to: ::subxt::sp_core::crypto::AccountId32, - conviction: runtime_types::pallet_democracy::conviction::Conviction, - balance: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Delegate { - to, - conviction, - balance, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn undelegate(&self) -> ::subxt::SubmittableExtrinsic { - let call = Undelegate {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_public_proposals( - &self, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ClearPublicProposals {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_preimage( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = NotePreimage { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_preimage_operational( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = NotePreimageOperational { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_imminent_preimage( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = NoteImminentPreimage { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_imminent_preimage_operational( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = NoteImminentPreimageOperational { encoded_proposal }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reap_preimage( - &self, - proposal_hash: ::subxt::sp_core::H256, - proposal_len_upper_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReapPreimage { - proposal_hash, - proposal_len_upper_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unlock( - &self, - target: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unlock { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_vote( - &self, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveVote { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_other_vote( - &self, - target: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveOtherVote { target, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn enact_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = EnactProposal { - proposal_hash, - index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn blacklist( - &self, - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: ::core::option::Option<::core::primitive::u32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Blacklist { - proposal_hash, - maybe_ref_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_proposal( - &self, - prop_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelProposal { prop_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_democracy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed(pub ::core::primitive::u32, pub ::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)] - pub struct Tabled( - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::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)] - 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)] - pub struct Started( - pub ::core::primitive::u32, - pub 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)] - pub struct Passed(pub ::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)] - pub struct NotPassed(pub ::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)] - pub struct Cancelled(pub ::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)] - pub struct Executed( - pub ::core::primitive::u32, - pub ::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)] - pub struct Delegated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct Undelegated(pub ::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)] - pub struct Vetoed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct PreimageNoted( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct PreimageUsed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct PreimageInvalid( - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct PreimageMissing( - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct PreimageReaped( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::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)] - pub struct Blacklisted(pub ::subxt::sp_core::H256); - impl ::subxt::Event for Blacklisted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Blacklisted"; - } - } - 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(pub ::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(pub ::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(pub ::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(pub ::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 Locks(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Locks"; - type Value = ::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(pub ::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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Cancellations { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Cancellations"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_democracy::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn public_prop_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = PublicPropCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn public_props( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - )>, - ::subxt::Error, - > { - let entry = PublicProps; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn deposit_of( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::core::primitive::u128, - )>, - ::subxt::Error, - > { - let entry = DepositOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn deposit_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DepositOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn preimages( - &self, - _0: ::subxt::sp_core::H256, - 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::Error, - > { - let entry = Preimages(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn preimages_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Preimages>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn referendum_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ReferendumCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lowest_unbaked( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = LowestUnbaked; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn referendum_info_of( - &self, - _0: ::core::primitive::u32, - 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::Error, - > { - let entry = ReferendumInfoOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn referendum_info_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReferendumInfoOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::Error, - > { - let entry = VotingOf(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn voting_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, VotingOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn locks( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = Locks(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn locks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Locks>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn last_tabled_was_external( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = LastTabledWasExternal; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn next_external( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::H256, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - )>, - ::subxt::Error, - > { - let entry = NextExternal; - self.client.storage().fetch(&entry, hash).await - } - pub async fn blacklist( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - )>, - ::subxt::Error, - > { - let entry = Blacklist(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn blacklist_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Blacklist>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn cancellations( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = Cancellations(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn cancellations_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Cancellations>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod council { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Execute { - pub proposal: runtime_types::node_runtime::Call, - #[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)] - pub struct Propose { - #[codec(compact)] - pub threshold: ::core::primitive::u32, - pub proposal: runtime_types::node_runtime::Call, - #[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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMembers { - new_members, - prime, - old_count, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn execute( - &self, - proposal: runtime_types::node_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Execute { - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose( - &self, - threshold: ::core::primitive::u32, - proposal: runtime_types::node_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - threshold, - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { - proposal, - index, - approve, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = DisapproveProposal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct Voted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub ::core::primitive::bool, - pub ::core::primitive::u32, - pub ::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)] - pub struct Approved(pub ::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)] - pub struct Disapproved(pub ::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)] - pub struct Executed( - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct MemberExecuted( - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct Closed( - pub ::subxt::sp_core::H256, - pub ::core::primitive::u32, - pub ::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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::node_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "Council"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn proposals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Proposals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposal_of( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposal_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod technical_committee { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Execute { - pub proposal: runtime_types::node_runtime::Call, - #[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)] - pub struct Propose { - #[codec(compact)] - pub threshold: ::core::primitive::u32, - pub proposal: runtime_types::node_runtime::Call, - #[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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMembers { - new_members, - prime, - old_count, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn execute( - &self, - proposal: runtime_types::node_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Execute { - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose( - &self, - threshold: ::core::primitive::u32, - proposal: runtime_types::node_runtime::Call, - length_bound: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Propose { - threshold, - proposal, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - proposal: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { - proposal, - index, - approve, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = Close { - proposal_hash, - index, - proposal_weight_bound, - length_bound, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = DisapproveProposal { proposal_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_collective::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct Voted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::H256, - pub ::core::primitive::bool, - pub ::core::primitive::u32, - pub ::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)] - pub struct Approved(pub ::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)] - pub struct Disapproved(pub ::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)] - pub struct Executed( - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct MemberExecuted( - pub ::subxt::sp_core::H256, - pub ::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)] - pub struct Closed( - pub ::subxt::sp_core::H256, - pub ::core::primitive::u32, - pub ::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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for ProposalOf { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalOf"; - type Value = runtime_types::node_runtime::Call; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct Voting(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Voting { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct ProposalCount; - impl ::subxt::StorageEntry for ProposalCount { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "ProposalCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Members"; - type Value = ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Prime; - impl ::subxt::StorageEntry for Prime { - const PALLET: &'static str = "TechnicalCommittee"; - const STORAGE: &'static str = "Prime"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn proposals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::H256, - >, - ::subxt::Error, - > { - let entry = Proposals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposal_of( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ProposalOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposal_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ProposalOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_collective::Votes< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod elections { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 = "Elections"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveVoter {} - impl ::subxt::Call for RemoveVoter { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "remove_voter"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SubmitCandidacy { - #[codec(compact)] - pub candidate_count: ::core::primitive::u32, - } - impl ::subxt::Call for SubmitCandidacy { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "submit_candidacy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RenounceCandidacy { - pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - } - impl ::subxt::Call for RenounceCandidacy { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "renounce_candidacy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveMember { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub has_replacement: ::core::primitive::bool, - } - impl ::subxt::Call for RemoveMember { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "remove_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CleanDefunctVoters { - pub num_voters: ::core::primitive::u32, - pub num_defunct: ::core::primitive::u32, - } - impl ::subxt::Call for CleanDefunctVoters { - const PALLET: &'static str = "Elections"; - const FUNCTION: &'static str = "clean_defunct_voters"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn vote( - &self, - votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { votes, value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_voter( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveVoter {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn submit_candidacy( - &self, - candidate_count: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SubmitCandidacy { candidate_count }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn renounce_candidacy( - &self, - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - ) -> ::subxt::SubmittableExtrinsic { - let call = RenounceCandidacy { renouncing }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_member( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - has_replacement: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveMember { - who, - has_replacement, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clean_defunct_voters( - &self, - num_voters: ::core::primitive::u32, - num_defunct: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = CleanDefunctVoters { - num_voters, - num_defunct, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_elections_phragmen::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewTerm( - pub ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ); - impl ::subxt::Event for NewTerm { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "NewTerm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct EmptyTerm {} - impl ::subxt::Event for EmptyTerm { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "EmptyTerm"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ElectionError {} - impl ::subxt::Event for ElectionError { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "ElectionError"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberKicked(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for MemberKicked { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "MemberKicked"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Renounced(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Renounced { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "Renounced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CandidateSlashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for CandidateSlashed { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "CandidateSlashed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SeatHolderSlashed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for SeatHolderSlashed { - const PALLET: &'static str = "Elections"; - const EVENT: &'static str = "SeatHolderSlashed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Elections"; - 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 = "Elections"; - 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 = "Elections"; - 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 = "Elections"; - const STORAGE: &'static str = "ElectionRounds"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Voting(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Voting { - const PALLET: &'static str = "Elections"; - const STORAGE: &'static str = "Voting"; - type Value = runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn members( - &self, - 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::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn runners_up( - &self, - 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::Error, - > { - let entry = RunnersUp; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn candidates( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::Error, - > { - let entry = Candidates; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn election_rounds( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ElectionRounds; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn voting( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_elections_phragmen::Voter< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - ::subxt::Error, - > { - let entry = Voting(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn voting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Voting>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod technical_membership { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn add_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddMember { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveMember { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn swap_member( - &self, - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SwapMember { remove, add }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reset_members( - &self, - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = ResetMembers { members }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn change_key( - &self, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ChangeKey { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_prime( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetPrime { who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_prime( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearPrime {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_membership::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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 } - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn prime( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Prime; - self.client.storage().fetch(&entry, hash).await - } - } - } - } - pub mod grandpa { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReportEquivocation { - pub equivocation_proof: - 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)] - pub struct ReportEquivocationUnsigned { - pub equivocation_proof: - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocation { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ReportEquivocationUnsigned { - equivocation_proof, - key_owner_proof, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn note_stalled( - &self, - delay: ::core::primitive::u32, - best_finalized_block_number: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = NoteStalled { - delay, - best_finalized_block_number, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_grandpa::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewAuthorities( - pub ::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)] - 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)] - 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(pub ::core::primitive::u64); - impl ::subxt::StorageEntry for SetIdSession { - const PALLET: &'static str = "Grandpa"; - const STORAGE: &'static str = "SetIdSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn state( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = State; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn pending_change( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_grandpa::StoredPendingChange< - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = PendingChange; - self.client.storage().fetch(&entry, hash).await - } - pub async fn next_forced( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = NextForced; - self.client.storage().fetch(&entry, hash).await - } - pub async fn stalled( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::Error, - > { - let entry = Stalled; - self.client.storage().fetch(&entry, hash).await - } - pub async fn current_set_id( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = CurrentSetId; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn set_id_session( - &self, - _0: ::core::primitive::u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = SetIdSession(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn set_id_session_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SetIdSession>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod treasury { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProposeSpend { - #[codec(compact)] - pub value: ::core::primitive::u128, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for ProposeSpend { - const PALLET: &'static str = "Treasury"; - const FUNCTION: &'static str = "propose_spend"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose_spend( - &self, - value: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeSpend { value, beneficiary }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reject_proposal( - &self, - proposal_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RejectProposal { proposal_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_proposal( - &self, - proposal_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveProposal { proposal_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_treasury::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposed(pub ::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)] - pub struct Spending(pub ::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)] - pub struct Awarded( - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::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)] - pub struct Rejected(pub ::core::primitive::u32, pub ::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)] - pub struct Burnt(pub ::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)] - pub struct Rollover(pub ::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)] - pub struct Deposit(pub ::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(pub ::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 } - } - pub async fn proposal_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ProposalCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proposals( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_treasury::Proposal< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Proposals(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proposals_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proposals>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn approvals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u32, - >, - ::subxt::Error, - > { - let entry = Approvals; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod contracts { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Call { - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub value: ::core::primitive::u128, - #[codec(compact)] - pub gas_limit: ::core::primitive::u64, - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Call { - const PALLET: &'static str = "Contracts"; - const FUNCTION: &'static str = "call"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstantiateWithCode { - #[codec(compact)] - pub endowment: ::core::primitive::u128, - #[codec(compact)] - pub gas_limit: ::core::primitive::u64, - pub code: ::std::vec::Vec<::core::primitive::u8>, - pub data: ::std::vec::Vec<::core::primitive::u8>, - pub salt: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for InstantiateWithCode { - const PALLET: &'static str = "Contracts"; - const FUNCTION: &'static str = "instantiate_with_code"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Instantiate { - #[codec(compact)] - pub endowment: ::core::primitive::u128, - #[codec(compact)] - pub gas_limit: ::core::primitive::u64, - pub code_hash: ::subxt::sp_core::H256, - pub data: ::std::vec::Vec<::core::primitive::u8>, - pub salt: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Instantiate { - const PALLET: &'static str = "Contracts"; - const FUNCTION: &'static str = "instantiate"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn call( - &self, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - value: ::core::primitive::u128, - gas_limit: ::core::primitive::u64, - data: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Call { - dest, - value, - gas_limit, - data, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn instantiate_with_code( - &self, - endowment: ::core::primitive::u128, - gas_limit: ::core::primitive::u64, - code: ::std::vec::Vec<::core::primitive::u8>, - data: ::std::vec::Vec<::core::primitive::u8>, - salt: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = InstantiateWithCode { - endowment, - gas_limit, - code, - data, - salt, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn instantiate( - &self, - endowment: ::core::primitive::u128, - gas_limit: ::core::primitive::u64, - code_hash: ::subxt::sp_core::H256, - data: ::std::vec::Vec<::core::primitive::u8>, - salt: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Instantiate { - endowment, - gas_limit, - code_hash, - data, - salt, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_contracts::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Instantiated { - pub deployer: ::subxt::sp_core::crypto::AccountId32, - pub contract: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Instantiated { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "Instantiated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Terminated { - pub contract: ::subxt::sp_core::crypto::AccountId32, - pub beneficiary: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Event for Terminated { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "Terminated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CodeStored { - pub code_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for CodeStored { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "CodeStored"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduleUpdated { - pub version: ::core::primitive::u32, - } - impl ::subxt::Event for ScheduleUpdated { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "ScheduleUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ContractEmitted { - pub contract: ::subxt::sp_core::crypto::AccountId32, - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Event for ContractEmitted { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "ContractEmitted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CodeRemoved { - pub code_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for CodeRemoved { - const PALLET: &'static str = "Contracts"; - const EVENT: &'static str = "CodeRemoved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct PristineCode(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for PristineCode { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "PristineCode"; - 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 CodeStorage(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for CodeStorage { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "CodeStorage"; - type Value = runtime_types::pallet_contracts::wasm::PrefabWasmModule; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct AccountCounter; - impl ::subxt::StorageEntry for AccountCounter { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "AccountCounter"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ContractInfoOf(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for ContractInfoOf { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "ContractInfoOf"; - type Value = runtime_types::pallet_contracts::storage::RawContractInfo< - ::subxt::sp_core::H256, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct DeletionQueue; - impl ::subxt::StorageEntry for DeletionQueue { - const PALLET: &'static str = "Contracts"; - const STORAGE: &'static str = "DeletionQueue"; - type Value = ::std::vec::Vec< - runtime_types::pallet_contracts::storage::DeletedContract, - >; - 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 pristine_code( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::Error, - > { - let entry = PristineCode(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn pristine_code_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, PristineCode>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn code_storage( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_contracts::wasm::PrefabWasmModule, - >, - ::subxt::Error, - > { - let entry = CodeStorage(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn code_storage_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, CodeStorage>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn account_counter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = AccountCounter; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn contract_info_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_contracts::storage::RawContractInfo< - ::subxt::sp_core::H256, - >, - >, - ::subxt::Error, - > { - let entry = ContractInfoOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn contract_info_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ContractInfoOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn deletion_queue( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_contracts::storage::DeletedContract, - >, - ::subxt::Error, - > { - let entry = DeletionQueue; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod sudo { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Sudo { - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for Sudo { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoUncheckedWeight { - pub call: runtime_types::node_runtime::Call, - pub weight: ::core::primitive::u64, - } - impl ::subxt::Call for SudoUncheckedWeight { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_unchecked_weight"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetKey { - pub new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for SetKey { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "set_key"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoAs { - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for SudoAs { - const PALLET: &'static str = "Sudo"; - const FUNCTION: &'static str = "sudo_as"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn sudo( - &self, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Sudo { call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_unchecked_weight( - &self, - call: runtime_types::node_runtime::Call, - weight: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic - { - let call = SudoUncheckedWeight { call, weight }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_key( - &self, - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetKey { new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn sudo_as( - &self, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = SudoAs { who, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_sudo::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Sudid( - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for Sudid { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "Sudid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KeyChanged(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for KeyChanged { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "KeyChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SudoAsDone( - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for SudoAsDone { - const PALLET: &'static str = "Sudo"; - const EVENT: &'static str = "SudoAsDone"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Key; - impl ::subxt::StorageEntry for Key { - const PALLET: &'static str = "Sudo"; - const STORAGE: &'static str = "Key"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn key( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::sp_core::crypto::AccountId32, - ::subxt::Error, - > { - let entry = Key; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod im_online { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn heartbeat( - &self, - heartbeat: runtime_types::pallet_im_online::Heartbeat< - ::core::primitive::u32, - >, - signature : runtime_types :: pallet_im_online :: sr25519 :: app_sr25519 :: Signature, - ) -> ::subxt::SubmittableExtrinsic { - let call = Heartbeat { - heartbeat, - signature, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_im_online::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct HeartbeatReceived( - pub 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)] - 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)] - pub struct SomeOffline( - pub ::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(::core::primitive::u32, ::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( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for AuthoredBlocks { - const PALLET: &'static str = "ImOnline"; - const STORAGE: &'static str = "AuthoredBlocks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Twox64Concat, - ), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn heartbeat_after( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = HeartbeatAfter; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn keys (& self , 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 :: Error >{ - let entry = Keys; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn received_heartbeats( - &self, - _0: ::core::primitive::u32, - _1: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::frame_support::traits::misc::WrapperOpaque< - runtime_types::pallet_im_online::BoundedOpaqueNetworkState, - >, - >, - ::subxt::Error, - > { - let entry = ReceivedHeartbeats(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn received_heartbeats_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReceivedHeartbeats>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn authored_blocks( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = AuthoredBlocks(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn authored_blocks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, AuthoredBlocks>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod authority_discovery { - use super::runtime_types; - } - pub mod offences { - use super::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)] - pub struct Offence( - pub [::core::primitive::u8; 16usize], - pub ::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(pub ::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( - [::core::primitive::u8; 16usize], - ::std::vec::Vec<::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(pub [::core::primitive::u8; 16usize]); - impl ::subxt::StorageEntry for ReportsByKindIndex { - const PALLET: &'static str = "Offences"; - const STORAGE: &'static str = "ReportsByKindIndex"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn reports( - &self, - _0: ::subxt::sp_core::H256, - 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::Error, - > { - let entry = Reports(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn reports_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reports>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn concurrent_reports_index( - &self, - _0: [::core::primitive::u8; 16usize], - _1: ::std::vec::Vec<::core::primitive::u8>, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = ConcurrentReportsIndex(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn concurrent_reports_index_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ConcurrentReportsIndex>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn reports_by_kind_index( - &self, - _0: [::core::primitive::u8; 16usize], - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u8>, - ::subxt::Error, - > { - let entry = ReportsByKindIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn reports_by_kind_index_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ReportsByKindIndex>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod historical { - use super::runtime_types; - } - pub mod randomness_collective_flip { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct RandomMaterial; - impl ::subxt::StorageEntry for RandomMaterial { - const PALLET: &'static str = "RandomnessCollectiveFlip"; - const STORAGE: &'static str = "RandomMaterial"; - type Value = ::std::vec::Vec<::subxt::sp_core::H256>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn random_material( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = RandomMaterial; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod identity { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct SetIdentity { - pub info: 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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)] - pub struct ProvideJudgement { - #[codec(compact)] - pub reg_index: ::core::primitive::u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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)] - pub struct KillIdentity { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for KillIdentity { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "kill_identity"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AddSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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)] - pub struct RenameSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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)] - pub struct RemoveSub { - pub sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for RemoveSub { - const PALLET: &'static str = "Identity"; - const FUNCTION: &'static str = "remove_sub"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn add_registrar( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddRegistrar { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_identity( - &self, - info: runtime_types::pallet_identity::types::IdentityInfo, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetIdentity { info }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_subs( - &self, - subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetSubs { subs }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_identity( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearIdentity {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn request_judgement( - &self, - reg_index: ::core::primitive::u32, - max_fee: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = RequestJudgement { reg_index, max_fee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_request( - &self, - reg_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelRequest { reg_index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_fee( - &self, - index: ::core::primitive::u32, - fee: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetFee { index, fee }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_account_id( - &self, - index: ::core::primitive::u32, - new: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetAccountId { index, new }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_fields( - &self, - index: ::core::primitive::u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetFields { index, fields }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn provide_judgement( - &self, - reg_index: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - judgement: runtime_types::pallet_identity::types::Judgement< - ::core::primitive::u128, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProvideJudgement { - reg_index, - target, - judgement, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_identity( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillIdentity { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn add_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - data: runtime_types::pallet_identity::types::Data, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddSub { sub, data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn rename_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - data: runtime_types::pallet_identity::types::Data, - ) -> ::subxt::SubmittableExtrinsic { - let call = RenameSub { sub, data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_sub( - &self, - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveSub { sub }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn quit_sub(&self) -> ::subxt::SubmittableExtrinsic { - let call = QuitSub {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_identity::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IdentitySet(pub ::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)] - pub struct IdentityCleared( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct IdentityKilled( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct JudgementRequested( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct JudgementUnrequested( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct JudgementGiven( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct RegistrarAdded(pub ::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)] - pub struct SubIdentityAdded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct SubIdentityRemoved( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct SubIdentityRevoked( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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(pub ::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(pub ::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(pub ::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 } - } - pub async fn identity_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_identity::types::Registration< - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = IdentityOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn identity_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, IdentityOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn super_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - ::subxt::Error, - > { - let entry = SuperOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn super_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuperOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn subs_of( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - ::core::primitive::u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - ::subxt::Error, - > { - let entry = SubsOf(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn subs_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, SubsOf>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn registrars( - &self, - 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::Error, - > { - let entry = Registrars; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod society { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bid { - pub value: ::core::primitive::u128, - } - impl ::subxt::Call for Bid { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unbid { - pub pos: ::core::primitive::u32, - } - impl ::subxt::Call for Unbid { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "unbid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vouch { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub value: ::core::primitive::u128, - pub tip: ::core::primitive::u128, - } - impl ::subxt::Call for Vouch { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "vouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unvouch { - pub pos: ::core::primitive::u32, - } - impl ::subxt::Call for Unvouch { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "unvouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote { - pub candidate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub approve: ::core::primitive::bool, - } - impl ::subxt::Call for Vote { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DefenderVote { - pub approve: ::core::primitive::bool, - } - impl ::subxt::Call for DefenderVote { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "defender_vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Payout {} - impl ::subxt::Call for Payout { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "payout"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Found { - pub founder: ::subxt::sp_core::crypto::AccountId32, - pub max_members: ::core::primitive::u32, - pub rules: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Found { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "found"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unfound {} - impl ::subxt::Call for Unfound { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "unfound"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgeSuspendedMember { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub forgive: ::core::primitive::bool, - } - impl ::subxt::Call for JudgeSuspendedMember { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "judge_suspended_member"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct JudgeSuspendedCandidate { - pub who: ::subxt::sp_core::crypto::AccountId32, - pub judgement: runtime_types::pallet_society::Judgement, - } - impl ::subxt::Call for JudgeSuspendedCandidate { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "judge_suspended_candidate"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMaxMembers { - pub max: ::core::primitive::u32, - } - impl ::subxt::Call for SetMaxMembers { - const PALLET: &'static str = "Society"; - const FUNCTION: &'static str = "set_max_members"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn bid( - &self, - value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Bid { value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unbid( - &self, - pos: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unbid { pos }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vouch( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - value: ::core::primitive::u128, - tip: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vouch { who, value, tip }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unvouch( - &self, - pos: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Unvouch { pos }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vote( - &self, - candidate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - approve: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = Vote { candidate, approve }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn defender_vote( - &self, - approve: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = DefenderVote { approve }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn payout(&self) -> ::subxt::SubmittableExtrinsic { - let call = Payout {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn found( - &self, - founder: ::subxt::sp_core::crypto::AccountId32, - max_members: ::core::primitive::u32, - rules: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Found { - founder, - max_members, - rules, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unfound(&self) -> ::subxt::SubmittableExtrinsic { - let call = Unfound {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn judge_suspended_member( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - forgive: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic - { - let call = JudgeSuspendedMember { who, forgive }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn judge_suspended_candidate( - &self, - who: ::subxt::sp_core::crypto::AccountId32, - judgement: runtime_types::pallet_society::Judgement, - ) -> ::subxt::SubmittableExtrinsic - { - let call = JudgeSuspendedCandidate { who, judgement }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_max_members( - &self, - max: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMaxMembers { max }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_society::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Founded(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Founded { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Founded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bid( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Bid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vouch( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Vouch { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Vouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AutoUnbid(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for AutoUnbid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "AutoUnbid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unbid(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Unbid { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unbid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unvouch(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Unvouch { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unvouch"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Inducted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ); - impl ::subxt::Event for Inducted { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Inducted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SuspendedMemberJudgement( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::bool, - ); - impl ::subxt::Event for SuspendedMemberJudgement { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "SuspendedMemberJudgement"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CandidateSuspended(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for CandidateSuspended { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "CandidateSuspended"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MemberSuspended(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for MemberSuspended { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "MemberSuspended"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Challenged(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Challenged { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Challenged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Vote( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::bool, - ); - impl ::subxt::Event for Vote { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Vote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DefenderVote( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::bool, - ); - impl ::subxt::Event for DefenderVote { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "DefenderVote"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewMaxMembers(pub ::core::primitive::u32); - impl ::subxt::Event for NewMaxMembers { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "NewMaxMembers"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Unfounded(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for Unfounded { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Unfounded"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Deposit(pub ::core::primitive::u128); - impl ::subxt::Event for Deposit { - const PALLET: &'static str = "Society"; - const EVENT: &'static str = "Deposit"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Founder; - impl ::subxt::StorageEntry for Founder { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Founder"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Rules; - impl ::subxt::StorageEntry for Rules { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Rules"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Candidates; - impl ::subxt::StorageEntry for Candidates { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Candidates"; - type Value = ::std::vec::Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SuspendedCandidates(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SuspendedCandidates { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "SuspendedCandidates"; - type Value = ( - ::core::primitive::u128, - runtime_types::pallet_society::BidKind< - ::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 Pot; - impl ::subxt::StorageEntry for Pot { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Pot"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Head; - impl ::subxt::StorageEntry for Head { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Head"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Members; - impl ::subxt::StorageEntry for Members { - const PALLET: &'static str = "Society"; - 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 SuspendedMembers(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for SuspendedMembers { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "SuspendedMembers"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Bids; - impl ::subxt::StorageEntry for Bids { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Bids"; - type Value = ::std::vec::Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Vouching(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Vouching { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Vouching"; - type Value = runtime_types::pallet_society::VouchingStatus; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Payouts(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Payouts { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Payouts"; - type Value = - ::std::vec::Vec<(::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 Strikes(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Strikes { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Strikes"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct Votes( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for Votes { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Votes"; - type Value = runtime_types::pallet_society::Vote; - 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 Defender; - impl ::subxt::StorageEntry for Defender { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "Defender"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct DefenderVotes(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for DefenderVotes { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "DefenderVotes"; - type Value = runtime_types::pallet_society::Vote; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MaxMembers; - impl ::subxt::StorageEntry for MaxMembers { - const PALLET: &'static str = "Society"; - const STORAGE: &'static str = "MaxMembers"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn founder( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Founder; - self.client.storage().fetch(&entry, hash).await - } - pub async fn rules( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = Rules; - self.client.storage().fetch(&entry, hash).await - } - pub async fn candidates( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Candidates; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn suspended_candidates( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u128, - runtime_types::pallet_society::BidKind< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - )>, - ::subxt::Error, - > { - let entry = SuspendedCandidates(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn suspended_candidates_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuspendedCandidates>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn pot( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::Error> - { - let entry = Pot; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn head( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Head; - self.client.storage().fetch(&entry, hash).await - } - pub async fn members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Members; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn suspended_members( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = SuspendedMembers(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn suspended_members_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SuspendedMembers>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bids( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_society::Bid< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Bids; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn vouching( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = Vouching(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn vouching_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Vouching>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn payouts( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>, - ::subxt::Error, - > { - let entry = Payouts(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn payouts_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Payouts>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn strikes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = Strikes(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn strikes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Strikes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn votes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = Votes(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn votes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Votes>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn defender( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Defender; - self.client.storage().fetch(&entry, hash).await - } - pub async fn defender_votes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = DefenderVotes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn defender_votes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, DefenderVotes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn max_members( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = MaxMembers; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod recovery { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsRecovered { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for AsRecovered { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "as_recovered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetRecovered { - pub lost: ::subxt::sp_core::crypto::AccountId32, - pub rescuer: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for SetRecovered { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "set_recovered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CreateRecovery { - pub friends: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub threshold: ::core::primitive::u16, - pub delay_period: ::core::primitive::u32, - } - impl ::subxt::Call for CreateRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "create_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InitiateRecovery { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for InitiateRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "initiate_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VouchRecovery { - pub lost: ::subxt::sp_core::crypto::AccountId32, - pub rescuer: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for VouchRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "vouch_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClaimRecovery { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for ClaimRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "claim_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CloseRecovery { - pub rescuer: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for CloseRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "close_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RemoveRecovery {} - impl ::subxt::Call for RemoveRecovery { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "remove_recovery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelRecovered { - pub account: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for CancelRecovered { - const PALLET: &'static str = "Recovery"; - const FUNCTION: &'static str = "cancel_recovered"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn as_recovered( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsRecovered { account, call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_recovered( - &self, - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetRecovered { lost, rescuer }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn create_recovery( - &self, - friends: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - threshold: ::core::primitive::u16, - delay_period: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CreateRecovery { - friends, - threshold, - delay_period, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn initiate_recovery( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = InitiateRecovery { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vouch_recovery( - &self, - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = VouchRecovery { lost, rescuer }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn claim_recovery( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClaimRecovery { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close_recovery( - &self, - rescuer: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseRecovery { rescuer }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_recovery( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveRecovery {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_recovered( - &self, - account: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelRecovered { account }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_recovery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryCreated(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for RecoveryCreated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryInitiated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for RecoveryInitiated { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryInitiated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryVouched( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for RecoveryVouched { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryVouched"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryClosed( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for RecoveryClosed { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryClosed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AccountRecovered( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for AccountRecovered { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "AccountRecovered"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryRemoved(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::Event for RecoveryRemoved { - const PALLET: &'static str = "Recovery"; - const EVENT: &'static str = "RecoveryRemoved"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Recoverable(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Recoverable { - const PALLET: &'static str = "Recovery"; - const STORAGE: &'static str = "Recoverable"; - type Value = runtime_types::pallet_recovery::RecoveryConfig< - ::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, - )]) - } - } - pub struct ActiveRecoveries( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for ActiveRecoveries { - const PALLET: &'static str = "Recovery"; - const STORAGE: &'static str = "ActiveRecoveries"; - type Value = runtime_types::pallet_recovery::ActiveRecovery< - ::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::Twox64Concat, - ), - ]) - } - } - pub struct Proxy(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Proxy { - const PALLET: &'static str = "Recovery"; - const STORAGE: &'static str = "Proxy"; - type Value = ::subxt::sp_core::crypto::AccountId32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn recoverable( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_recovery::RecoveryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Recoverable(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn recoverable_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Recoverable>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn active_recoveries( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_recovery::ActiveRecovery< - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = ActiveRecoveries(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn active_recoveries_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ActiveRecoveries>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn proxy( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Proxy(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn proxy_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Proxy>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod vesting { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct VestOther { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for VestOther { - const PALLET: &'static str = "Vesting"; - const FUNCTION: &'static str = "vest_other"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestedTransfer { - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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)] - pub struct ForceVestedTransfer { - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn vest(&self) -> ::subxt::SubmittableExtrinsic { - let call = Vest {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vest_other( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = VestOther { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn vested_transfer( - &self, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = VestedTransfer { target, schedule }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_vested_transfer( - &self, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceVestedTransfer { - source, - target, - schedule, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn merge_schedules( - &self, - schedule1_index: ::core::primitive::u32, - schedule2_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = MergeSchedules { - schedule1_index, - schedule2_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_vesting::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestingUpdated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct VestingCompleted(pub ::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(pub ::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 } - } - pub async fn vesting( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::Error, - > { - let entry = Vesting(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn vesting_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Vesting>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_vesting::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod scheduler { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for Schedule { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ScheduleNamed { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ScheduleAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_after"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ScheduleNamedAfter { - const PALLET: &'static str = "Scheduler"; - const FUNCTION: &'static str = "schedule_named_after"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - 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::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Schedule { - when, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel( - &self, - when: ::core::primitive::u32, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Cancel { when, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ScheduleNamed { - id, - when, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_named( - &self, - id: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelNamed { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ScheduleAfter { - after, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ScheduleNamedAfter { - id, - after, - maybe_periodic, - priority, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_scheduler::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Scheduled(pub ::core::primitive::u32, pub ::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)] - pub struct Canceled(pub ::core::primitive::u32, pub ::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)] - pub struct Dispatched( - pub (::core::primitive::u32, ::core::primitive::u32), - pub ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - ); - impl ::subxt::Event for Dispatched { - const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "Dispatched"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Agenda(pub ::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::ScheduledV2< - runtime_types::node_runtime::Call, - ::core::primitive::u32, - runtime_types::node_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(pub ::std::vec::Vec<::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 StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_scheduler::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 agenda( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - ::core::option::Option< - runtime_types::pallet_scheduler::ScheduledV2< - runtime_types::node_runtime::Call, - ::core::primitive::u32, - runtime_types::node_runtime::OriginCaller, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - >, - ::subxt::Error, - > { - let entry = Agenda(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn agenda_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Agenda>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn lookup( - &self, - _0: ::std::vec::Vec<::core::primitive::u8>, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - ::subxt::Error, - > { - let entry = Lookup(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn lookup_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Lookup>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_scheduler::Releases, - ::subxt::Error, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod proxy { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proxy { - pub real: ::subxt::sp_core::crypto::AccountId32, - pub force_proxy_type: - ::core::option::Option, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for Proxy { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AddProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::node_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)] - pub struct RemoveProxy { - pub delegate: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::node_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)] - 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)] - pub struct Anonymous { - pub proxy_type: runtime_types::node_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)] - pub struct KillAnonymous { - pub spawner: ::subxt::sp_core::crypto::AccountId32, - pub proxy_type: runtime_types::node_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)] - 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)] - 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)] - 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)] - 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: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for ProxyAnnounced { - const PALLET: &'static str = "Proxy"; - const FUNCTION: &'static str = "proxy_announced"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn proxy( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::node_runtime::ProxyType, - >, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = Proxy { - real, - force_proxy_type, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn add_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AddProxy { - delegate, - proxy_type, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_proxy( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxy { - delegate, - proxy_type, - delay, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_proxies( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = RemoveProxies {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn anonymous( - &self, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - ) -> ::subxt::SubmittableExtrinsic { - let call = Anonymous { - proxy_type, - delay, - index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn kill_anonymous( - &self, - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - index: ::core::primitive::u16, - height: ::core::primitive::u32, - ext_index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = KillAnonymous { - spawner, - proxy_type, - index, - height, - ext_index, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn announce( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = Announce { real, call_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn remove_announcement( - &self, - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RemoveAnnouncement { real, call_hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn reject_announcement( - &self, - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic - { - let call = RejectAnnouncement { - delegate, - call_hash, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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::node_runtime::ProxyType, - >, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProxyAnnounced { - delegate, - real, - force_proxy_type, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_proxy::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProxyExecuted( - pub ::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)] - pub struct AnonymousCreated( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::node_runtime::ProxyType, - pub ::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)] - pub struct Announced( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct ProxyAdded( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::node_runtime::ProxyType, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for ProxyAdded { - const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "ProxyAdded"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Proxies(pub ::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::node_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(pub ::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 } - } - pub async fn proxies( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::node_runtime::ProxyType, - ::core::primitive::u32, - >, - >, - ::core::primitive::u128, - ), - ::subxt::Error, - > { - let entry = Proxies(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proxies_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Proxies>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn announcements( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - 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::Error, - > { - let entry = Announcements(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn announcements_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Announcements>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod multisig { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AsMultiThreshold1 { - pub other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for AsMultiThreshold1 { - const PALLET: &'static str = "Multisig"; - const FUNCTION: &'static str = "as_multi_threshold1"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn as_multi_threshold1( - &self, - other_signatories: ::std::vec::Vec< - ::subxt::sp_core::crypto::AccountId32, - >, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMultiThreshold1 { - other_signatories, - call, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = AsMulti { - threshold, - other_signatories, - maybe_timepoint, - call, - store_call, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveAsMulti { - threshold, - other_signatories, - maybe_timepoint, - call_hash, - max_weight, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - 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], - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelAsMulti { - threshold, - other_signatories, - timepoint, - call_hash, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_multisig::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewMultisig( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::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)] - pub struct MultisigApproval( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::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)] - pub struct MultisigExecuted( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::core::primitive::u8; 32usize], - pub ::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)] - pub struct MultisigCancelled( - pub ::subxt::sp_core::crypto::AccountId32, - pub runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - pub ::subxt::sp_core::crypto::AccountId32, - pub [::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( - ::subxt::sp_core::crypto::AccountId32, - [::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(pub [::core::primitive::u8; 32usize]); - impl ::subxt::StorageEntry for Calls { - const PALLET: &'static str = "Multisig"; - const STORAGE: &'static str = "Calls"; - type Value = ( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn multisigs( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: [::core::primitive::u8; 32usize], - 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::Error, - > { - let entry = Multisigs(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn multisigs_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Multisigs>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn calls( - &self, - _0: [::core::primitive::u8; 32usize], - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - ::subxt::WrapperKeepOpaque, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::Error, - > { - let entry = Calls(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn calls_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Calls>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod bounties { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub struct ProposeCurator { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - pub curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[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)] - 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)] - 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)] - pub struct AwardBounty { - #[codec(compact)] - pub bounty_id: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for AwardBounty { - const PALLET: &'static str = "Bounties"; - const FUNCTION: &'static str = "award_bounty"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn propose_bounty( - &self, - value: ::core::primitive::u128, - description: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeBounty { value, description }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_bounty( - &self, - bounty_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveBounty { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn propose_curator( - &self, - bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - fee: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = ProposeCurator { - bounty_id, - curator, - fee, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn unassign_curator( - &self, - bounty_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = UnassignCurator { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn accept_curator( - &self, - bounty_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = AcceptCurator { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn award_bounty( - &self, - bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = AwardBounty { - bounty_id, - beneficiary, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn claim_bounty( - &self, - bounty_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClaimBounty { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close_bounty( - &self, - bounty_id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseBounty { bounty_id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn extend_bounty_expiry( - &self, - bounty_id: ::core::primitive::u32, - remark: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ExtendBountyExpiry { bounty_id, remark }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_bounties::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BountyProposed(pub ::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)] - pub struct BountyRejected( - pub ::core::primitive::u32, - pub ::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)] - pub struct BountyBecameActive(pub ::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)] - pub struct BountyAwarded( - pub ::core::primitive::u32, - pub ::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)] - pub struct BountyClaimed( - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::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)] - pub struct BountyCanceled(pub ::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)] - pub struct BountyExtended(pub ::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(pub ::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(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for BountyDescriptions { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyDescriptions"; - 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 BountyApprovals; - impl ::subxt::StorageEntry for BountyApprovals { - const PALLET: &'static str = "Bounties"; - const STORAGE: &'static str = "BountyApprovals"; - type Value = ::std::vec::Vec<::core::primitive::u32>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn bounty_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = BountyCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn bounties( - &self, - _0: ::core::primitive::u32, - 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::Error, - > { - let entry = Bounties(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn bounties_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Bounties>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bounty_descriptions( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::Error, - > { - let entry = BountyDescriptions(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn bounty_descriptions_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, BountyDescriptions>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn bounty_approvals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u32>, - ::subxt::Error, - > { - let entry = BountyApprovals; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod tips { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - 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)] - 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)] - 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)] - 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 + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn report_awesome( - &self, - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ReportAwesome { reason, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn retract_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = RetractTip { hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn tip_new( - &self, - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - tip_value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = TipNew { - reason, - who, - tip_value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn tip( - &self, - hash: ::subxt::sp_core::H256, - tip_value: ::core::primitive::u128, - ) -> ::subxt::SubmittableExtrinsic { - let call = Tip { hash, tip_value }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn close_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = CloseTip { hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn slash_tip( - &self, - hash: ::subxt::sp_core::H256, - ) -> ::subxt::SubmittableExtrinsic { - let call = SlashTip { hash }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_tips::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NewTip(pub ::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)] - pub struct TipClosing(pub ::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)] - pub struct TipClosed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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)] - pub struct TipRetracted(pub ::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)] - pub struct TipSlashed( - pub ::subxt::sp_core::H256, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::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(pub ::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(pub ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reasons { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Reasons"; - type Value = ::std::vec::Vec<::core::primitive::u8>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn tips( - &self, - _0: ::subxt::sp_core::H256, - 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::Error, - > { - let entry = Tips(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn tips_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Tips>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn reasons( - &self, - _0: ::subxt::sp_core::H256, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::subxt::Error, - > { - let entry = Reasons(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn reasons_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reasons>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod assets { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Create { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub min_balance: ::core::primitive::u64, - } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreate { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub is_sufficient: ::core::primitive::bool, - #[codec(compact)] - pub min_balance: ::core::primitive::u64, - } - impl ::subxt::Call for ForceCreate { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroy { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub witness: runtime_types::pallet_assets::types::DestroyWitness, - } - impl ::subxt::Call for Destroy { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "destroy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Mint { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for Mint { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "mint"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burn { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for Burn { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "burn"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferKeepAlive { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for TransferKeepAlive { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer_keep_alive"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceTransfer { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for ForceTransfer { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Freeze { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "freeze"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thaw { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for Thaw { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "thaw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct FreezeAsset { - #[codec(compact)] - pub id: ::core::primitive::u32, - } - impl ::subxt::Call for FreezeAsset { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "freeze_asset"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ThawAsset { - #[codec(compact)] - pub id: ::core::primitive::u32, - } - impl ::subxt::Call for ThawAsset { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "thaw_asset"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferOwnership { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for TransferOwnership { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer_ownership"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetTeam { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for SetTeam { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "set_team"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMetadata { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub name: ::std::vec::Vec<::core::primitive::u8>, - pub symbol: ::std::vec::Vec<::core::primitive::u8>, - pub decimals: ::core::primitive::u8, - } - impl ::subxt::Call for SetMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "set_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearMetadata { - #[codec(compact)] - pub id: ::core::primitive::u32, - } - impl ::subxt::Call for ClearMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "clear_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceSetMetadata { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub name: ::std::vec::Vec<::core::primitive::u8>, - pub symbol: ::std::vec::Vec<::core::primitive::u8>, - pub decimals: ::core::primitive::u8, - pub is_frozen: ::core::primitive::bool, - } - impl ::subxt::Call for ForceSetMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_set_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceClearMetadata { - #[codec(compact)] - pub id: ::core::primitive::u32, - } - impl ::subxt::Call for ForceClearMetadata { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_clear_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceAssetStatus { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub min_balance: ::core::primitive::u64, - pub is_sufficient: ::core::primitive::bool, - pub is_frozen: ::core::primitive::bool, - } - impl ::subxt::Call for ForceAssetStatus { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_asset_status"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveTransfer { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for ApproveTransfer { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "approve_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelApproval { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for CancelApproval { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "cancel_approval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCancelApproval { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for ForceCancelApproval { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "force_cancel_approval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferApproved { - #[codec(compact)] - pub id: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub destination: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - pub amount: ::core::primitive::u64, - } - impl ::subxt::Call for TransferApproved { - const PALLET: &'static str = "Assets"; - const FUNCTION: &'static str = "transfer_approved"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn create( - &self, - id: ::core::primitive::u32, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - min_balance: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Create { - id, - admin, - min_balance, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_create( - &self, - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - is_sufficient: ::core::primitive::bool, - min_balance: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceCreate { - id, - owner, - is_sufficient, - min_balance, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn destroy( - &self, - id: ::core::primitive::u32, - witness: runtime_types::pallet_assets::types::DestroyWitness, - ) -> ::subxt::SubmittableExtrinsic { - let call = Destroy { id, witness }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn mint( - &self, - id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Mint { - id, - beneficiary, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn burn( - &self, - id: ::core::primitive::u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Burn { id, who, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer( - &self, - id: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { id, target, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_keep_alive( - &self, - id: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferKeepAlive { id, target, amount }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_transfer( - &self, - id: ::core::primitive::u32, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceTransfer { - id, - source, - dest, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze( - &self, - id: ::core::primitive::u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Freeze { id, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw( - &self, - id: ::core::primitive::u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Thaw { id, who }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze_asset( - &self, - id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FreezeAsset { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw_asset( - &self, - id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ThawAsset { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_ownership( - &self, - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferOwnership { id, owner }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_team( - &self, - id: ::core::primitive::u32, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetTeam { - id, - issuer, - admin, - freezer, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_metadata( - &self, - id: ::core::primitive::u32, - name: ::std::vec::Vec<::core::primitive::u8>, - symbol: ::std::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMetadata { - id, - name, - symbol, - decimals, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_metadata( - &self, - id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearMetadata { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_set_metadata( - &self, - id: ::core::primitive::u32, - name: ::std::vec::Vec<::core::primitive::u8>, - symbol: ::std::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - is_frozen: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceSetMetadata { - id, - name, - symbol, - decimals, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_clear_metadata( - &self, - id: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceClearMetadata { id }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_asset_status( - &self, - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - min_balance: ::core::primitive::u64, - is_sufficient: ::core::primitive::bool, - is_frozen: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceAssetStatus { - id, - owner, - issuer, - admin, - freezer, - min_balance, - is_sufficient, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_transfer( - &self, - id: ::core::primitive::u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveTransfer { - id, - delegate, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_approval( - &self, - id: ::core::primitive::u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelApproval { id, delegate }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_cancel_approval( - &self, - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ForceCancelApproval { - id, - owner, - delegate, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_approved( - &self, - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - destination: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u64, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferApproved { - id, - owner, - destination, - amount, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_assets::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Created( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Created { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Created"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Issued( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for Issued { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Issued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transferred( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for Transferred { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Transferred"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burned( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for Burned { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Burned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TeamChanged( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for TeamChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TeamChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OwnerChanged( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for OwnerChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "OwnerChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Frozen( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Frozen { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Frozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thawed( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Thawed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Thawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetFrozen(pub ::core::primitive::u32); - impl ::subxt::Event for AssetFrozen { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetFrozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetThawed(pub ::core::primitive::u32); - impl ::subxt::Event for AssetThawed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetThawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroyed(pub ::core::primitive::u32); - impl ::subxt::Event for Destroyed { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "Destroyed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreated( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ForceCreated { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ForceCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataSet( - pub ::core::primitive::u32, - pub ::std::vec::Vec<::core::primitive::u8>, - pub ::std::vec::Vec<::core::primitive::u8>, - pub ::core::primitive::u8, - pub ::core::primitive::bool, - ); - impl ::subxt::Event for MetadataSet { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataCleared(pub ::core::primitive::u32); - impl ::subxt::Event for MetadataCleared { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "MetadataCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovedTransfer( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for ApprovedTransfer { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovedTransfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovalCancelled( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ApprovalCancelled { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "ApprovalCancelled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferredApproved( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - ); - impl ::subxt::Event for TransferredApproved { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "TransferredApproved"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetStatusChanged(pub ::core::primitive::u32); - impl ::subxt::Event for AssetStatusChanged { - const PALLET: &'static str = "Assets"; - const EVENT: &'static str = "AssetStatusChanged"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Asset(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Asset { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Asset"; - type Value = runtime_types::pallet_assets::types::AssetDetails< - ::core::primitive::u64, - ::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 Account( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for Account { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Account"; - type Value = runtime_types::pallet_assets::types::AssetBalance< - ::core::primitive::u64, - (), - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Approvals( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::StorageEntry for Approvals { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Approvals"; - type Value = runtime_types::pallet_assets::types::Approval< - ::core::primitive::u64, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.2, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Metadata(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Metadata { - const PALLET: &'static str = "Assets"; - const STORAGE: &'static str = "Metadata"; - type Value = runtime_types::pallet_assets::types::AssetMetadata< - ::core::primitive::u128, - 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::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn asset( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_assets::types::AssetDetails< - ::core::primitive::u64, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Asset(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn asset_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn account( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_assets::types::AssetBalance< - ::core::primitive::u64, - (), - >, - ::subxt::Error, - > { - let entry = Account(_0, _1); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn approvals( - &self, - _0: ::core::primitive::u32, - _1: ::subxt::sp_core::crypto::AccountId32, - _2: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_assets::types::Approval< - ::core::primitive::u64, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Approvals(_0, _1, _2); - self.client.storage().fetch(&entry, hash).await - } - pub async fn approvals_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Approvals>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn metadata( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_assets::types::AssetMetadata< - ::core::primitive::u128, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - >, - ::subxt::Error, - > { - let entry = Metadata(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn metadata_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Metadata>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod mmr { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct RootHash; - impl ::subxt::StorageEntry for RootHash { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "RootHash"; - type Value = ::subxt::sp_core::H256; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct NumberOfLeaves; - impl ::subxt::StorageEntry for NumberOfLeaves { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "NumberOfLeaves"; - type Value = ::core::primitive::u64; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Nodes(pub ::core::primitive::u64); - impl ::subxt::StorageEntry for Nodes { - const PALLET: &'static str = "Mmr"; - const STORAGE: &'static str = "Nodes"; - type Value = ::subxt::sp_core::H256; - 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 root_hash( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::sp_core::H256, ::subxt::Error> - { - let entry = RootHash; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn number_of_leaves( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::Error> - { - let entry = NumberOfLeaves; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn nodes( - &self, - _0: ::core::primitive::u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::H256>, - ::subxt::Error, - > { - let entry = Nodes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn nodes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Nodes>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod lottery { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BuyTicket { - pub call: runtime_types::node_runtime::Call, - } - impl ::subxt::Call for BuyTicket { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "buy_ticket"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetCalls { - pub calls: ::std::vec::Vec, - } - impl ::subxt::Call for SetCalls { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "set_calls"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct StartLottery { - pub price: ::core::primitive::u128, - pub length: ::core::primitive::u32, - pub delay: ::core::primitive::u32, - pub repeat: ::core::primitive::bool, - } - impl ::subxt::Call for StartLottery { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "start_lottery"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct StopRepeat {} - impl ::subxt::Call for StopRepeat { - const PALLET: &'static str = "Lottery"; - const FUNCTION: &'static str = "stop_repeat"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn buy_ticket( - &self, - call: runtime_types::node_runtime::Call, - ) -> ::subxt::SubmittableExtrinsic { - let call = BuyTicket { call }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_calls( - &self, - calls: ::std::vec::Vec, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetCalls { calls }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn start_lottery( - &self, - price: ::core::primitive::u128, - length: ::core::primitive::u32, - delay: ::core::primitive::u32, - repeat: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = StartLottery { - price, - length, - delay, - repeat, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn stop_repeat( - &self, - ) -> ::subxt::SubmittableExtrinsic { - let call = StopRepeat {}; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_lottery::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct LotteryStarted {} - impl ::subxt::Event for LotteryStarted { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "LotteryStarted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CallsUpdated {} - impl ::subxt::Event for CallsUpdated { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "CallsUpdated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Winner( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for Winner { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "Winner"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TicketBought( - pub ::subxt::sp_core::crypto::AccountId32, - pub (::core::primitive::u8, ::core::primitive::u8), - ); - impl ::subxt::Event for TicketBought { - const PALLET: &'static str = "Lottery"; - const EVENT: &'static str = "TicketBought"; - } - } - pub mod storage { - use super::runtime_types; - pub struct LotteryIndex; - impl ::subxt::StorageEntry for LotteryIndex { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "LotteryIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Lottery; - impl ::subxt::StorageEntry for Lottery { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "Lottery"; - type Value = runtime_types::pallet_lottery::LotteryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Participants(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Participants { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "Participants"; - type Value = ( - ::core::primitive::u32, - ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct TicketsCount; - impl ::subxt::StorageEntry for TicketsCount { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "TicketsCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Tickets(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Tickets { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "Tickets"; - 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 CallIndices; - impl ::subxt::StorageEntry for CallIndices { - const PALLET: &'static str = "Lottery"; - const STORAGE: &'static str = "CallIndices"; - type Value = - ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>; - 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 lottery_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = LotteryIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn lottery( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_lottery::LotteryConfig< - ::core::primitive::u32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Lottery; - self.client.storage().fetch(&entry, hash).await - } - pub async fn participants( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ( - ::core::primitive::u32, - ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>, - ), - ::subxt::Error, - > { - let entry = Participants(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn participants_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Participants>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn tickets_count( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = TicketsCount; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn tickets( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::subxt::sp_core::crypto::AccountId32>, - ::subxt::Error, - > { - let entry = Tickets(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn tickets_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Tickets>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn call_indices( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u8, ::core::primitive::u8)>, - ::subxt::Error, - > { - let entry = CallIndices; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod gilt { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PlaceBid { - #[codec(compact)] - pub amount: ::core::primitive::u128, - pub duration: ::core::primitive::u32, - } - impl ::subxt::Call for PlaceBid { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "place_bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RetractBid { - #[codec(compact)] - pub amount: ::core::primitive::u128, - pub duration: ::core::primitive::u32, - } - impl ::subxt::Call for RetractBid { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "retract_bid"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetTarget { - #[codec(compact)] - pub target: ::subxt::sp_arithmetic::per_things::Perquintill, - } - impl ::subxt::Call for SetTarget { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "set_target"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thaw { - #[codec(compact)] - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Thaw { - const PALLET: &'static str = "Gilt"; - const FUNCTION: &'static str = "thaw"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn place_bid( - &self, - amount: ::core::primitive::u128, - duration: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = PlaceBid { amount, duration }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn retract_bid( - &self, - amount: ::core::primitive::u128, - duration: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = RetractBid { amount, duration }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_target( - &self, - target: ::subxt::sp_arithmetic::per_things::Perquintill, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetTarget { target }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw( - &self, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Thaw { index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_gilt::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BidPlaced( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for BidPlaced { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "BidPlaced"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BidRetracted( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for BidRetracted { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "BidRetracted"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct GiltIssued( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for GiltIssued { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "GiltIssued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct GiltThawed( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); - impl ::subxt::Event for GiltThawed { - const PALLET: &'static str = "Gilt"; - const EVENT: &'static str = "GiltThawed"; - } - } - pub mod storage { - use super::runtime_types; - pub struct QueueTotals; - impl ::subxt::StorageEntry for QueueTotals { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "QueueTotals"; - type Value = - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Queues(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Queues { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "Queues"; - type Value = ::std::vec::Vec< - runtime_types::pallet_gilt::pallet::GiltBid< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ActiveTotal; - impl ::subxt::StorageEntry for ActiveTotal { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "ActiveTotal"; - type Value = runtime_types::pallet_gilt::pallet::ActiveGiltsTotal< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Active(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Active { - const PALLET: &'static str = "Gilt"; - const STORAGE: &'static str = "Active"; - type Value = runtime_types::pallet_gilt::pallet::ActiveGilt< - ::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::Blake2_128Concat, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn queue_totals( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u128)>, - ::subxt::Error, - > { - let entry = QueueTotals; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queues( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_gilt::pallet::GiltBid< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - >, - >, - ::subxt::Error, - > { - let entry = Queues(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn queues_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Queues>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn active_total( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_gilt::pallet::ActiveGiltsTotal< - ::core::primitive::u128, - >, - ::subxt::Error, - > { - let entry = ActiveTotal; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn active( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_gilt::pallet::ActiveGilt< - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ::subxt::Error, - > { - let entry = Active(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn active_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Active>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - } - } - } - pub mod uniques { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Create { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for Create { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreate { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub free_holding: ::core::primitive::bool, - } - impl ::subxt::Call for ForceCreate { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "force_create"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroy { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub witness: runtime_types::pallet_uniques::types::DestroyWitness, - } - impl ::subxt::Call for Destroy { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "destroy"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Mint { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for Mint { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "mint"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burn { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - pub check_owner: ::core::option::Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - } - impl ::subxt::Call for Burn { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "burn"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transfer { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - pub dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for Transfer { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Redeposit { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub instances: ::std::vec::Vec<::core::primitive::u32>, - } - impl ::subxt::Call for Redeposit { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "redeposit"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Freeze { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - } - impl ::subxt::Call for Freeze { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "freeze"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thaw { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - } - impl ::subxt::Call for Thaw { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "thaw"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct FreezeClass { - #[codec(compact)] - pub class: ::core::primitive::u32, - } - impl ::subxt::Call for FreezeClass { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "freeze_class"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ThawClass { - #[codec(compact)] - pub class: ::core::primitive::u32, - } - impl ::subxt::Call for ThawClass { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "thaw_class"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransferOwnership { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for TransferOwnership { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "transfer_ownership"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetTeam { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for SetTeam { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_team"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApproveTransfer { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - pub delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - } - impl ::subxt::Call for ApproveTransfer { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "approve_transfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CancelApproval { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - pub maybe_check_delegate: ::core::option::Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - } - impl ::subxt::Call for CancelApproval { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "cancel_approval"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceAssetStatus { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - pub free_holding: ::core::primitive::bool, - pub is_frozen: ::core::primitive::bool, - } - impl ::subxt::Call for ForceAssetStatus { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "force_asset_status"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetAttribute { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub maybe_instance: ::core::option::Option<::core::primitive::u32>, - pub key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub value: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - } - impl ::subxt::Call for SetAttribute { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_attribute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearAttribute { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub maybe_instance: ::core::option::Option<::core::primitive::u32>, - pub key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - } - impl ::subxt::Call for ClearAttribute { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "clear_attribute"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetMetadata { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - pub data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub is_frozen: ::core::primitive::bool, - } - impl ::subxt::Call for SetMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearMetadata { - #[codec(compact)] - pub class: ::core::primitive::u32, - #[codec(compact)] - pub instance: ::core::primitive::u32, - } - impl ::subxt::Call for ClearMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "clear_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SetClassMetadata { - #[codec(compact)] - pub class: ::core::primitive::u32, - pub data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub is_frozen: ::core::primitive::bool, - } - impl ::subxt::Call for SetClassMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "set_class_metadata"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClearClassMetadata { - #[codec(compact)] - pub class: ::core::primitive::u32, - } - impl ::subxt::Call for ClearClassMetadata { - const PALLET: &'static str = "Uniques"; - const FUNCTION: &'static str = "clear_class_metadata"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn create( - &self, - class: ::core::primitive::u32, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Create { class, admin }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_create( - &self, - class: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - free_holding: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceCreate { - class, - owner, - free_holding, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn destroy( - &self, - class: ::core::primitive::u32, - witness: runtime_types::pallet_uniques::types::DestroyWitness, - ) -> ::subxt::SubmittableExtrinsic { - let call = Destroy { class, witness }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn mint( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Mint { - class, - instance, - owner, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn burn( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - check_owner: ::core::option::Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Burn { - class, - instance, - check_owner, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = Transfer { - class, - instance, - dest, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn redeposit( - &self, - class: ::core::primitive::u32, - instances: ::std::vec::Vec<::core::primitive::u32>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Redeposit { class, instances }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Freeze { class, instance }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Thaw { class, instance }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn freeze_class( - &self, - class: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = FreezeClass { class }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn thaw_class( - &self, - class: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ThawClass { class }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn transfer_ownership( - &self, - class: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = TransferOwnership { class, owner }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_team( - &self, - class: ::core::primitive::u32, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetTeam { - class, - issuer, - admin, - freezer, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn approve_transfer( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ApproveTransfer { - class, - instance, - delegate, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn cancel_approval( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - maybe_check_delegate: ::core::option::Option< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = CancelApproval { - class, - instance, - maybe_check_delegate, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn force_asset_status( - &self, - class: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - free_holding: ::core::primitive::bool, - is_frozen: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = ForceAssetStatus { - class, - owner, - issuer, - admin, - freezer, - free_holding, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_attribute( - &self, - class: ::core::primitive::u32, - maybe_instance: ::core::option::Option<::core::primitive::u32>, - key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - value: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetAttribute { - class, - maybe_instance, - key, - value, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_attribute( - &self, - class: ::core::primitive::u32, - maybe_instance: ::core::option::Option<::core::primitive::u32>, - key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearAttribute { - class, - maybe_instance, - key, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_metadata( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - is_frozen: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetMetadata { - class, - instance, - data, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_metadata( - &self, - class: ::core::primitive::u32, - instance: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = ClearMetadata { class, instance }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn set_class_metadata( - &self, - class: ::core::primitive::u32, - data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - is_frozen: ::core::primitive::bool, - ) -> ::subxt::SubmittableExtrinsic { - let call = SetClassMetadata { - class, - data, - is_frozen, - }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn clear_class_metadata( - &self, - class: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic - { - let call = ClearClassMetadata { class }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_uniques::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Created( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Created { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Created"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ForceCreated( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ForceCreated { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ForceCreated"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Destroyed(pub ::core::primitive::u32); - impl ::subxt::Event for Destroyed { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Destroyed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Issued( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Issued { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Issued"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Transferred( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Transferred { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Transferred"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Burned( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for Burned { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Burned"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Frozen(pub ::core::primitive::u32, pub ::core::primitive::u32); - impl ::subxt::Event for Frozen { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Frozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Thawed(pub ::core::primitive::u32, pub ::core::primitive::u32); - impl ::subxt::Event for Thawed { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Thawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassFrozen(pub ::core::primitive::u32); - impl ::subxt::Event for ClassFrozen { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassFrozen"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassThawed(pub ::core::primitive::u32); - impl ::subxt::Event for ClassThawed { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassThawed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OwnerChanged( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for OwnerChanged { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "OwnerChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TeamChanged( - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for TeamChanged { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "TeamChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovedTransfer( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ApprovedTransfer { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ApprovedTransfer"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ApprovalCancelled( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub ::subxt::sp_core::crypto::AccountId32, - pub ::subxt::sp_core::crypto::AccountId32, - ); - impl ::subxt::Event for ApprovalCancelled { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ApprovalCancelled"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetStatusChanged(pub ::core::primitive::u32); - impl ::subxt::Event for AssetStatusChanged { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "AssetStatusChanged"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassMetadataSet( - pub ::core::primitive::u32, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub ::core::primitive::bool, - ); - impl ::subxt::Event for ClassMetadataSet { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassMetadataSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassMetadataCleared(pub ::core::primitive::u32); - impl ::subxt::Event for ClassMetadataCleared { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "ClassMetadataCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataSet( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub ::core::primitive::bool, - ); - impl ::subxt::Event for MetadataSet { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "MetadataSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct MetadataCleared( - pub ::core::primitive::u32, - pub ::core::primitive::u32, - ); - impl ::subxt::Event for MetadataCleared { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "MetadataCleared"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Redeposited( - pub ::core::primitive::u32, - pub ::std::vec::Vec<::core::primitive::u32>, - ); - impl ::subxt::Event for Redeposited { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "Redeposited"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AttributeSet( - pub ::core::primitive::u32, - pub ::core::option::Option<::core::primitive::u32>, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ); - impl ::subxt::Event for AttributeSet { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "AttributeSet"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AttributeCleared( - pub ::core::primitive::u32, - pub ::core::option::Option<::core::primitive::u32>, - pub runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ); - impl ::subxt::Event for AttributeCleared { - const PALLET: &'static str = "Uniques"; - const EVENT: &'static str = "AttributeCleared"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Class(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Class { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Class"; - type Value = runtime_types::pallet_uniques::types::ClassDetails< - ::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 Account( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ::core::primitive::u32, - ); - impl ::subxt::StorageEntry for Account { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Account"; - type Value = (); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.2, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Asset(::core::primitive::u32, ::core::primitive::u32); - impl ::subxt::StorageEntry for Asset { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Asset"; - type Value = runtime_types::pallet_uniques::types::InstanceDetails< - ::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, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct ClassMetadataOf(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for ClassMetadataOf { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "ClassMetadataOf"; - type Value = runtime_types::pallet_uniques::types::ClassMetadata< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct InstanceMetadataOf(::core::primitive::u32, ::core::primitive::u32); - impl ::subxt::StorageEntry for InstanceMetadataOf { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "InstanceMetadataOf"; - type Value = runtime_types::pallet_uniques::types::InstanceMetadata< - ::core::primitive::u128, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct Attribute( - ::core::primitive::u32, - ::core::option::Option<::core::primitive::u32>, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ); - impl ::subxt::StorageEntry for Attribute { - const PALLET: &'static str = "Uniques"; - const STORAGE: &'static str = "Attribute"; - type Value = ( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::u128, - ); - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![ - ::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.1, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ::subxt::StorageMapKey::new( - &self.2, - ::subxt::StorageHasher::Blake2_128Concat, - ), - ]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn class( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::ClassDetails< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Class(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn class_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Class>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn account( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - _1: ::core::primitive::u32, - _2: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::Error> - { - let entry = Account(_0, _1, _2); - self.client.storage().fetch(&entry, hash).await - } - pub async fn account_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Account>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn asset( - &self, - _0: ::core::primitive::u32, - _1: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::InstanceDetails< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = Asset(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn asset_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::subxt::KeyIter<'a, T, Asset>, ::subxt::Error> - { - self.client.storage().iter(hash).await - } - pub async fn class_metadata_of( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::ClassMetadata< - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = ClassMetadataOf(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn class_metadata_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ClassMetadataOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn instance_metadata_of( - &self, - _0: ::core::primitive::u32, - _1: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_uniques::types::InstanceMetadata< - ::core::primitive::u128, - >, - >, - ::subxt::Error, - > { - let entry = InstanceMetadataOf(_0, _1); - self.client.storage().fetch(&entry, hash).await - } - pub async fn instance_metadata_of_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, InstanceMetadataOf>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn attribute( - &self, - _0: ::core::primitive::u32, - _1: ::core::option::Option<::core::primitive::u32>, - _2: runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<( - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::u128, - )>, - ::subxt::Error, - > { - let entry = Attribute(_0, _1, _2); - self.client.storage().fetch(&entry, hash).await - } - pub async fn attribute_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Attribute>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod transaction_storage { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Store { - pub data: ::std::vec::Vec<::core::primitive::u8>, - } - impl ::subxt::Call for Store { - const PALLET: &'static str = "TransactionStorage"; - const FUNCTION: &'static str = "store"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Renew { - pub block: ::core::primitive::u32, - pub index: ::core::primitive::u32, - } - impl ::subxt::Call for Renew { - const PALLET: &'static str = "TransactionStorage"; - const FUNCTION: &'static str = "renew"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct CheckProof { - pub proof: - runtime_types::sp_transaction_storage_proof::TransactionStorageProof, - } - impl ::subxt::Call for CheckProof { - const PALLET: &'static str = "TransactionStorage"; - const FUNCTION: &'static str = "check_proof"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn store( - &self, - data: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::SubmittableExtrinsic { - let call = Store { data }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn renew( - &self, - block: ::core::primitive::u32, - index: ::core::primitive::u32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Renew { block, index }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - pub fn check_proof( - &self, - proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof, - ) -> ::subxt::SubmittableExtrinsic { - let call = CheckProof { proof }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_transaction_storage::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Stored(pub ::core::primitive::u32); - impl ::subxt::Event for Stored { - const PALLET: &'static str = "TransactionStorage"; - const EVENT: &'static str = "Stored"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Renewed(pub ::core::primitive::u32); - impl ::subxt::Event for Renewed { - const PALLET: &'static str = "TransactionStorage"; - const EVENT: &'static str = "Renewed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProofChecked {} - impl ::subxt::Event for ProofChecked { - const PALLET: &'static str = "TransactionStorage"; - const EVENT: &'static str = "ProofChecked"; - } - } - pub mod storage { - use super::runtime_types; - pub struct Transactions(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for Transactions { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "Transactions"; - type Value = ::std::vec::Vec< - runtime_types::pallet_transaction_storage::TransactionInfo, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ChunkCount(pub ::core::primitive::u32); - impl ::subxt::StorageEntry for ChunkCount { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "ChunkCount"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Blake2_128Concat, - )]) - } - } - pub struct ByteFee; - impl ::subxt::StorageEntry for ByteFee { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "ByteFee"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EntryFee; - impl ::subxt::StorageEntry for EntryFee { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "EntryFee"; - type Value = ::core::primitive::u128; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxTransactionSize; - impl ::subxt::StorageEntry for MaxTransactionSize { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "MaxTransactionSize"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct MaxBlockTransactions; - impl ::subxt::StorageEntry for MaxBlockTransactions { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "MaxBlockTransactions"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StoragePeriod; - impl ::subxt::StorageEntry for StoragePeriod { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "StoragePeriod"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct BlockTransactions; - impl ::subxt::StorageEntry for BlockTransactions { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "BlockTransactions"; - type Value = ::std::vec::Vec< - runtime_types::pallet_transaction_storage::TransactionInfo, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct ProofChecked; - impl ::subxt::StorageEntry for ProofChecked { - const PALLET: &'static str = "TransactionStorage"; - const STORAGE: &'static str = "ProofChecked"; - type Value = ::core::primitive::bool; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn transactions( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option< - ::std::vec::Vec< - runtime_types::pallet_transaction_storage::TransactionInfo, - >, - >, - ::subxt::Error, - > { - let entry = Transactions(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn transactions_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Transactions>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn chunk_count( - &self, - _0: ::core::primitive::u32, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = ChunkCount(_0); - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn chunk_count_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ChunkCount>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn byte_fee( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::Error, - > { - let entry = ByteFee; - self.client.storage().fetch(&entry, hash).await - } - pub async fn entry_fee( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u128>, - ::subxt::Error, - > { - let entry = EntryFee; - self.client.storage().fetch(&entry, hash).await - } - pub async fn max_transaction_size( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = MaxTransactionSize; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn max_block_transactions( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = MaxBlockTransactions; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn storage_period( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = StoragePeriod; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn block_transactions( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::pallet_transaction_storage::TransactionInfo, - >, - ::subxt::Error, - > { - let entry = BlockTransactions; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn proof_checked( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::bool, ::subxt::Error> - { - let entry = ProofChecked; - self.client.storage().fetch_or_default(&entry, hash).await - } - } - } - } - pub mod bags_list { - use super::runtime_types; - pub mod calls { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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"; - } - pub struct TransactionApi< - 'a, - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - > { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub fn rebag( - &self, - dislocated: ::subxt::sp_core::crypto::AccountId32, - ) -> ::subxt::SubmittableExtrinsic { - let call = Rebag { dislocated }; - ::subxt::SubmittableExtrinsic::new(self.client, call) - } - } - } - pub type Event = runtime_types::pallet_bags_list::pallet::Event; - pub mod events { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Rebagged( - pub ::subxt::sp_core::crypto::AccountId32, - pub ::core::primitive::u64, - pub ::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 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 ListNodes(pub ::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 ListBags(pub ::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 } - } - pub async fn counter_for_list_nodes( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::Error> - { - let entry = CounterForListNodes; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn list_nodes( - &self, - _0: ::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ListNodes(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn list_nodes_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ListNodes>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - pub async fn list_bags( - &self, - _0: ::core::primitive::u64, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option, - ::subxt::Error, - > { - let entry = ListBags(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn list_bags_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, ListBags>, - ::subxt::Error, - > { - self.client.storage().iter(hash).await - } - } - } - } - pub mod runtime_types { - use super::runtime_types; - pub mod finality_grandpa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Precommit<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Prevote<_0, _1> { - pub target_hash: _0, - pub target_number: _1, - } - } - pub mod frame_support { - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub mod bounded_btree_map { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct BoundedBTreeMap<_0, _1>( - pub ::std::collections::BTreeMap<_0, _1>, - ); - } - pub mod bounded_vec { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - 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, - )] - 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, - )] - pub struct WrapperKeepOpaque<_0>(::core::primitive::u32, pub _0); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct WrapperOpaque<_0>(::core::primitive::u32, pub _0); - } - pub mod tokens { - use super::runtime_types; - pub mod misc { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum BalanceStatus { - Free, - Reserved, - } - } - } - } - pub mod weights { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum DispatchClass { - Normal, - Operational, - Mandatory, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Pays { - Yes, - No, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PerDispatchClass<_0> { - pub normal: _0, - pub operational: _0, - pub mandatory: _0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RuntimeDbWeight { - pub read: ::core::primitive::u64, - pub write: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct WeightToFeeCoefficient<_0> { - pub coeff_integer: _0, - pub coeff_frac: ::subxt::sp_arithmetic::per_things::Perbill, - pub negative: ::core::primitive::bool, - pub degree: ::core::primitive::u8, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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, - )] - pub struct CheckGenesis {} - } - pub mod check_mortality { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckMortality( - pub runtime_types::sp_runtime::generic::era::Era, - ); - } - pub mod check_nonce { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckNonce(pub ::core::primitive::u32); - } - pub mod check_spec_version { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckSpecVersion {} - } - pub mod check_tx_version { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckTxVersion {} - } - pub mod check_weight { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct CheckWeight {} - } - } - pub mod limits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BlockLength { - pub max: runtime_types::frame_support::weights::PerDispatchClass< - ::core::primitive::u32, - >, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum Call { - fill_block { ratio : :: subxt :: sp_arithmetic :: per_things :: Perbill , } , remark { remark : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , set_heap_pages { pages : :: core :: primitive :: u64 , } , set_code { code : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , set_code_without_checks { code : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , set_changes_trie_config { changes_trie_config : :: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > , } , set_storage { items : :: std :: vec :: Vec < (:: std :: vec :: Vec < :: core :: primitive :: u8 > , :: std :: vec :: Vec < :: core :: primitive :: u8 > ,) > , } , kill_storage { keys : :: std :: vec :: Vec < :: std :: vec :: Vec < :: core :: primitive :: u8 > > , } , kill_prefix { prefix : :: std :: vec :: Vec < :: core :: primitive :: u8 > , subkeys : :: core :: primitive :: u32 , } , remark_with_event { remark : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidSpecName, - SpecVersionNeedsToIncrease, - FailedToExtractRuntimeVersion, - NonDefaultComposite, - NonZeroRefCount, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), - ExtrinsicFailed( - runtime_types::sp_runtime::DispatchError, - runtime_types::frame_support::weights::DispatchInfo, - ), - CodeUpdated, - NewAccount(::subxt::sp_core::crypto::AccountId32), - KilledAccount(::subxt::sp_core::crypto::AccountId32), - Remarked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub struct LastRuntimeUpgradeInfo { - #[codec(compact)] - pub spec_version: ::core::primitive::u32, - pub spec_name: ::std::string::String, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Phase { - ApplyExtrinsic(::core::primitive::u32), - Finalization, - Initialization, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RawOrigin<_0> { - Root, - Signed(_0), - None, - } - } - pub mod node_runtime { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - System(runtime_types::frame_system::pallet::Call), - Utility(runtime_types::pallet_utility::pallet::Call), - Babe(runtime_types::pallet_babe::pallet::Call), - Timestamp(runtime_types::pallet_timestamp::pallet::Call), - Authorship(runtime_types::pallet_authorship::pallet::Call), - Indices(runtime_types::pallet_indices::pallet::Call), - Balances(runtime_types::pallet_balances::pallet::Call), - ElectionProviderMultiPhase( - runtime_types::pallet_election_provider_multi_phase::pallet::Call, - ), - Staking(runtime_types::pallet_staking::pallet::pallet::Call), - Session(runtime_types::pallet_session::pallet::Call), - Democracy(runtime_types::pallet_democracy::pallet::Call), - Council(runtime_types::pallet_collective::pallet::Call), - TechnicalCommittee(runtime_types::pallet_collective::pallet::Call), - Elections(runtime_types::pallet_elections_phragmen::pallet::Call), - TechnicalMembership(runtime_types::pallet_membership::pallet::Call), - Grandpa(runtime_types::pallet_grandpa::pallet::Call), - Treasury(runtime_types::pallet_treasury::pallet::Call), - Contracts(runtime_types::pallet_contracts::pallet::Call), - Sudo(runtime_types::pallet_sudo::pallet::Call), - ImOnline(runtime_types::pallet_im_online::pallet::Call), - Identity(runtime_types::pallet_identity::pallet::Call), - Society(runtime_types::pallet_society::pallet::Call), - Recovery(runtime_types::pallet_recovery::pallet::Call), - Vesting(runtime_types::pallet_vesting::pallet::Call), - Scheduler(runtime_types::pallet_scheduler::pallet::Call), - Proxy(runtime_types::pallet_proxy::pallet::Call), - Multisig(runtime_types::pallet_multisig::pallet::Call), - Bounties(runtime_types::pallet_bounties::pallet::Call), - Tips(runtime_types::pallet_tips::pallet::Call), - Assets(runtime_types::pallet_assets::pallet::Call), - Lottery(runtime_types::pallet_lottery::pallet::Call), - Gilt(runtime_types::pallet_gilt::pallet::Call), - Uniques(runtime_types::pallet_uniques::pallet::Call), - TransactionStorage( - runtime_types::pallet_transaction_storage::pallet::Call, - ), - BagsList(runtime_types::pallet_bags_list::pallet::Call), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - System(runtime_types::frame_system::pallet::Event), - Utility(runtime_types::pallet_utility::pallet::Event), - Indices(runtime_types::pallet_indices::pallet::Event), - Balances(runtime_types::pallet_balances::pallet::Event), - ElectionProviderMultiPhase( - runtime_types::pallet_election_provider_multi_phase::pallet::Event, - ), - Staking(runtime_types::pallet_staking::pallet::pallet::Event), - Session(runtime_types::pallet_session::pallet::Event), - Democracy(runtime_types::pallet_democracy::pallet::Event), - Council(runtime_types::pallet_collective::pallet::Event), - TechnicalCommittee(runtime_types::pallet_collective::pallet::Event), - Elections(runtime_types::pallet_elections_phragmen::pallet::Event), - TechnicalMembership(runtime_types::pallet_membership::pallet::Event), - Grandpa(runtime_types::pallet_grandpa::pallet::Event), - Treasury(runtime_types::pallet_treasury::pallet::Event), - Contracts(runtime_types::pallet_contracts::pallet::Event), - Sudo(runtime_types::pallet_sudo::pallet::Event), - ImOnline(runtime_types::pallet_im_online::pallet::Event), - Offences(runtime_types::pallet_offences::pallet::Event), - Identity(runtime_types::pallet_identity::pallet::Event), - Society(runtime_types::pallet_society::pallet::Event), - Recovery(runtime_types::pallet_recovery::pallet::Event), - Vesting(runtime_types::pallet_vesting::pallet::Event), - Scheduler(runtime_types::pallet_scheduler::pallet::Event), - Proxy(runtime_types::pallet_proxy::pallet::Event), - Multisig(runtime_types::pallet_multisig::pallet::Event), - Bounties(runtime_types::pallet_bounties::pallet::Event), - Tips(runtime_types::pallet_tips::pallet::Event), - Assets(runtime_types::pallet_assets::pallet::Event), - Lottery(runtime_types::pallet_lottery::pallet::Event), - Gilt(runtime_types::pallet_gilt::pallet::Event), - Uniques(runtime_types::pallet_uniques::pallet::Event), - TransactionStorage( - runtime_types::pallet_transaction_storage::pallet::Event, - ), - BagsList(runtime_types::pallet_bags_list::pallet::Event), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct NposSolution16 { - votes1: ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u16)>, - votes2: ::std::vec::Vec<( - ::core::primitive::u32, - ( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ), - ::core::primitive::u16, - )>, - votes3: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 2usize], - ::core::primitive::u16, - )>, - votes4: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 3usize], - ::core::primitive::u16, - )>, - votes5: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 4usize], - ::core::primitive::u16, - )>, - votes6: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 5usize], - ::core::primitive::u16, - )>, - votes7: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 6usize], - ::core::primitive::u16, - )>, - votes8: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 7usize], - ::core::primitive::u16, - )>, - votes9: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 8usize], - ::core::primitive::u16, - )>, - votes10: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 9usize], - ::core::primitive::u16, - )>, - votes11: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 10usize], - ::core::primitive::u16, - )>, - votes12: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 11usize], - ::core::primitive::u16, - )>, - votes13: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 12usize], - ::core::primitive::u16, - )>, - votes14: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 13usize], - ::core::primitive::u16, - )>, - votes15: ::std::vec::Vec<( - ::core::primitive::u32, - [( - ::core::primitive::u16, - runtime_types::sp_arithmetic::per_things::PerU16, - ); 14usize], - ::core::primitive::u16, - )>, - 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)] - pub enum OriginCaller { - system( - runtime_types::frame_system::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - Council( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - TechnicalCommittee( - runtime_types::pallet_collective::RawOrigin< - ::subxt::sp_core::crypto::AccountId32, - >, - ), - Void(runtime_types::sp_core::Void), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum ProxyType { - Any, - NonTransfer, - Governance, - Staking, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Runtime {} - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 authority_discovery: - runtime_types::sp_authority_discovery::app::Public, - } - } - pub mod pallet_assets { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - create { - #[codec(compact)] - id: ::core::primitive::u32, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - min_balance: ::core::primitive::u64, - }, - force_create { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - is_sufficient: ::core::primitive::bool, - #[codec(compact)] - min_balance: ::core::primitive::u64, - }, - destroy { - #[codec(compact)] - id: ::core::primitive::u32, - witness: runtime_types::pallet_assets::types::DestroyWitness, - }, - mint { - #[codec(compact)] - id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - burn { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - transfer { - #[codec(compact)] - id: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - transfer_keep_alive { - #[codec(compact)] - id: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - force_transfer { - #[codec(compact)] - id: ::core::primitive::u32, - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - freeze { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - thaw { - #[codec(compact)] - id: ::core::primitive::u32, - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - freeze_asset { - #[codec(compact)] - id: ::core::primitive::u32, - }, - thaw_asset { - #[codec(compact)] - id: ::core::primitive::u32, - }, - transfer_ownership { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - set_team { - #[codec(compact)] - id: ::core::primitive::u32, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - set_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - name: ::std::vec::Vec<::core::primitive::u8>, - symbol: ::std::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - }, - clear_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - }, - force_set_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - name: ::std::vec::Vec<::core::primitive::u8>, - symbol: ::std::vec::Vec<::core::primitive::u8>, - decimals: ::core::primitive::u8, - is_frozen: ::core::primitive::bool, - }, - force_clear_metadata { - #[codec(compact)] - id: ::core::primitive::u32, - }, - force_asset_status { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - issuer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - admin: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - freezer: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - min_balance: ::core::primitive::u64, - is_sufficient: ::core::primitive::bool, - is_frozen: ::core::primitive::bool, - }, - approve_transfer { - #[codec(compact)] - id: ::core::primitive::u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - cancel_approval { - #[codec(compact)] - id: ::core::primitive::u32, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - force_cancel_approval { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - delegate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - transfer_approved { - #[codec(compact)] - id: ::core::primitive::u32, - owner: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - destination: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - amount: ::core::primitive::u64, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - BalanceLow, - BalanceZero, - NoPermission, - Unknown, - Frozen, - InUse, - BadWitness, - MinBalanceZero, - NoProvider, - BadMetadata, - Unapproved, - WouldDie, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Created( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - Issued( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ), - Transferred( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ), - Burned( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ), - TeamChanged( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - OwnerChanged( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - Frozen( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - Thawed( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - AssetFrozen(::core::primitive::u32), - AssetThawed(::core::primitive::u32), - Destroyed(::core::primitive::u32), - ForceCreated( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - MetadataSet( - ::core::primitive::u32, - ::std::vec::Vec<::core::primitive::u8>, - ::std::vec::Vec<::core::primitive::u8>, - ::core::primitive::u8, - ::core::primitive::bool, - ), - MetadataCleared(::core::primitive::u32), - ApprovedTransfer( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ), - ApprovalCancelled( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - TransferredApproved( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ), - AssetStatusChanged(::core::primitive::u32), - } - } - pub mod types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Approval<_0, _1> { - pub amount: _0, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetBalance<_0, _1> { - pub balance: _0, - pub is_frozen: ::core::primitive::bool, - pub sufficient: ::core::primitive::bool, - pub extra: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetDetails<_0, _1, _2> { - pub owner: _1, - pub issuer: _1, - pub admin: _1, - pub freezer: _1, - pub supply: _0, - pub deposit: _2, - pub min_balance: _0, - pub is_sufficient: ::core::primitive::bool, - pub accounts: ::core::primitive::u32, - pub sufficients: ::core::primitive::u32, - pub approvals: ::core::primitive::u32, - pub is_frozen: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AssetMetadata<_0, _1> { - pub deposit: _0, - pub name: _1, - pub symbol: _1, - pub decimals: ::core::primitive::u8, - pub is_frozen: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DestroyWitness { - #[codec(compact)] - pub accounts: ::core::primitive::u32, - #[codec(compact)] - pub sufficients: ::core::primitive::u32, - #[codec(compact)] - pub approvals: ::core::primitive::u32, - } - } - } - pub mod pallet_authorship { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - 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)] - pub enum Error { - InvalidUncleParent, - UnclesAlreadySet, - TooManyUncles, - GenesisUncle, - TooHighUncle, - UncleAlreadyIncluded, - OldUncle, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum UncleEntryItem<_0, _1, _2> { - InclusionHeight(_0), - 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)] - pub enum Call { - 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 , } , 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 , } , plan_config_change { config : runtime_types :: sp_consensus_babe :: digests :: NextConfigDescriptor , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidEquivocationProof, - InvalidKeyOwnershipProof, - DuplicateOffenceReport, - } - } - } - pub mod pallet_bags_list { - use super::runtime_types; - pub mod list { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum Call { - rebag { - dislocated: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Rebagged( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u64, - ::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)] - pub enum Call { - transfer { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - set_balance { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - new_free: ::core::primitive::u128, - #[codec(compact)] - new_reserved: ::core::primitive::u128, - }, - force_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - transfer_keep_alive { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - value: ::core::primitive::u128, - }, - transfer_all { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - keep_alive: ::core::primitive::bool, - }, - force_unreserve { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - amount: ::core::primitive::u128, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - VestingBalance, - LiquidityRestrictions, - InsufficientBalance, - ExistentialDeposit, - KeepAlive, - ExistingVestingSchedule, - DeadAccount, - TooManyReserves, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Endowed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - DustLost( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Transfer( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - BalanceSet( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u128, - ), - Reserved( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Unreserved( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - ReserveRepatriated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - runtime_types::frame_support::traits::tokens::misc::BalanceStatus, - ), - Deposit( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Withdraw( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Slashed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum Reasons { - Fee, - Misc, - All, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1_0_0, - V2_0_0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Call { - propose_bounty { - #[codec(compact)] - value: ::core::primitive::u128, - description: ::std::vec::Vec<::core::primitive::u8>, - }, - approve_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - propose_curator { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - curator: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - fee: ::core::primitive::u128, - }, - unassign_curator { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - accept_curator { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - award_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - claim_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - close_bounty { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - }, - extend_bounty_expiry { - #[codec(compact)] - bounty_id: ::core::primitive::u32, - remark: ::std::vec::Vec<::core::primitive::u8>, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InsufficientProposersBalance, - InvalidIndex, - ReasonTooBig, - UnexpectedStatus, - RequireCurator, - InvalidValue, - InvalidFee, - PendingPayout, - Premature, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - BountyProposed(::core::primitive::u32), - BountyRejected(::core::primitive::u32, ::core::primitive::u128), - BountyBecameActive(::core::primitive::u32), - BountyAwarded( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - BountyClaimed( - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ), - BountyCanceled(::core::primitive::u32), - BountyExtended(::core::primitive::u32), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum BountyStatus<_0, _1> { - Proposed, - Approved, - Funded, - CuratorProposed { - curator: _0, - }, - Active { - curator: _0, - update_due: _1, - }, - 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)] - pub enum Call { - 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, - }, - execute { - proposal: ::std::boxed::Box, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - propose { - #[codec(compact)] - threshold: ::core::primitive::u32, - proposal: ::std::boxed::Box, - #[codec(compact)] - length_bound: ::core::primitive::u32, - }, - vote { - proposal: ::subxt::sp_core::H256, - #[codec(compact)] - index: ::core::primitive::u32, - approve: ::core::primitive::bool, - }, - 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, - }, - disapprove_proposal { - proposal_hash: ::subxt::sp_core::H256, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotMember, - DuplicateProposal, - ProposalMissing, - WrongIndex, - DuplicateVote, - AlreadyInitialized, - TooEarly, - TooManyProposals, - WrongProposalWeight, - WrongProposalLength, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Proposed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - ), - Voted( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::bool, - ::core::primitive::u32, - ::core::primitive::u32, - ), - Approved(::subxt::sp_core::H256), - Disapproved(::subxt::sp_core::H256), - Executed( - ::subxt::sp_core::H256, - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - MemberExecuted( - ::subxt::sp_core::H256, - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - Closed( - ::subxt::sp_core::H256, - ::core::primitive::u32, - ::core::primitive::u32, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RawOrigin<_0> { - Members(::core::primitive::u32, ::core::primitive::u32), - Member(_0), - _Phantom, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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_contracts { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - call { - dest: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - value: ::core::primitive::u128, - #[codec(compact)] - gas_limit: ::core::primitive::u64, - data: ::std::vec::Vec<::core::primitive::u8>, - }, - instantiate_with_code { - #[codec(compact)] - endowment: ::core::primitive::u128, - #[codec(compact)] - gas_limit: ::core::primitive::u64, - code: ::std::vec::Vec<::core::primitive::u8>, - data: ::std::vec::Vec<::core::primitive::u8>, - salt: ::std::vec::Vec<::core::primitive::u8>, - }, - instantiate { - #[codec(compact)] - endowment: ::core::primitive::u128, - #[codec(compact)] - gas_limit: ::core::primitive::u64, - code_hash: ::subxt::sp_core::H256, - data: ::std::vec::Vec<::core::primitive::u8>, - salt: ::std::vec::Vec<::core::primitive::u8>, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidScheduleVersion, - OutOfGas, - OutputBufferTooSmall, - BelowSubsistenceThreshold, - NewContractNotFunded, - TransferFailed, - MaxCallDepthReached, - ContractNotFound, - CodeTooLarge, - CodeNotFound, - OutOfBounds, - DecodingFailed, - ContractTrapped, - ValueTooLarge, - TerminatedWhileReentrant, - InputForwarded, - RandomSubjectTooLong, - TooManyTopics, - DuplicateTopics, - NoChainExtension, - DeletionQueueFull, - StorageExhausted, - DuplicateContract, - TerminatedInConstructor, - DebugMessageInvalidUTF8, - ReentranceDenied, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Instantiated { - deployer: ::subxt::sp_core::crypto::AccountId32, - contract: ::subxt::sp_core::crypto::AccountId32, - }, - Terminated { - contract: ::subxt::sp_core::crypto::AccountId32, - beneficiary: ::subxt::sp_core::crypto::AccountId32, - }, - CodeStored { - code_hash: ::subxt::sp_core::H256, - }, - ScheduleUpdated { - version: ::core::primitive::u32, - }, - ContractEmitted { - contract: ::subxt::sp_core::crypto::AccountId32, - data: ::std::vec::Vec<::core::primitive::u8>, - }, - CodeRemoved { - code_hash: ::subxt::sp_core::H256, - }, - } - } - pub mod schedule { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct HostFnWeights { - pub caller: ::core::primitive::u64, - pub address: ::core::primitive::u64, - pub gas_left: ::core::primitive::u64, - pub balance: ::core::primitive::u64, - pub value_transferred: ::core::primitive::u64, - pub minimum_balance: ::core::primitive::u64, - pub contract_deposit: ::core::primitive::u64, - pub block_number: ::core::primitive::u64, - pub now: ::core::primitive::u64, - pub weight_to_fee: ::core::primitive::u64, - pub gas: ::core::primitive::u64, - pub input: ::core::primitive::u64, - pub input_per_byte: ::core::primitive::u64, - pub r#return: ::core::primitive::u64, - pub return_per_byte: ::core::primitive::u64, - pub terminate: ::core::primitive::u64, - pub random: ::core::primitive::u64, - pub deposit_event: ::core::primitive::u64, - pub deposit_event_per_topic: ::core::primitive::u64, - pub deposit_event_per_byte: ::core::primitive::u64, - pub debug_message: ::core::primitive::u64, - pub set_storage: ::core::primitive::u64, - pub set_storage_per_byte: ::core::primitive::u64, - pub clear_storage: ::core::primitive::u64, - pub get_storage: ::core::primitive::u64, - pub get_storage_per_byte: ::core::primitive::u64, - pub transfer: ::core::primitive::u64, - pub call: ::core::primitive::u64, - pub call_transfer_surcharge: ::core::primitive::u64, - pub call_per_input_byte: ::core::primitive::u64, - pub call_per_output_byte: ::core::primitive::u64, - pub instantiate: ::core::primitive::u64, - pub instantiate_per_input_byte: ::core::primitive::u64, - pub instantiate_per_output_byte: ::core::primitive::u64, - pub instantiate_per_salt_byte: ::core::primitive::u64, - pub hash_sha2_256: ::core::primitive::u64, - pub hash_sha2_256_per_byte: ::core::primitive::u64, - pub hash_keccak_256: ::core::primitive::u64, - pub hash_keccak_256_per_byte: ::core::primitive::u64, - pub hash_blake2_256: ::core::primitive::u64, - pub hash_blake2_256_per_byte: ::core::primitive::u64, - pub hash_blake2_128: ::core::primitive::u64, - pub hash_blake2_128_per_byte: ::core::primitive::u64, - pub ecdsa_recover: ::core::primitive::u64, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstructionWeights { - pub version: ::core::primitive::u32, - pub i64const: ::core::primitive::u32, - pub i64load: ::core::primitive::u32, - pub i64store: ::core::primitive::u32, - pub select: ::core::primitive::u32, - pub r#if: ::core::primitive::u32, - pub br: ::core::primitive::u32, - pub br_if: ::core::primitive::u32, - pub br_table: ::core::primitive::u32, - pub br_table_per_entry: ::core::primitive::u32, - pub call: ::core::primitive::u32, - pub call_indirect: ::core::primitive::u32, - pub call_indirect_per_param: ::core::primitive::u32, - pub local_get: ::core::primitive::u32, - pub local_set: ::core::primitive::u32, - pub local_tee: ::core::primitive::u32, - pub global_get: ::core::primitive::u32, - pub global_set: ::core::primitive::u32, - pub memory_current: ::core::primitive::u32, - pub memory_grow: ::core::primitive::u32, - pub i64clz: ::core::primitive::u32, - pub i64ctz: ::core::primitive::u32, - pub i64popcnt: ::core::primitive::u32, - pub i64eqz: ::core::primitive::u32, - pub i64extendsi32: ::core::primitive::u32, - pub i64extendui32: ::core::primitive::u32, - pub i32wrapi64: ::core::primitive::u32, - pub i64eq: ::core::primitive::u32, - pub i64ne: ::core::primitive::u32, - pub i64lts: ::core::primitive::u32, - pub i64ltu: ::core::primitive::u32, - pub i64gts: ::core::primitive::u32, - pub i64gtu: ::core::primitive::u32, - pub i64les: ::core::primitive::u32, - pub i64leu: ::core::primitive::u32, - pub i64ges: ::core::primitive::u32, - pub i64geu: ::core::primitive::u32, - pub i64add: ::core::primitive::u32, - pub i64sub: ::core::primitive::u32, - pub i64mul: ::core::primitive::u32, - pub i64divs: ::core::primitive::u32, - pub i64divu: ::core::primitive::u32, - pub i64rems: ::core::primitive::u32, - pub i64remu: ::core::primitive::u32, - pub i64and: ::core::primitive::u32, - pub i64or: ::core::primitive::u32, - pub i64xor: ::core::primitive::u32, - pub i64shl: ::core::primitive::u32, - pub i64shrs: ::core::primitive::u32, - pub i64shru: ::core::primitive::u32, - pub i64rotl: ::core::primitive::u32, - pub i64rotr: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Limits { - pub event_topics: ::core::primitive::u32, - pub stack_height: ::core::primitive::u32, - pub globals: ::core::primitive::u32, - pub parameters: ::core::primitive::u32, - pub memory_pages: ::core::primitive::u32, - pub table_size: ::core::primitive::u32, - pub br_table_size: ::core::primitive::u32, - pub subject_len: ::core::primitive::u32, - pub call_depth: ::core::primitive::u32, - pub payload_len: ::core::primitive::u32, - pub code_len: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Schedule { - pub limits: runtime_types::pallet_contracts::schedule::Limits, - pub instruction_weights: - runtime_types::pallet_contracts::schedule::InstructionWeights, - pub host_fn_weights: - runtime_types::pallet_contracts::schedule::HostFnWeights, - } - } - pub mod storage { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DeletedContract { - pub trie_id: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RawContractInfo<_0> { - pub trie_id: ::std::vec::Vec<::core::primitive::u8>, - pub code_hash: _0, - pub _reserved: ::core::option::Option<()>, - } - } - pub mod wasm { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PrefabWasmModule { - #[codec(compact)] - pub instruction_weights_version: ::core::primitive::u32, - #[codec(compact)] - pub initial: ::core::primitive::u32, - #[codec(compact)] - pub maximum: ::core::primitive::u32, - #[codec(compact)] - pub refcount: ::core::primitive::u64, - pub _reserved: ::core::option::Option<()>, - pub code: ::std::vec::Vec<::core::primitive::u8>, - pub original_code_len: ::core::primitive::u32, - } - } - } - pub mod pallet_democracy { - use super::runtime_types; - pub mod conviction { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Conviction { - None, - Locked1x, - Locked2x, - Locked3x, - Locked4x, - Locked5x, - Locked6x, - } - } - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - propose { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - value: ::core::primitive::u128, - }, - second { - #[codec(compact)] - proposal: ::core::primitive::u32, - #[codec(compact)] - seconds_upper_bound: ::core::primitive::u32, - }, - vote { - #[codec(compact)] - ref_index: ::core::primitive::u32, - vote: runtime_types::pallet_democracy::vote::AccountVote< - ::core::primitive::u128, - >, - }, - emergency_cancel { - ref_index: ::core::primitive::u32, - }, - external_propose { - proposal_hash: ::subxt::sp_core::H256, - }, - external_propose_majority { - proposal_hash: ::subxt::sp_core::H256, - }, - external_propose_default { - proposal_hash: ::subxt::sp_core::H256, - }, - fast_track { - proposal_hash: ::subxt::sp_core::H256, - voting_period: ::core::primitive::u32, - delay: ::core::primitive::u32, - }, - veto_external { - proposal_hash: ::subxt::sp_core::H256, - }, - cancel_referendum { - #[codec(compact)] - ref_index: ::core::primitive::u32, - }, - cancel_queued { - which: ::core::primitive::u32, - }, - delegate { - to: ::subxt::sp_core::crypto::AccountId32, - conviction: - runtime_types::pallet_democracy::conviction::Conviction, - balance: ::core::primitive::u128, - }, - undelegate, - clear_public_proposals, - note_preimage { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - note_preimage_operational { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - note_imminent_preimage { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - note_imminent_preimage_operational { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - reap_preimage { - proposal_hash: ::subxt::sp_core::H256, - #[codec(compact)] - proposal_len_upper_bound: ::core::primitive::u32, - }, - unlock { - target: ::subxt::sp_core::crypto::AccountId32, - }, - remove_vote { - index: ::core::primitive::u32, - }, - remove_other_vote { - target: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - enact_proposal { - proposal_hash: ::subxt::sp_core::H256, - index: ::core::primitive::u32, - }, - blacklist { - proposal_hash: ::subxt::sp_core::H256, - maybe_ref_index: ::core::option::Option<::core::primitive::u32>, - }, - cancel_proposal { - #[codec(compact)] - prop_index: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - ValueLow, - ProposalMissing, - AlreadyCanceled, - DuplicateProposal, - ProposalBlacklisted, - NotSimpleMajority, - InvalidHash, - NoProposal, - AlreadyVetoed, - DuplicatePreimage, - NotImminent, - TooEarly, - Imminent, - PreimageMissing, - ReferendumInvalid, - PreimageInvalid, - NoneWaiting, - NotVoter, - NoPermission, - AlreadyDelegating, - InsufficientFunds, - NotDelegating, - VotesExist, - InstantNotAllowed, - Nonsense, - WrongUpperBound, - MaxVotesReached, - TooManyProposals, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Proposed(::core::primitive::u32, ::core::primitive::u128), - Tabled( - ::core::primitive::u32, - ::core::primitive::u128, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ), - ExternalTabled, - Started( - ::core::primitive::u32, - runtime_types::pallet_democracy::vote_threshold::VoteThreshold, - ), - Passed(::core::primitive::u32), - NotPassed(::core::primitive::u32), - Cancelled(::core::primitive::u32), - Executed( - ::core::primitive::u32, - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - Delegated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - Undelegated(::subxt::sp_core::crypto::AccountId32), - Vetoed( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ::core::primitive::u32, - ), - PreimageNoted( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - PreimageUsed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - PreimageInvalid(::subxt::sp_core::H256, ::core::primitive::u32), - PreimageMissing(::subxt::sp_core::H256, ::core::primitive::u32), - PreimageReaped( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ), - Blacklisted(::subxt::sp_core::H256), - } - } - pub mod types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Delegations<_0> { - pub votes: _0, - pub capital: _0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum ReferendumInfo<_0, _1, _2> { - Ongoing( - runtime_types::pallet_democracy::types::ReferendumStatus< - _0, - _1, - _2, - >, - ), - Finished { - approved: ::core::primitive::bool, - end: _0, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum AccountVote<_0> { - Standard { - vote: runtime_types::pallet_democracy::vote::Vote, - balance: _0, - }, - Split { - aye: _0, - nay: _0, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct PriorLock<_0, _1>(pub _0, pub _1); - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Vote(::core::primitive::u8); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Voting<_0, _1, _2> { - 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>, - }, - 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)] - pub enum VoteThreshold { - SuperMajorityApprove, - SuperMajorityAgainst, - SimpleMajority, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum PreimageStatus<_0, _1, _2> { - Missing(_2), - 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)] - pub enum Releases { - 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)] - pub enum Call { - submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: node_runtime :: NposSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - PreDispatchEarlySubmission, - PreDispatchWrongWinnerCount, - PreDispatchWeakSubmission, - SignedQueueFull, - SignedCannotPayDeposit, - SignedInvalidWitness, - SignedTooMuchWeight, - OcwCallWrongEra, - MissingSnapshotMetadata, - InvalidSubmissionIndex, - CallNotAllowed, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - SolutionStored (runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute , :: core :: primitive :: bool ,) , ElectionFinalized (:: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ElectionCompute > ,) , Rewarded (:: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 ,) , Slashed (:: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 ,) , SignedPhaseStarted (:: core :: primitive :: u32 ,) , UnsignedPhaseStarted (:: core :: primitive :: u32 ,) , } - } - pub mod signed { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum ElectionCompute { - OnChain, - Signed, - Unsigned, - Fallback, - Emergency, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Phase<_0> { - Off, - Signed, - Unsigned((::core::primitive::bool, _0)), - Emergency, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RawSolution<_0> { - pub solution: _0, - pub score: [::core::primitive::u128; 3usize], - pub round: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ReadySolution<_0> { - pub supports: - ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, - pub score: [::core::primitive::u128; 3usize], - pub compute: - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RoundSnapshot<_0> { - pub voters: - ::std::vec::Vec<(_0, ::core::primitive::u64, ::std::vec::Vec<_0>)>, - pub targets: ::std::vec::Vec<_0>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Call { - vote { - votes: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - #[codec(compact)] - value: ::core::primitive::u128, - }, - remove_voter, - submit_candidacy { - #[codec(compact)] - candidate_count: ::core::primitive::u32, - }, - renounce_candidacy { - renouncing: runtime_types::pallet_elections_phragmen::Renouncing, - }, - remove_member { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - has_replacement: ::core::primitive::bool, - }, - clean_defunct_voters { - num_voters: ::core::primitive::u32, - num_defunct: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - UnableToVote, - NoVotes, - TooManyVotes, - MaximumVotesExceeded, - LowBalance, - UnableToPayBond, - MustBeVoter, - ReportSelf, - DuplicatedCandidate, - MemberSubmit, - RunnerUpSubmit, - InsufficientCandidateFunds, - NotMember, - InvalidWitnessData, - InvalidVoteCount, - InvalidRenouncing, - InvalidReplacement, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewTerm( - ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ), - EmptyTerm, - ElectionError, - MemberKicked(::subxt::sp_core::crypto::AccountId32), - Renounced(::subxt::sp_core::crypto::AccountId32), - CandidateSlashed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - SeatHolderSlashed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Renouncing { - Member, - RunnerUp, - Candidate(::core::primitive::u32), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct SeatHolder<_0, _1> { - pub who: _0, - pub stake: _1, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Voter<_0, _1> { - pub votes: ::std::vec::Vec<_0>, - pub stake: _1, - pub deposit: _1, - } - } - pub mod pallet_gilt { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveGilt<_0, _1, _2> { - pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, - pub amount: _0, - pub who: _1, - pub expiry: _2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveGiltsTotal<_0> { - pub frozen: _0, - pub proportion: ::subxt::sp_arithmetic::per_things::Perquintill, - pub index: ::core::primitive::u32, - pub target: ::subxt::sp_arithmetic::per_things::Perquintill, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - place_bid { - #[codec(compact)] - amount: ::core::primitive::u128, - duration: ::core::primitive::u32, - }, - retract_bid { - #[codec(compact)] - amount: ::core::primitive::u128, - duration: ::core::primitive::u32, - }, - set_target { - #[codec(compact)] - target: ::subxt::sp_arithmetic::per_things::Perquintill, - }, - thaw { - #[codec(compact)] - index: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - DurationTooSmall, - DurationTooBig, - AmountTooSmall, - BidTooLow, - Unknown, - NotOwner, - NotExpired, - NotFound, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - BidPlaced( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ), - BidRetracted( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - ), - GiltIssued( - ::core::primitive::u32, - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - GiltThawed( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u128, - ), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct GiltBid<_0, _1> { - pub amount: _0, - pub who: _1, - } - } - } - pub mod pallet_grandpa { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - 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, - }, - 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, - }, - note_stalled { - delay: ::core::primitive::u32, - best_finalized_block_number: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - PauseFailed, - ResumeFailed, - ChangePending, - TooSoon, - InvalidKeyOwnershipProof, - InvalidEquivocationProof, - DuplicateOffenceReport, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewAuthorities( - ::std::vec::Vec<( - runtime_types::sp_finality_grandpa::app::Public, - ::core::primitive::u64, - )>, - ), - Paused, - Resumed, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum StoredState<_0> { - Live, - PendingPause { scheduled_at: _0, delay: _0 }, - Paused, - 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)] - pub enum Call { - add_registrar { - account: ::subxt::sp_core::crypto::AccountId32, - }, - set_identity { - info: ::std::boxed::Box< - runtime_types::pallet_identity::types::IdentityInfo, - >, - }, - set_subs { - subs: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_identity::types::Data, - )>, - }, - clear_identity, - request_judgement { - #[codec(compact)] - reg_index: ::core::primitive::u32, - #[codec(compact)] - max_fee: ::core::primitive::u128, - }, - cancel_request { - reg_index: ::core::primitive::u32, - }, - set_fee { - #[codec(compact)] - index: ::core::primitive::u32, - #[codec(compact)] - fee: ::core::primitive::u128, - }, - set_account_id { - #[codec(compact)] - index: ::core::primitive::u32, - new: ::subxt::sp_core::crypto::AccountId32, - }, - set_fields { - #[codec(compact)] - index: ::core::primitive::u32, - fields: runtime_types::pallet_identity::types::BitFlags< - runtime_types::pallet_identity::types::IdentityField, - >, - }, - provide_judgement { - #[codec(compact)] - reg_index: ::core::primitive::u32, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - judgement: runtime_types::pallet_identity::types::Judgement< - ::core::primitive::u128, - >, - }, - kill_identity { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - add_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - data: runtime_types::pallet_identity::types::Data, - }, - rename_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - data: runtime_types::pallet_identity::types::Data, - }, - remove_sub { - sub: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - quit_sub, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - TooManySubAccounts, - NotFound, - NotNamed, - EmptyIndex, - FeeChanged, - NoIdentity, - StickyJudgement, - JudgementGiven, - InvalidJudgement, - InvalidIndex, - InvalidTarget, - TooManyFields, - TooManyRegistrars, - AlreadyClaimed, - NotSub, - NotOwned, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - IdentitySet(::subxt::sp_core::crypto::AccountId32), - IdentityCleared( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - IdentityKilled( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - JudgementRequested( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ), - JudgementUnrequested( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ), - JudgementGiven( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ), - RegistrarAdded(::core::primitive::u32), - SubIdentityAdded( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - SubIdentityRemoved( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - SubIdentityRevoked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - } - } - pub mod types { - use super::runtime_types; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct BitFlags<_0>( - pub ::core::primitive::u64, - #[codec(skip)] pub ::core::marker::PhantomData<_0>, - ); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Data { - None, - Raw0([::core::primitive::u8; 0usize]), - Raw1([::core::primitive::u8; 1usize]), - Raw2([::core::primitive::u8; 2usize]), - Raw3([::core::primitive::u8; 3usize]), - Raw4([::core::primitive::u8; 4usize]), - Raw5([::core::primitive::u8; 5usize]), - Raw6([::core::primitive::u8; 6usize]), - Raw7([::core::primitive::u8; 7usize]), - Raw8([::core::primitive::u8; 8usize]), - Raw9([::core::primitive::u8; 9usize]), - Raw10([::core::primitive::u8; 10usize]), - Raw11([::core::primitive::u8; 11usize]), - Raw12([::core::primitive::u8; 12usize]), - Raw13([::core::primitive::u8; 13usize]), - Raw14([::core::primitive::u8; 14usize]), - Raw15([::core::primitive::u8; 15usize]), - Raw16([::core::primitive::u8; 16usize]), - Raw17([::core::primitive::u8; 17usize]), - Raw18([::core::primitive::u8; 18usize]), - Raw19([::core::primitive::u8; 19usize]), - Raw20([::core::primitive::u8; 20usize]), - Raw21([::core::primitive::u8; 21usize]), - Raw22([::core::primitive::u8; 22usize]), - Raw23([::core::primitive::u8; 23usize]), - Raw24([::core::primitive::u8; 24usize]), - Raw25([::core::primitive::u8; 25usize]), - Raw26([::core::primitive::u8; 26usize]), - Raw27([::core::primitive::u8; 27usize]), - Raw28([::core::primitive::u8; 28usize]), - Raw29([::core::primitive::u8; 29usize]), - Raw30([::core::primitive::u8; 30usize]), - Raw31([::core::primitive::u8; 31usize]), - Raw32([::core::primitive::u8; 32usize]), - BlakeTwo256([::core::primitive::u8; 32usize]), - Sha256([::core::primitive::u8; 32usize]), - Keccak256([::core::primitive::u8; 32usize]), - ShaThree256([::core::primitive::u8; 32usize]), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum IdentityField { - Display, - Legal, - Web, - Riot, - Email, - PgpFingerprint, - Image, - Twitter, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Judgement<_0> { - Unknown, - FeePaid(_0), - Reasonable, - KnownGood, - OutOfDate, - LowQuality, - Erroneous, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum Call { - 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)] - pub enum Error { - InvalidKey, - DuplicatedHeartbeat, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - HeartbeatReceived( - runtime_types::pallet_im_online::sr25519::app_sr25519::Public, - ), - AllGood, - SomeOffline( - ::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, - )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum Call { - claim { - index: ::core::primitive::u32, - }, - transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - }, - free { - index: ::core::primitive::u32, - }, - force_transfer { - new: ::subxt::sp_core::crypto::AccountId32, - index: ::core::primitive::u32, - freeze: ::core::primitive::bool, - }, - freeze { - index: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotAssigned, - NotOwner, - InUse, - NotTransfer, - Permanent, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - IndexAssigned( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - ), - IndexFreed(::core::primitive::u32), - IndexFrozen( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - } - } - } - pub mod pallet_lottery { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - buy_ticket { - call: ::std::boxed::Box, - }, - set_calls { - calls: ::std::vec::Vec, - }, - start_lottery { - price: ::core::primitive::u128, - length: ::core::primitive::u32, - delay: ::core::primitive::u32, - repeat: ::core::primitive::bool, - }, - stop_repeat, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotConfigured, - InProgress, - AlreadyEnded, - InvalidCall, - AlreadyParticipating, - TooManyCalls, - EncodingFailed, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - LotteryStarted, - CallsUpdated, - Winner( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - TicketBought( - ::subxt::sp_core::crypto::AccountId32, - (::core::primitive::u8, ::core::primitive::u8), - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct LotteryConfig<_0, _1> { - pub price: _1, - pub start: _0, - pub length: _0, - pub delay: _0, - pub repeat: ::core::primitive::bool, - } - } - pub mod pallet_membership { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - add_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - remove_member { - who: ::subxt::sp_core::crypto::AccountId32, - }, - swap_member { - remove: ::subxt::sp_core::crypto::AccountId32, - add: ::subxt::sp_core::crypto::AccountId32, - }, - reset_members { - members: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - change_key { - new: ::subxt::sp_core::crypto::AccountId32, - }, - set_prime { - who: ::subxt::sp_core::crypto::AccountId32, - }, - clear_prime, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - AlreadyMember, - NotMember, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - MemberAdded, - MemberRemoved, - MembersSwapped, - MembersReset, - KeyChanged, - Dummy, - } - } - } - pub mod pallet_multisig { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - as_multi_threshold_1 { - other_signatories: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - call: ::std::boxed::Box, - }, - 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, - store_call: ::core::primitive::bool, - max_weight: ::core::primitive::u64, - }, - 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, - }, - 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)] - pub enum Error { - MinimumThreshold, - AlreadyApproved, - NoApprovalsNeeded, - TooFewSignatories, - TooManySignatories, - SignatoriesOutOfOrder, - SenderInSignatories, - NotFound, - NotOwner, - NoTimepoint, - WrongTimepoint, - UnexpectedTimepoint, - MaxWeightTooLow, - AlreadyStored, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewMultisig( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - [::core::primitive::u8; 32usize], - ), - MultisigApproval( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - ::subxt::sp_core::crypto::AccountId32, - [::core::primitive::u8; 32usize], - ), - MultisigExecuted( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - ::subxt::sp_core::crypto::AccountId32, - [::core::primitive::u8; 32usize], - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - MultisigCancelled( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, - ::subxt::sp_core::crypto::AccountId32, - [::core::primitive::u8; 32usize], - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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)] - pub enum Event { - Offence( - [::core::primitive::u8; 16usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - } - } - } - pub mod pallet_proxy { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - proxy { - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::node_runtime::ProxyType, - >, - call: ::std::boxed::Box, - }, - add_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - remove_proxy { - delegate: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - delay: ::core::primitive::u32, - }, - remove_proxies, - anonymous { - proxy_type: runtime_types::node_runtime::ProxyType, - delay: ::core::primitive::u32, - index: ::core::primitive::u16, - }, - kill_anonymous { - spawner: ::subxt::sp_core::crypto::AccountId32, - proxy_type: runtime_types::node_runtime::ProxyType, - index: ::core::primitive::u16, - #[codec(compact)] - height: ::core::primitive::u32, - #[codec(compact)] - ext_index: ::core::primitive::u32, - }, - announce { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - remove_announcement { - real: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - reject_announcement { - delegate: ::subxt::sp_core::crypto::AccountId32, - call_hash: ::subxt::sp_core::H256, - }, - proxy_announced { - delegate: ::subxt::sp_core::crypto::AccountId32, - real: ::subxt::sp_core::crypto::AccountId32, - force_proxy_type: ::core::option::Option< - runtime_types::node_runtime::ProxyType, - >, - call: ::std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - TooMany, - NotFound, - NotProxy, - Unproxyable, - Duplicate, - NoPermission, - Unannounced, - NoSelfProxy, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - ProxyExecuted( - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - AnonymousCreated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_runtime::ProxyType, - ::core::primitive::u16, - ), - Announced( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::H256, - ), - ProxyAdded( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - runtime_types::node_runtime::ProxyType, - ::core::primitive::u32, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Announcement<_0, _1, _2> { - pub real: _0, - pub call_hash: _1, - pub height: _2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ProxyDefinition<_0, _1, _2> { - pub delegate: _0, - pub proxy_type: _1, - pub delay: _2, - } - } - pub mod pallet_recovery { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - as_recovered { - account: ::subxt::sp_core::crypto::AccountId32, - call: ::std::boxed::Box, - }, - set_recovered { - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - }, - create_recovery { - friends: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - threshold: ::core::primitive::u16, - delay_period: ::core::primitive::u32, - }, - initiate_recovery { - account: ::subxt::sp_core::crypto::AccountId32, - }, - vouch_recovery { - lost: ::subxt::sp_core::crypto::AccountId32, - rescuer: ::subxt::sp_core::crypto::AccountId32, - }, - claim_recovery { - account: ::subxt::sp_core::crypto::AccountId32, - }, - close_recovery { - rescuer: ::subxt::sp_core::crypto::AccountId32, - }, - remove_recovery, - cancel_recovered { - account: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotAllowed, - ZeroThreshold, - NotEnoughFriends, - MaxFriends, - NotSorted, - NotRecoverable, - AlreadyRecoverable, - AlreadyStarted, - NotStarted, - NotFriend, - DelayPeriod, - AlreadyVouched, - Threshold, - StillActive, - AlreadyProxy, - BadState, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - RecoveryCreated(::subxt::sp_core::crypto::AccountId32), - RecoveryInitiated( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - RecoveryVouched( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - RecoveryClosed( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - AccountRecovered( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - RecoveryRemoved(::subxt::sp_core::crypto::AccountId32), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveRecovery<_0, _1, _2> { - pub created: _0, - pub deposit: _1, - pub friends: ::std::vec::Vec<_2>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct RecoveryConfig<_0, _1, _2> { - pub delay_period: _0, - pub deposit: _1, - pub friends: ::std::vec::Vec<_2>, - pub threshold: ::core::primitive::u16, - } - } - pub mod pallet_scheduler { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - schedule { - when: ::core::primitive::u32, - maybe_periodic: ::core::option::Option<( - ::core::primitive::u32, - ::core::primitive::u32, - )>, - priority: ::core::primitive::u8, - call: ::std::boxed::Box, - }, - cancel { - when: ::core::primitive::u32, - index: ::core::primitive::u32, - }, - 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, - }, - cancel_named { - id: ::std::vec::Vec<::core::primitive::u8>, - }, - 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, - }, - 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, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - FailedToSchedule, - NotFound, - TargetBlockNumberInPast, - RescheduleNoChange, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Scheduled(::core::primitive::u32, ::core::primitive::u32), - Canceled(::core::primitive::u32, ::core::primitive::u32), - Dispatched( - (::core::primitive::u32, ::core::primitive::u32), - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1, - V2, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ScheduledV2<_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)] - pub enum Call { - set_keys { - keys: runtime_types::node_runtime::SessionKeys, - proof: ::std::vec::Vec<::core::primitive::u8>, - }, - purge_keys, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InvalidProof, - NoAssociatedValidatorId, - DuplicatedKey, - NoKeys, - NoAccount, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewSession(::core::primitive::u32), - } - } - } - pub mod pallet_society { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - bid { - value: ::core::primitive::u128, - }, - unbid { - pos: ::core::primitive::u32, - }, - vouch { - who: ::subxt::sp_core::crypto::AccountId32, - value: ::core::primitive::u128, - tip: ::core::primitive::u128, - }, - unvouch { - pos: ::core::primitive::u32, - }, - vote { - candidate: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - approve: ::core::primitive::bool, - }, - defender_vote { - approve: ::core::primitive::bool, - }, - payout, - found { - founder: ::subxt::sp_core::crypto::AccountId32, - max_members: ::core::primitive::u32, - rules: ::std::vec::Vec<::core::primitive::u8>, - }, - unfound, - judge_suspended_member { - who: ::subxt::sp_core::crypto::AccountId32, - forgive: ::core::primitive::bool, - }, - judge_suspended_candidate { - who: ::subxt::sp_core::crypto::AccountId32, - judgement: runtime_types::pallet_society::Judgement, - }, - set_max_members { - max: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - BadPosition, - NotMember, - AlreadyMember, - Suspended, - NotSuspended, - NoPayout, - AlreadyFounded, - InsufficientPot, - AlreadyVouching, - NotVouching, - Head, - Founder, - AlreadyBid, - AlreadyCandidate, - NotCandidate, - MaxMembers, - NotFounder, - NotHead, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Founded(::subxt::sp_core::crypto::AccountId32), - Bid( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Vouch( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ), - AutoUnbid(::subxt::sp_core::crypto::AccountId32), - Unbid(::subxt::sp_core::crypto::AccountId32), - Unvouch(::subxt::sp_core::crypto::AccountId32), - Inducted( - ::subxt::sp_core::crypto::AccountId32, - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - ), - SuspendedMemberJudgement( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::bool, - ), - CandidateSuspended(::subxt::sp_core::crypto::AccountId32), - MemberSuspended(::subxt::sp_core::crypto::AccountId32), - Challenged(::subxt::sp_core::crypto::AccountId32), - Vote( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::bool, - ), - DefenderVote( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::bool, - ), - NewMaxMembers(::core::primitive::u32), - Unfounded(::subxt::sp_core::crypto::AccountId32), - Deposit(::core::primitive::u128), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Bid<_0, _1> { - pub who: _0, - pub kind: runtime_types::pallet_society::BidKind<_0, _1>, - pub value: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum BidKind<_0, _1> { - Deposit(_1), - Vouch(_0, _1), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Judgement { - Rebid, - Reject, - Approve, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Vote { - Skeptic, - Reject, - Approve, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum VouchingStatus { - Vouching, - Banned, - } - } - 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, - )] - pub enum Call { - bond { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - #[codec(compact)] - value: ::core::primitive::u128, - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - bond_extra { - #[codec(compact)] - max_additional: ::core::primitive::u128, - }, - unbond { - #[codec(compact)] - value: ::core::primitive::u128, - }, - withdraw_unbonded { - num_slashing_spans: ::core::primitive::u32, - }, - validate { - prefs: runtime_types::pallet_staking::ValidatorPrefs, - }, - nominate { - targets: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - }, - chill, - set_payee { - payee: runtime_types::pallet_staking::RewardDestination< - ::subxt::sp_core::crypto::AccountId32, - >, - }, - set_controller { - controller: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - set_validator_count { - #[codec(compact)] - new: ::core::primitive::u32, - }, - increase_validator_count { - #[codec(compact)] - additional: ::core::primitive::u32, - }, - scale_validator_count { - factor: runtime_types::sp_arithmetic::per_things::Percent, - }, - force_no_eras, - force_new_era, - set_invulnerables { - invulnerables: - ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, - }, - force_unstake { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - }, - force_new_era_always, - cancel_deferred_slash { - era: ::core::primitive::u32, - slash_indices: ::std::vec::Vec<::core::primitive::u32>, - }, - payout_stakers { - validator_stash: ::subxt::sp_core::crypto::AccountId32, - era: ::core::primitive::u32, - }, - rebond { - #[codec(compact)] - value: ::core::primitive::u128, - }, - set_history_depth { - #[codec(compact)] - new_history_depth: ::core::primitive::u32, - #[codec(compact)] - era_items_deleted: ::core::primitive::u32, - }, - reap_stash { - stash: ::subxt::sp_core::crypto::AccountId32, - num_slashing_spans: ::core::primitive::u32, - }, - kick { - who: ::std::vec::Vec< - ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - >, - }, - set_staking_limits { - min_nominator_bond: ::core::primitive::u128, - min_validator_bond: ::core::primitive::u128, - max_nominator_count: - ::core::option::Option<::core::primitive::u32>, - max_validator_count: - ::core::option::Option<::core::primitive::u32>, - threshold: ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - }, - chill_other { - controller: ::subxt::sp_core::crypto::AccountId32, - }, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Error { - NotController, - NotStash, - AlreadyBonded, - AlreadyPaired, - EmptyTargets, - DuplicateIndex, - InvalidSlashIndex, - InsufficientBond, - NoMoreChunks, - NoUnlockChunk, - FundedTarget, - InvalidEraToReward, - InvalidNumberOfNominations, - NotSortedAndUnique, - AlreadyClaimed, - IncorrectHistoryDepth, - IncorrectSlashingSpans, - BadState, - TooManyTargets, - BadTarget, - CannotChillOther, - TooManyNominators, - TooManyValidators, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Event { - EraPaid( - ::core::primitive::u32, - ::core::primitive::u128, - ::core::primitive::u128, - ), - Rewarded( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Slashed( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - OldSlashingReportDiscarded(::core::primitive::u32), - StakersElected, - Bonded( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Unbonded( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Withdrawn( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - Kicked( - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - StakingElectionFailed, - Chilled(::subxt::sp_core::crypto::AccountId32), - PayoutStarted( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - } - } - } - pub mod slashing { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct SpanRecord<_0> { - pub slashed: _0, - pub paid_out: _0, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ActiveEraInfo { - pub index: ::core::primitive::u32, - pub start: ::core::option::Option<::core::primitive::u64>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct EraRewardPoints<_0> { - pub total: ::core::primitive::u32, - pub individual: ::std::collections::BTreeMap<_0, ::core::primitive::u32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub enum Forcing { - NotForcing, - ForceNew, - ForceNone, - ForceAlways, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct IndividualExposure<_0, _1> { - pub who: _0, - #[codec(compact)] - pub value: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Nominations<_0> { - pub targets: ::std::vec::Vec<_0>, - pub submitted_in: ::core::primitive::u32, - pub suppressed: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1_0_0Ancient, - V2_0_0, - V3_0_0, - V4_0_0, - V5_0_0, - V6_0_0, - V7_0_0, - V8_0_0, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum RewardDestination<_0> { - Staked, - Stash, - Controller, - Account(_0), - None, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct StakingLedger<_0, _1> { - pub stash: _0, - #[codec(compact)] - pub total: _1, - #[codec(compact)] - pub active: _1, - pub unlocking: - ::std::vec::Vec>, - pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct UnlockChunk<_0> { - #[codec(compact)] - pub value: _0, - #[codec(compact)] - pub era: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ValidatorPrefs { - #[codec(compact)] - pub commission: ::subxt::sp_arithmetic::per_things::Perbill, - pub blocked: ::core::primitive::bool, - } - } - pub mod pallet_sudo { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - sudo { - call: ::std::boxed::Box, - }, - sudo_unchecked_weight { - call: ::std::boxed::Box, - weight: ::core::primitive::u64, - }, - set_key { - new: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - sudo_as { - who: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - call: ::std::boxed::Box, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - RequireSudo, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Sudid( - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - KeyChanged(::subxt::sp_core::crypto::AccountId32), - SudoAsDone( - ::core::result::Result< - (), - runtime_types::sp_runtime::DispatchError, - >, - ), - } - } - } - pub mod pallet_timestamp { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - 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)] - pub enum Call { - report_awesome { - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - }, - retract_tip { - hash: ::subxt::sp_core::H256, - }, - tip_new { - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - #[codec(compact)] - tip_value: ::core::primitive::u128, - }, - tip { - hash: ::subxt::sp_core::H256, - #[codec(compact)] - tip_value: ::core::primitive::u128, - }, - close_tip { - hash: ::subxt::sp_core::H256, - }, - slash_tip { - hash: ::subxt::sp_core::H256, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - ReasonTooBig, - AlreadyKnown, - UnknownTip, - NotFinder, - StillOpen, - Premature, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - NewTip(::subxt::sp_core::H256), - TipClosing(::subxt::sp_core::H256), - TipClosed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - TipRetracted(::subxt::sp_core::H256), - TipSlashed( - ::subxt::sp_core::H256, - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct ChargeTransactionPayment(pub ::core::primitive::u128); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V1Ancient, - V2, - } - } - pub mod pallet_transaction_storage { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - store { data : :: std :: vec :: Vec < :: core :: primitive :: u8 > , } , renew { block : :: core :: primitive :: u32 , index : :: core :: primitive :: u32 , } , check_proof { proof : runtime_types :: sp_transaction_storage_proof :: TransactionStorageProof , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InsufficientFunds, - NotConfigured, - RenewedNotFound, - EmptyTransaction, - UnexpectedProof, - InvalidProof, - MissingProof, - MissingStateData, - DoubleCheck, - ProofNotChecked, - TransactionTooLarge, - TooManyTransactions, - BadContext, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Stored(::core::primitive::u32), - Renewed(::core::primitive::u32), - ProofChecked, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransactionInfo { - pub chunk_root: ::subxt::sp_core::H256, - pub content_hash: ::subxt::sp_core::H256, - pub size: ::core::primitive::u32, - pub block_chunks: ::core::primitive::u32, - } - } - pub mod pallet_treasury { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - propose_spend { - #[codec(compact)] - value: ::core::primitive::u128, - beneficiary: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - reject_proposal { - #[codec(compact)] - proposal_id: ::core::primitive::u32, - }, - approve_proposal { - #[codec(compact)] - proposal_id: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - InsufficientProposersBalance, - InvalidIndex, - TooManyApprovals, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Proposed(::core::primitive::u32), - Spending(::core::primitive::u128), - Awarded( - ::core::primitive::u32, - ::core::primitive::u128, - ::subxt::sp_core::crypto::AccountId32, - ), - Rejected(::core::primitive::u32, ::core::primitive::u128), - Burnt(::core::primitive::u128), - Rollover(::core::primitive::u128), - Deposit(::core::primitive::u128), - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Proposal<_0, _1> { - pub proposer: _0, - pub value: _1, - pub beneficiary: _0, - pub bond: _1, - } - } - pub mod pallet_uniques { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - create { # [codec (compact)] class : :: core :: primitive :: u32 , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , force_create { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , } , destroy { # [codec (compact)] class : :: core :: primitive :: u32 , witness : runtime_types :: pallet_uniques :: types :: DestroyWitness , } , mint { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , burn { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , check_owner : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , dest : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , redeposit { # [codec (compact)] class : :: core :: primitive :: u32 , instances : :: std :: vec :: Vec < :: core :: primitive :: u32 > , } , freeze { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , thaw { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , freeze_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , thaw_class { # [codec (compact)] class : :: core :: primitive :: u32 , } , transfer_ownership { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , set_team { # [codec (compact)] class : :: core :: primitive :: u32 , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , approve_transfer { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , delegate : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , } , cancel_approval { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , maybe_check_delegate : :: core :: option :: Option < :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > > , } , force_asset_status { # [codec (compact)] class : :: core :: primitive :: u32 , owner : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , issuer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , admin : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , freezer : :: subxt :: sp_runtime :: MultiAddress < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u32 > , free_holding : :: core :: primitive :: bool , is_frozen : :: core :: primitive :: bool , } , set_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , value : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , clear_attribute { # [codec (compact)] class : :: core :: primitive :: u32 , maybe_instance : :: core :: option :: Option < :: core :: primitive :: u32 > , key : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , } , set_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , # [codec (compact)] instance : :: core :: primitive :: u32 , } , set_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , data : runtime_types :: frame_support :: storage :: bounded_vec :: BoundedVec < :: core :: primitive :: u8 > , is_frozen : :: core :: primitive :: bool , } , clear_class_metadata { # [codec (compact)] class : :: core :: primitive :: u32 , } , } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NoPermission, - Unknown, - AlreadyExists, - WrongOwner, - BadWitness, - InUse, - Frozen, - WrongDelegate, - NoDelegate, - Unapproved, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - Created( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - ForceCreated( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - Destroyed(::core::primitive::u32), - Issued( - ::core::primitive::u32, - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - Transferred( - ::core::primitive::u32, - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - Burned( - ::core::primitive::u32, - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - Frozen(::core::primitive::u32, ::core::primitive::u32), - Thawed(::core::primitive::u32, ::core::primitive::u32), - ClassFrozen(::core::primitive::u32), - ClassThawed(::core::primitive::u32), - OwnerChanged( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ), - TeamChanged( - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - ApprovedTransfer( - ::core::primitive::u32, - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - ApprovalCancelled( - ::core::primitive::u32, - ::core::primitive::u32, - ::subxt::sp_core::crypto::AccountId32, - ::subxt::sp_core::crypto::AccountId32, - ), - AssetStatusChanged(::core::primitive::u32), - ClassMetadataSet( - ::core::primitive::u32, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::bool, - ), - ClassMetadataCleared(::core::primitive::u32), - MetadataSet( - ::core::primitive::u32, - ::core::primitive::u32, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ::core::primitive::bool, - ), - MetadataCleared(::core::primitive::u32, ::core::primitive::u32), - Redeposited( - ::core::primitive::u32, - ::std::vec::Vec<::core::primitive::u32>, - ), - AttributeSet( - ::core::primitive::u32, - ::core::option::Option<::core::primitive::u32>, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ), - AttributeCleared( - ::core::primitive::u32, - ::core::option::Option<::core::primitive::u32>, - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - ), - } - } - pub mod types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassDetails<_0, _1> { - pub owner: _0, - pub issuer: _0, - pub admin: _0, - pub freezer: _0, - pub total_deposit: _1, - pub free_holding: ::core::primitive::bool, - pub instances: ::core::primitive::u32, - pub instance_metadatas: ::core::primitive::u32, - pub attributes: ::core::primitive::u32, - pub is_frozen: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ClassMetadata<_0> { - pub deposit: _0, - pub data: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub is_frozen: ::core::primitive::bool, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct DestroyWitness { - #[codec(compact)] - pub instances: ::core::primitive::u32, - #[codec(compact)] - pub instance_metadatas: ::core::primitive::u32, - #[codec(compact)] - pub attributes: ::core::primitive::u32, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstanceDetails<_0, _1> { - pub owner: _0, - pub approved: ::core::option::Option<_0>, - pub is_frozen: ::core::primitive::bool, - pub deposit: _1, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct InstanceMetadata<_0> { - pub deposit: _0, - pub data: - runtime_types::frame_support::storage::bounded_vec::BoundedVec< - ::core::primitive::u8, - >, - pub is_frozen: ::core::primitive::bool, - } - } - } - pub mod pallet_utility { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - batch { - calls: ::std::vec::Vec, - }, - as_derivative { - index: ::core::primitive::u16, - call: ::std::boxed::Box, - }, - batch_all { - calls: ::std::vec::Vec, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - TooManyCalls, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - BatchInterrupted( - ::core::primitive::u32, - runtime_types::sp_runtime::DispatchError, - ), - BatchCompleted, - ItemCompleted, - } - } - } - pub mod pallet_vesting { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Call { - vest, - vest_other { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - }, - vested_transfer { - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - }, - force_vested_transfer { - source: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - target: ::subxt::sp_runtime::MultiAddress< - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u32, - >, - schedule: - runtime_types::pallet_vesting::vesting_info::VestingInfo< - ::core::primitive::u128, - ::core::primitive::u32, - >, - }, - merge_schedules { - schedule1_index: ::core::primitive::u32, - schedule2_index: ::core::primitive::u32, - }, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Error { - NotVesting, - AtMaxVestingSchedules, - AmountLow, - ScheduleIndexOutOfBounds, - InvalidScheduleParams, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Event { - VestingUpdated( - ::subxt::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), - VestingCompleted(::subxt::sp_core::crypto::AccountId32), - } - } - pub mod vesting_info { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct VestingInfo<_0, _1> { - pub locked: _0, - pub per_block: _0, - pub starting_block: _1, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Releases { - V0, - V1, - } - } - pub mod primitive_types { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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 :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct FixedU128(pub ::core::primitive::u128); - } - pub mod per_things { - use super::runtime_types; - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct PerU16(pub ::core::primitive::u16); - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Perbill(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Percent(pub ::core::primitive::u8); - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Permill(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Perquintill(pub ::core::primitive::u64); - } - } - pub mod sp_authority_discovery { - use super::runtime_types; - pub mod app { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); - } - pub mod digests { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum NextConfigDescriptor { - V1 { - c: (::core::primitive::u64, ::core::primitive::u64), - allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, - }, - } - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum AllowedSlots { - PrimarySlots, - PrimaryAndSecondaryPlainSlots, - PrimaryAndSecondaryVRFSlots, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - 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 :: CompactAs, - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - )] - pub struct Slot(pub ::core::primitive::u64); - } - pub mod sp_core { - use super::runtime_types; - pub mod changes_trie { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct ChangesTrieConfiguration { - pub digest_interval: ::core::primitive::u32, - pub digest_levels: ::core::primitive::u32, - } - } - pub mod crypto { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct AccountId32(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); - } - pub mod ecdsa { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub [::core::primitive::u8; 65usize]); - } - pub mod ed25519 { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub [::core::primitive::u8; 64usize]); - } - pub mod offchain { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Public(pub [::core::primitive::u8; 32usize]); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub [::core::primitive::u8; 64usize]); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct Public(pub runtime_types::sp_core::ed25519::Public); - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct Signature(pub runtime_types::sp_core::ed25519::Signature); - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum Equivocation<_0, _1> { - 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, - >, - ), - 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)] - 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)] - 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, - )] - pub enum ChangesTrieSignal { - NewConfiguration (:: core :: option :: Option < runtime_types :: sp_core :: changes_trie :: ChangesTrieConfiguration > ,) , } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub struct Digest<_0> { - pub logs: ::std::vec::Vec< - runtime_types::sp_runtime::generic::digest::DigestItem<_0>, - >, - } - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum DigestItem<_0> { - ChangesTrieRoot(_0), - PreRuntime( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - Consensus( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - Seal( - [::core::primitive::u8; 4usize], - ::std::vec::Vec<::core::primitive::u8>, - ), - ChangesTrieSignal( - runtime_types::sp_runtime::generic::digest::ChangesTrieSignal, - ), - Other(::std::vec::Vec<::core::primitive::u8>), - RuntimeEnvironmentUpdated, - } - } - pub mod era { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - pub enum Era { - Immortal, - Mortal1(::core::primitive::u8), - Mortal2(::core::primitive::u8), - Mortal3(::core::primitive::u8), - Mortal4(::core::primitive::u8), - Mortal5(::core::primitive::u8), - Mortal6(::core::primitive::u8), - Mortal7(::core::primitive::u8), - Mortal8(::core::primitive::u8), - Mortal9(::core::primitive::u8), - Mortal10(::core::primitive::u8), - Mortal11(::core::primitive::u8), - Mortal12(::core::primitive::u8), - Mortal13(::core::primitive::u8), - Mortal14(::core::primitive::u8), - Mortal15(::core::primitive::u8), - Mortal16(::core::primitive::u8), - Mortal17(::core::primitive::u8), - Mortal18(::core::primitive::u8), - Mortal19(::core::primitive::u8), - Mortal20(::core::primitive::u8), - Mortal21(::core::primitive::u8), - Mortal22(::core::primitive::u8), - Mortal23(::core::primitive::u8), - Mortal24(::core::primitive::u8), - Mortal25(::core::primitive::u8), - Mortal26(::core::primitive::u8), - Mortal27(::core::primitive::u8), - Mortal28(::core::primitive::u8), - Mortal29(::core::primitive::u8), - Mortal30(::core::primitive::u8), - Mortal31(::core::primitive::u8), - Mortal32(::core::primitive::u8), - Mortal33(::core::primitive::u8), - Mortal34(::core::primitive::u8), - Mortal35(::core::primitive::u8), - Mortal36(::core::primitive::u8), - Mortal37(::core::primitive::u8), - Mortal38(::core::primitive::u8), - Mortal39(::core::primitive::u8), - Mortal40(::core::primitive::u8), - Mortal41(::core::primitive::u8), - Mortal42(::core::primitive::u8), - Mortal43(::core::primitive::u8), - Mortal44(::core::primitive::u8), - Mortal45(::core::primitive::u8), - Mortal46(::core::primitive::u8), - Mortal47(::core::primitive::u8), - Mortal48(::core::primitive::u8), - Mortal49(::core::primitive::u8), - Mortal50(::core::primitive::u8), - Mortal51(::core::primitive::u8), - Mortal52(::core::primitive::u8), - Mortal53(::core::primitive::u8), - Mortal54(::core::primitive::u8), - Mortal55(::core::primitive::u8), - Mortal56(::core::primitive::u8), - Mortal57(::core::primitive::u8), - Mortal58(::core::primitive::u8), - Mortal59(::core::primitive::u8), - Mortal60(::core::primitive::u8), - Mortal61(::core::primitive::u8), - Mortal62(::core::primitive::u8), - Mortal63(::core::primitive::u8), - Mortal64(::core::primitive::u8), - Mortal65(::core::primitive::u8), - Mortal66(::core::primitive::u8), - Mortal67(::core::primitive::u8), - Mortal68(::core::primitive::u8), - Mortal69(::core::primitive::u8), - Mortal70(::core::primitive::u8), - Mortal71(::core::primitive::u8), - Mortal72(::core::primitive::u8), - Mortal73(::core::primitive::u8), - Mortal74(::core::primitive::u8), - Mortal75(::core::primitive::u8), - Mortal76(::core::primitive::u8), - Mortal77(::core::primitive::u8), - Mortal78(::core::primitive::u8), - Mortal79(::core::primitive::u8), - Mortal80(::core::primitive::u8), - Mortal81(::core::primitive::u8), - Mortal82(::core::primitive::u8), - Mortal83(::core::primitive::u8), - Mortal84(::core::primitive::u8), - Mortal85(::core::primitive::u8), - Mortal86(::core::primitive::u8), - Mortal87(::core::primitive::u8), - Mortal88(::core::primitive::u8), - Mortal89(::core::primitive::u8), - Mortal90(::core::primitive::u8), - Mortal91(::core::primitive::u8), - Mortal92(::core::primitive::u8), - Mortal93(::core::primitive::u8), - Mortal94(::core::primitive::u8), - Mortal95(::core::primitive::u8), - Mortal96(::core::primitive::u8), - Mortal97(::core::primitive::u8), - Mortal98(::core::primitive::u8), - Mortal99(::core::primitive::u8), - Mortal100(::core::primitive::u8), - Mortal101(::core::primitive::u8), - Mortal102(::core::primitive::u8), - Mortal103(::core::primitive::u8), - Mortal104(::core::primitive::u8), - Mortal105(::core::primitive::u8), - Mortal106(::core::primitive::u8), - Mortal107(::core::primitive::u8), - Mortal108(::core::primitive::u8), - Mortal109(::core::primitive::u8), - Mortal110(::core::primitive::u8), - Mortal111(::core::primitive::u8), - Mortal112(::core::primitive::u8), - Mortal113(::core::primitive::u8), - Mortal114(::core::primitive::u8), - Mortal115(::core::primitive::u8), - Mortal116(::core::primitive::u8), - Mortal117(::core::primitive::u8), - Mortal118(::core::primitive::u8), - Mortal119(::core::primitive::u8), - Mortal120(::core::primitive::u8), - Mortal121(::core::primitive::u8), - Mortal122(::core::primitive::u8), - Mortal123(::core::primitive::u8), - Mortal124(::core::primitive::u8), - Mortal125(::core::primitive::u8), - Mortal126(::core::primitive::u8), - Mortal127(::core::primitive::u8), - Mortal128(::core::primitive::u8), - Mortal129(::core::primitive::u8), - Mortal130(::core::primitive::u8), - Mortal131(::core::primitive::u8), - Mortal132(::core::primitive::u8), - Mortal133(::core::primitive::u8), - Mortal134(::core::primitive::u8), - Mortal135(::core::primitive::u8), - Mortal136(::core::primitive::u8), - Mortal137(::core::primitive::u8), - Mortal138(::core::primitive::u8), - Mortal139(::core::primitive::u8), - Mortal140(::core::primitive::u8), - Mortal141(::core::primitive::u8), - Mortal142(::core::primitive::u8), - Mortal143(::core::primitive::u8), - Mortal144(::core::primitive::u8), - Mortal145(::core::primitive::u8), - Mortal146(::core::primitive::u8), - Mortal147(::core::primitive::u8), - Mortal148(::core::primitive::u8), - Mortal149(::core::primitive::u8), - Mortal150(::core::primitive::u8), - Mortal151(::core::primitive::u8), - Mortal152(::core::primitive::u8), - Mortal153(::core::primitive::u8), - Mortal154(::core::primitive::u8), - Mortal155(::core::primitive::u8), - Mortal156(::core::primitive::u8), - Mortal157(::core::primitive::u8), - Mortal158(::core::primitive::u8), - Mortal159(::core::primitive::u8), - Mortal160(::core::primitive::u8), - Mortal161(::core::primitive::u8), - Mortal162(::core::primitive::u8), - Mortal163(::core::primitive::u8), - Mortal164(::core::primitive::u8), - Mortal165(::core::primitive::u8), - Mortal166(::core::primitive::u8), - Mortal167(::core::primitive::u8), - Mortal168(::core::primitive::u8), - Mortal169(::core::primitive::u8), - Mortal170(::core::primitive::u8), - Mortal171(::core::primitive::u8), - Mortal172(::core::primitive::u8), - Mortal173(::core::primitive::u8), - Mortal174(::core::primitive::u8), - Mortal175(::core::primitive::u8), - Mortal176(::core::primitive::u8), - Mortal177(::core::primitive::u8), - Mortal178(::core::primitive::u8), - Mortal179(::core::primitive::u8), - Mortal180(::core::primitive::u8), - Mortal181(::core::primitive::u8), - Mortal182(::core::primitive::u8), - Mortal183(::core::primitive::u8), - Mortal184(::core::primitive::u8), - Mortal185(::core::primitive::u8), - Mortal186(::core::primitive::u8), - Mortal187(::core::primitive::u8), - Mortal188(::core::primitive::u8), - Mortal189(::core::primitive::u8), - Mortal190(::core::primitive::u8), - Mortal191(::core::primitive::u8), - Mortal192(::core::primitive::u8), - Mortal193(::core::primitive::u8), - Mortal194(::core::primitive::u8), - Mortal195(::core::primitive::u8), - Mortal196(::core::primitive::u8), - Mortal197(::core::primitive::u8), - Mortal198(::core::primitive::u8), - Mortal199(::core::primitive::u8), - Mortal200(::core::primitive::u8), - Mortal201(::core::primitive::u8), - Mortal202(::core::primitive::u8), - Mortal203(::core::primitive::u8), - Mortal204(::core::primitive::u8), - Mortal205(::core::primitive::u8), - Mortal206(::core::primitive::u8), - Mortal207(::core::primitive::u8), - Mortal208(::core::primitive::u8), - Mortal209(::core::primitive::u8), - Mortal210(::core::primitive::u8), - Mortal211(::core::primitive::u8), - Mortal212(::core::primitive::u8), - Mortal213(::core::primitive::u8), - Mortal214(::core::primitive::u8), - Mortal215(::core::primitive::u8), - Mortal216(::core::primitive::u8), - Mortal217(::core::primitive::u8), - Mortal218(::core::primitive::u8), - Mortal219(::core::primitive::u8), - Mortal220(::core::primitive::u8), - Mortal221(::core::primitive::u8), - Mortal222(::core::primitive::u8), - Mortal223(::core::primitive::u8), - Mortal224(::core::primitive::u8), - Mortal225(::core::primitive::u8), - Mortal226(::core::primitive::u8), - Mortal227(::core::primitive::u8), - Mortal228(::core::primitive::u8), - Mortal229(::core::primitive::u8), - Mortal230(::core::primitive::u8), - Mortal231(::core::primitive::u8), - Mortal232(::core::primitive::u8), - Mortal233(::core::primitive::u8), - Mortal234(::core::primitive::u8), - Mortal235(::core::primitive::u8), - Mortal236(::core::primitive::u8), - Mortal237(::core::primitive::u8), - Mortal238(::core::primitive::u8), - Mortal239(::core::primitive::u8), - Mortal240(::core::primitive::u8), - Mortal241(::core::primitive::u8), - Mortal242(::core::primitive::u8), - Mortal243(::core::primitive::u8), - Mortal244(::core::primitive::u8), - Mortal245(::core::primitive::u8), - Mortal246(::core::primitive::u8), - Mortal247(::core::primitive::u8), - Mortal248(::core::primitive::u8), - Mortal249(::core::primitive::u8), - Mortal250(::core::primitive::u8), - Mortal251(::core::primitive::u8), - Mortal252(::core::primitive::u8), - Mortal253(::core::primitive::u8), - Mortal254(::core::primitive::u8), - Mortal255(::core::primitive::u8), - } - } - pub mod header { - use super::runtime_types; - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, - )] - 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< - ::subxt::sp_core::H256, - >, - #[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, - )] - pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - ::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)] - pub enum MultiAddress<_0, _1> { - Id(_0), - Index(_1), - Raw(::std::vec::Vec<::core::primitive::u8>), - Address32([::core::primitive::u8; 32usize]), - Address20([::core::primitive::u8; 20usize]), - } - } - pub mod traits { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct BlakeTwo256 {} - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum ArithmeticError { - Underflow, - Overflow, - DivisionByZero, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum DispatchError { - Other, - CannotLookup, - BadOrigin, - Module { - index: ::core::primitive::u8, - error: ::core::primitive::u8, - }, - ConsumerRemaining, - NoProviders, - Token(runtime_types::sp_runtime::TokenError), - Arithmetic(runtime_types::sp_runtime::ArithmeticError), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum MultiSignature { - Ed25519(runtime_types::sp_core::ed25519::Signature), - Sr25519(runtime_types::sp_core::sr25519::Signature), - Ecdsa(runtime_types::sp_core::ecdsa::Signature), - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub enum TokenError { - NoFunds, - WouldDie, - BelowMinimum, - CannotCreate, - UnknownAsset, - Frozen, - Unsupported, - } - } - pub mod sp_session { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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)] - pub struct OffenceDetails<_0, _1> { - pub offender: _1, - pub reporters: ::std::vec::Vec<_0>, - } - } - } - pub mod sp_transaction_storage_proof { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - pub struct TransactionStorageProof { - pub chunk: ::std::vec::Vec<::core::primitive::u8>, - pub proof: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, - } - } - pub mod sp_version { - use super::runtime_types; - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode)] - 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, - } - } - } - #[doc = r" Default configuration of common types for a target Substrate runtime."] - #[derive(Clone, Debug, Default, Eq, PartialEq)] - pub struct DefaultConfig; - impl ::subxt::Config for DefaultConfig { - type Index = u32; - type BlockNumber = u32; - type Hash = ::subxt::sp_core::H256; - type Hashing = ::subxt::sp_runtime::traits::BlakeTwo256; - type AccountId = ::subxt::sp_runtime::AccountId32; - type Address = ::subxt::sp_runtime::MultiAddress; - type Header = ::subxt::sp_runtime::generic::Header< - Self::BlockNumber, - ::subxt::sp_runtime::traits::BlakeTwo256, - >; - type Signature = ::subxt::sp_runtime::MultiSignature; - type Extrinsic = ::subxt::sp_runtime::OpaqueExtrinsic; - } - impl ::subxt::ExtrinsicExtraData for DefaultConfig { - type AccountData = AccountData; - type Extra = ::subxt::DefaultExtra; - } - pub type AccountData = self::system::storage::Account; - impl ::subxt::AccountData for AccountData { - fn nonce( - result: &::Value, - ) -> ::Index { - result.nonce - } - fn storage_entry( - account_id: ::AccountId, - ) -> Self { - Self(account_id) - } - } - pub struct RuntimeApi> { - pub client: ::subxt::Client, - } - impl ::core::convert::From<::subxt::Client> for RuntimeApi - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - fn from(client: ::subxt::Client) -> Self { - Self { client } - } - } - impl<'a, T> RuntimeApi - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn storage(&'a self) -> StorageApi<'a, T> { - StorageApi { - client: &self.client, - } - } - pub fn tx(&'a self) -> TransactionApi<'a, T> { - TransactionApi { - client: &self.client, - } - } - } - pub struct StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - client: &'a ::subxt::Client, - } - impl<'a, T> StorageApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn system(&self) -> system::storage::StorageApi<'a, T> { - system::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 authorship(&self) -> authorship::storage::StorageApi<'a, T> { - authorship::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 election_provider_multi_phase( - &self, - ) -> election_provider_multi_phase::storage::StorageApi<'a, T> { - election_provider_multi_phase::storage::StorageApi::new(self.client) - } - pub fn staking(&self) -> staking::storage::StorageApi<'a, T> { - staking::storage::StorageApi::new(self.client) - } - pub fn session(&self) -> session::storage::StorageApi<'a, T> { - session::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 elections(&self) -> elections::storage::StorageApi<'a, T> { - elections::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 grandpa(&self) -> grandpa::storage::StorageApi<'a, T> { - grandpa::storage::StorageApi::new(self.client) - } - pub fn treasury(&self) -> treasury::storage::StorageApi<'a, T> { - treasury::storage::StorageApi::new(self.client) - } - pub fn contracts(&self) -> contracts::storage::StorageApi<'a, T> { - contracts::storage::StorageApi::new(self.client) - } - pub fn sudo(&self) -> sudo::storage::StorageApi<'a, T> { - sudo::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 offences(&self) -> offences::storage::StorageApi<'a, T> { - offences::storage::StorageApi::new(self.client) - } - pub fn randomness_collective_flip( - &self, - ) -> randomness_collective_flip::storage::StorageApi<'a, T> { - randomness_collective_flip::storage::StorageApi::new(self.client) - } - pub fn identity(&self) -> identity::storage::StorageApi<'a, T> { - identity::storage::StorageApi::new(self.client) - } - pub fn society(&self) -> society::storage::StorageApi<'a, T> { - society::storage::StorageApi::new(self.client) - } - pub fn recovery(&self) -> recovery::storage::StorageApi<'a, T> { - recovery::storage::StorageApi::new(self.client) - } - pub fn vesting(&self) -> vesting::storage::StorageApi<'a, T> { - vesting::storage::StorageApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::storage::StorageApi<'a, T> { - scheduler::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 tips(&self) -> tips::storage::StorageApi<'a, T> { - tips::storage::StorageApi::new(self.client) - } - pub fn assets(&self) -> assets::storage::StorageApi<'a, T> { - assets::storage::StorageApi::new(self.client) - } - pub fn mmr(&self) -> mmr::storage::StorageApi<'a, T> { - mmr::storage::StorageApi::new(self.client) - } - pub fn lottery(&self) -> lottery::storage::StorageApi<'a, T> { - lottery::storage::StorageApi::new(self.client) - } - pub fn gilt(&self) -> gilt::storage::StorageApi<'a, T> { - gilt::storage::StorageApi::new(self.client) - } - pub fn uniques(&self) -> uniques::storage::StorageApi<'a, T> { - uniques::storage::StorageApi::new(self.client) - } - pub fn transaction_storage( - &self, - ) -> transaction_storage::storage::StorageApi<'a, T> { - transaction_storage::storage::StorageApi::new(self.client) - } - pub fn bags_list(&self) -> bags_list::storage::StorageApi<'a, T> { - bags_list::storage::StorageApi::new(self.client) - } - } - pub struct TransactionApi<'a, T: ::subxt::Config + ::subxt::ExtrinsicExtraData> { - client: &'a ::subxt::Client, - } - impl<'a, T> TransactionApi<'a, T> - where - T: ::subxt::Config + ::subxt::ExtrinsicExtraData, - { - pub fn system(&self) -> system::calls::TransactionApi<'a, T> { - system::calls::TransactionApi::new(self.client) - } - pub fn utility(&self) -> utility::calls::TransactionApi<'a, T> { - utility::calls::TransactionApi::new(self.client) - } - pub fn babe(&self) -> babe::calls::TransactionApi<'a, T> { - babe::calls::TransactionApi::new(self.client) - } - pub fn timestamp(&self) -> timestamp::calls::TransactionApi<'a, T> { - timestamp::calls::TransactionApi::new(self.client) - } - pub fn authorship(&self) -> authorship::calls::TransactionApi<'a, T> { - authorship::calls::TransactionApi::new(self.client) - } - pub fn indices(&self) -> indices::calls::TransactionApi<'a, T> { - indices::calls::TransactionApi::new(self.client) - } - pub fn balances(&self) -> balances::calls::TransactionApi<'a, T> { - balances::calls::TransactionApi::new(self.client) - } - pub fn election_provider_multi_phase( - &self, - ) -> election_provider_multi_phase::calls::TransactionApi<'a, T> { - election_provider_multi_phase::calls::TransactionApi::new(self.client) - } - pub fn staking(&self) -> staking::calls::TransactionApi<'a, T> { - staking::calls::TransactionApi::new(self.client) - } - pub fn session(&self) -> session::calls::TransactionApi<'a, T> { - session::calls::TransactionApi::new(self.client) - } - pub fn democracy(&self) -> democracy::calls::TransactionApi<'a, T> { - democracy::calls::TransactionApi::new(self.client) - } - pub fn council(&self) -> council::calls::TransactionApi<'a, T> { - council::calls::TransactionApi::new(self.client) - } - pub fn technical_committee( - &self, - ) -> technical_committee::calls::TransactionApi<'a, T> { - technical_committee::calls::TransactionApi::new(self.client) - } - pub fn elections(&self) -> elections::calls::TransactionApi<'a, T> { - elections::calls::TransactionApi::new(self.client) - } - pub fn technical_membership( - &self, - ) -> technical_membership::calls::TransactionApi<'a, T> { - technical_membership::calls::TransactionApi::new(self.client) - } - pub fn grandpa(&self) -> grandpa::calls::TransactionApi<'a, T> { - grandpa::calls::TransactionApi::new(self.client) - } - pub fn treasury(&self) -> treasury::calls::TransactionApi<'a, T> { - treasury::calls::TransactionApi::new(self.client) - } - pub fn contracts(&self) -> contracts::calls::TransactionApi<'a, T> { - contracts::calls::TransactionApi::new(self.client) - } - pub fn sudo(&self) -> sudo::calls::TransactionApi<'a, T> { - sudo::calls::TransactionApi::new(self.client) - } - pub fn im_online(&self) -> im_online::calls::TransactionApi<'a, T> { - im_online::calls::TransactionApi::new(self.client) - } - pub fn identity(&self) -> identity::calls::TransactionApi<'a, T> { - identity::calls::TransactionApi::new(self.client) - } - pub fn society(&self) -> society::calls::TransactionApi<'a, T> { - society::calls::TransactionApi::new(self.client) - } - pub fn recovery(&self) -> recovery::calls::TransactionApi<'a, T> { - recovery::calls::TransactionApi::new(self.client) - } - pub fn vesting(&self) -> vesting::calls::TransactionApi<'a, T> { - vesting::calls::TransactionApi::new(self.client) - } - pub fn scheduler(&self) -> scheduler::calls::TransactionApi<'a, T> { - scheduler::calls::TransactionApi::new(self.client) - } - pub fn proxy(&self) -> proxy::calls::TransactionApi<'a, T> { - proxy::calls::TransactionApi::new(self.client) - } - pub fn multisig(&self) -> multisig::calls::TransactionApi<'a, T> { - multisig::calls::TransactionApi::new(self.client) - } - pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T> { - bounties::calls::TransactionApi::new(self.client) - } - pub fn tips(&self) -> tips::calls::TransactionApi<'a, T> { - tips::calls::TransactionApi::new(self.client) - } - pub fn assets(&self) -> assets::calls::TransactionApi<'a, T> { - assets::calls::TransactionApi::new(self.client) - } - pub fn lottery(&self) -> lottery::calls::TransactionApi<'a, T> { - lottery::calls::TransactionApi::new(self.client) - } - pub fn gilt(&self) -> gilt::calls::TransactionApi<'a, T> { - gilt::calls::TransactionApi::new(self.client) - } - pub fn uniques(&self) -> uniques::calls::TransactionApi<'a, T> { - uniques::calls::TransactionApi::new(self.client) - } - pub fn transaction_storage( - &self, - ) -> transaction_storage::calls::TransactionApi<'a, T> { - transaction_storage::calls::TransactionApi::new(self.client) - } - pub fn bags_list(&self) -> bags_list::calls::TransactionApi<'a, T> { - bags_list::calls::TransactionApi::new(self.client) - } - } -} + diff --git a/tests/integration/runtime.rs b/tests/integration/runtime.rs index 0d4a60ed50..cccef567f4 100644 --- a/tests/integration/runtime.rs +++ b/tests/integration/runtime.rs @@ -18,4 +18,7 @@ runtime_metadata_path = "tests/integration/node_runtime.scale", generated_type_derives = "Debug, Eq, PartialEq" )] -pub mod node_runtime {} +pub mod node_runtime { + #[subxt(substitute_type = "sp_arithmetic::per_things::Perbill")] + use sp_runtime::Perbill; +} From 6306b9fc073b59133566cfabf9502c99d2703161 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 09:51:50 +0000 Subject: [PATCH 204/216] Remove todos regarding maintaining Rust code items, promoted to follow up issue. --- codegen/src/api/mod.rs | 1 - codegen/src/ir.rs | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 5b96cdea23..fe4e68d4cb 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -201,7 +201,6 @@ impl RuntimeGenerator { } }; - // todo: [AJ] keep all other code items from decorated mod? let mod_ident = item_mod_ir.ident; let pallets_with_storage = pallets_with_mod_names diff --git a/codegen/src/ir.rs b/codegen/src/ir.rs index 3304f28313..429d0d9acd 100644 --- a/codegen/src/ir.rs +++ b/codegen/src/ir.rs @@ -21,11 +21,9 @@ use syn::{ token, }; -// todo: [AJ] implement ToTokens for this to generate the actual mod -// todo: [AJ] figure out how to incorporate the types and api codegen here... #[derive(Debug, PartialEq, Eq)] pub struct ItemMod { - // attrs: Vec, // todo: [AJ] partition attributes between subxt and non-subxt + // attrs: Vec, vis: syn::Visibility, mod_token: token::Mod, pub ident: syn::Ident, From 5dd6cf9baa8ade6c8092e036d5dddd26b7eed310 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 09:54:34 +0000 Subject: [PATCH 205/216] Remove todo regarding overridding default config impl --- codegen/src/api/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index fe4e68d4cb..3a91df3226 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -223,7 +223,6 @@ impl RuntimeGenerator { #types_mod /// Default configuration of common types for a target Substrate runtime. - // todo: allow to define/override this as part of the annotated mod #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct DefaultConfig; From fc30e90282a2537b32e77a0330106f6979e0cb5a Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 09:57:32 +0000 Subject: [PATCH 206/216] Remove todo regarding overridding default Extra --- codegen/src/api/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 3a91df3226..4171b80071 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -242,7 +242,6 @@ impl RuntimeGenerator { impl ::subxt::ExtrinsicExtraData for DefaultConfig { type AccountData = AccountData; - // todo: [AJ] make this configurable or auto-generated from metadata type Extra = ::subxt::DefaultExtra; } From 63bb5ea80ae43ee10da11ec8cda105e3bf9125f1 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 09:58:56 +0000 Subject: [PATCH 207/216] Remove todo regarding AccountData storage type defintion --- codegen/src/api/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 4171b80071..bc46d02745 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -245,7 +245,6 @@ impl RuntimeGenerator { type Extra = ::subxt::DefaultExtra; } - // todo: [AJ] check for this type's existence or allow config pub type AccountData = self::system::storage::Account; impl ::subxt::AccountData for AccountData { From 84fe1a0fd19b8cf767a1b6067af739bbe5589744 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:04:43 +0000 Subject: [PATCH 208/216] Remove todo regarding borrowing storage key arguments --- codegen/src/api/storage.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen/src/api/storage.rs b/codegen/src/api/storage.rs index e4dab4dd5b..22310f30ae 100644 --- a/codegen/src/api/storage.rs +++ b/codegen/src/api/storage.rs @@ -205,7 +205,7 @@ fn generate_storage_entry_fns( let key_args = fields .iter() - .map(|(field_name, field_type)| quote!( #field_name: #field_type )); // todo: [AJ] borrow non build-inf types? + .map(|(field_name, field_type)| quote!( #field_name: #field_type )); let client_fns = quote! { pub async fn #fn_name( &self, From 6886f4c8f4c6616c9ae17ac91dd675e999143a98 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:07:17 +0000 Subject: [PATCH 209/216] Remove type substitution tests todo --- codegen/src/types/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen/src/types/mod.rs b/codegen/src/types/mod.rs index c59501de1f..73b8b9d062 100644 --- a/codegen/src/types/mod.rs +++ b/codegen/src/types/mod.rs @@ -195,7 +195,6 @@ impl<'a> TypeGenerator<'a> { path: substitute_type_path.clone(), params, }) - // todo: add tests for this type substitution } else { TypePath::Type(TypePathType { ty, From 63641b446c8bbdc1423c7a8e09776221ea8f750c Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:08:38 +0000 Subject: [PATCH 210/216] Remove `Box` field name type hack todo --- codegen/src/types/type_def.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index ee9f9b1c82..7d86845a17 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -201,7 +201,6 @@ impl<'a> TypeDefGen<'a> { let ty_toks = |ty_name: &str, ty_path: &TypePath| { if ty_name.contains("Box<") { - // todo [AJ] remove this hack once scale-info can represent Box somehow quote! { ::std::boxed::Box<#ty_path> } } else { quote! { #ty_path } From ba2e3a81296084d2f91647a72fc55c14150dcdbe Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:11:02 +0000 Subject: [PATCH 211/216] Remove Compact todo --- codegen/src/types/type_def.rs | 1 - codegen/src/types/type_path.rs | 2 -- 2 files changed, 3 deletions(-) diff --git a/codegen/src/types/type_def.rs b/codegen/src/types/type_def.rs index 7d86845a17..12071296f0 100644 --- a/codegen/src/types/type_def.rs +++ b/codegen/src/types/type_def.rs @@ -239,7 +239,6 @@ impl<'a> TypeDefGen<'a> { } }; if ty.is_compact() { - // todo: [AJ] figure out way to ensure AsCompact generated for target type in scale_info. quote!( #[codec(compact)] #field_type ) } else { quote!( #field_type ) diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs index 983b8283e0..186619cbf0 100644 --- a/codegen/src/types/type_path.rs +++ b/codegen/src/types/type_path.rs @@ -172,8 +172,6 @@ impl TypePathType { syn::Type::Path(path) } TypeDef::Compact(_) => { - // todo: change the return type of this method to include info that it is compact - // and should be annotated with #[compact] for fields let compact_type = &self.params[0]; syn::Type::Path(parse_quote! ( #compact_type )) } From 06a6ddfa5f96d44ec00e4c89c013fdefd3686da3 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:15:21 +0000 Subject: [PATCH 212/216] Remove sudo todos --- tests/integration/frame/sudo.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/integration/frame/sudo.rs b/tests/integration/frame/sudo.rs index 7ddeddfe3a..071f650437 100644 --- a/tests/integration/frame/sudo.rs +++ b/tests/integration/frame/sudo.rs @@ -26,7 +26,6 @@ use assert_matches::assert_matches; use sp_keyring::AccountKeyring; use subxt::extrinsic::PairSigner; -// todo: [AJ] supply alias for top level call types? runtime_types::node_runtime::Call type Call = runtime_types::node_runtime::Call; type BalancesCall = runtime_types::pallet_balances::pallet::Call; @@ -36,7 +35,6 @@ async fn test_sudo() { let bob = AccountKeyring::Bob.to_account_id().clone().into(); let cxt = test_context().await; - // todo: [AJ] allow encoded call to be constructed dynamically let call = Call::Balances(BalancesCall::transfer { dest: bob, value: 10_000, From 0d07b0c91ec06a46e5ff5776f90d4cd7bda0b96d Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:19:27 +0000 Subject: [PATCH 213/216] Remove BitVec implementation todo --- src/events.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events.rs b/src/events.rs index a56e3851ce..4a4948eb11 100644 --- a/src/events.rs +++ b/src/events.rs @@ -316,7 +316,7 @@ where } TypeDef::BitSequence(_bitseq) => { // decode_raw:: - todo!("BitVec") + unimplemented!("BitVec decoding for events not implemented yet") } } } From f0bb889dc934b41ff038f6cbdd678f0eab1fc62e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 10:24:50 +0000 Subject: [PATCH 214/216] Fmt --- src/events.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/events.rs b/src/events.rs index 4a4948eb11..634ff10e5a 100644 --- a/src/events.rs +++ b/src/events.rs @@ -298,20 +298,31 @@ where TypeDef::Composite(composite) => { match composite.fields() { [field] => { - let field_ty = self - .metadata - .resolve_type(field.ty().id()) - .ok_or(MetadataError::TypeNotFound(field.ty().id()))?; - if let TypeDef::Primitive(primitive) = field_ty.type_def() { + let field_ty = + self.metadata.resolve_type(field.ty().id()).ok_or( + MetadataError::TypeNotFound(field.ty().id()), + )?; + if let TypeDef::Primitive(primitive) = field_ty.type_def() + { decode_compact_primitive(primitive) } else { Err(EventsDecodingError::InvalidCompactType("Composite type must have a single primitive field".into()).into()) } } - _ => Err(EventsDecodingError::InvalidCompactType("Composite type must have a single field".into()).into()) + _ => { + Err(EventsDecodingError::InvalidCompactType( + "Composite type must have a single field".into(), + ) + .into()) + } } } - _ => Err(EventsDecodingError::InvalidCompactType("Compact type must be a primitive or a composite type".into()).into()), + _ => { + Err(EventsDecodingError::InvalidCompactType( + "Compact type must be a primitive or a composite type".into(), + ) + .into()) + } } } TypeDef::BitSequence(_bitseq) => { From 2c93f3c371663288c07d142e1457487ce0198389 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 11:06:20 +0000 Subject: [PATCH 215/216] Add health warning to README --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8bf7e46084..71ba92bba8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ A library to **sub**mit e**xt**rinsics to a [substrate](https://github.com/paritytech/substrate) node via RPC. +### :warning: Health Warning: considered *alpha* after recent changes, API still subject to change :warning: + +#### See https://github.com/paritytech/subxt/issues/309 for an overview of outstanding issues. + ## Usage See [examples](./examples). From 641ac27680577f0fd538d86973e14cb224020d2e Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Wed, 3 Nov 2021 11:11:52 +0000 Subject: [PATCH 216/216] Fix up health warning --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71ba92bba8..010b601fb3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A library to **sub**mit e**xt**rinsics to a [substrate](https://github.com/paritytech/substrate) node via RPC. -### :warning: Health Warning: considered *alpha* after recent changes, API still subject to change :warning: +### :warning: Health Warning :warning: considered *alpha* after recent changes, API still subject to change #### See https://github.com/paritytech/subxt/issues/309 for an overview of outstanding issues.