From f7192313d4393fb89224f60785528d654476f8d0 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 18 Oct 2022 17:36:33 +0100 Subject: [PATCH 01/17] First pass adding functions to get blocks and extrinsics --- examples/examples/custom_config.rs | 1 - .../examples/rpc_call_subscribe_blocks.rs | 2 +- subxt/src/blocks/block_types.rs | 188 ++++++++++++++++++ subxt/src/blocks/blocks_client.rs | 121 ++++++++--- subxt/src/blocks/mod.rs | 6 + subxt/src/config.rs | 6 - subxt/src/error.rs | 11 + subxt/src/events/events_client.rs | 6 + subxt/src/events/events_type.rs | 2 + subxt/src/rpc/rpc.rs | 47 ++++- subxt/src/tx/mod.rs | 1 - subxt/src/tx/tx_progress.rs | 88 +------- testing/integration-tests/src/blocks/mod.rs | 2 +- testing/integration-tests/src/client/mod.rs | 4 +- .../src/utils/wait_for_blocks.rs | 2 +- 15 files changed, 355 insertions(+), 132 deletions(-) create mode 100644 subxt/src/blocks/block_types.rs diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index d9b2c95f5a..d0caba54b1 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -39,7 +39,6 @@ impl Config for MyConfig { type Address = ::Address; type Header = ::Header; type Signature = ::Signature; - type Extrinsic = ::Extrinsic; // ExtrinsicParams makes use of the index type, so we need to adjust it // too to align with our modified index type, above: type ExtrinsicParams = SubstrateExtrinsicParams; diff --git a/examples/examples/rpc_call_subscribe_blocks.rs b/examples/examples/rpc_call_subscribe_blocks.rs index cc2095200d..232ef46ae1 100644 --- a/examples/examples/rpc_call_subscribe_blocks.rs +++ b/examples/examples/rpc_call_subscribe_blocks.rs @@ -29,7 +29,7 @@ async fn main() -> Result<(), Box> { // For non-finalised blocks use `.subscribe_blocks()` let mut blocks: Subscription> = - api.rpc().subscribe_finalized_blocks().await?; + api.rpc().subscribe_finalized_block_headers().await?; while let Some(Ok(block)) = blocks.next().await { println!( diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs new file mode 100644 index 0000000000..7616217894 --- /dev/null +++ b/subxt/src/blocks/block_types.rs @@ -0,0 +1,188 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +use crate::{ + Config, + error::{ + Error, + }, + client::{ + OfflineClientT, + OnlineClientT, + }, + rpc::{ + ChainBlockResponse, + }, + events +}; +use derivative::Derivative; +use sp_runtime::traits::Hash; + +/// A representation of a block from which you can obtain details +/// including the block header, extrinsics and events for the block. +pub struct Block { + hash: T::Hash, + details: ChainBlockResponse, + client: C, +} + +impl Block +where + T: Config, + C: OfflineClientT +{ + pub (crate) fn new( + hash: T::Hash, + details: ChainBlockResponse, + client: C + ) -> Self { + Block { + hash, details, client + } + } + + /// Return the block hash. + pub fn hash(&self) -> T::Hash { + self.hash + } + + /// Return the block header. + pub fn header(&self) -> &T::Header { + &self.details.block.header + } + + /// Returns an iterator over the extrinsics in the block. + pub fn extrinsics<'a>(&'a self) -> impl Iterator> { + self.details.block.extrinsics.iter().enumerate().map(|(idx, e)| { + Extrinsic { + index: idx as u32, + bytes: &e.0, + client: self.client.clone(), + block_hash: self.hash, + _marker: std::marker::PhantomData + } + }) + } +} + +/// A single extrinsic in a block. +pub struct Extrinsic<'a, T: Config, C> { + index: u32, + bytes: &'a [u8], + client: C, + block_hash: T::Hash, + _marker: std::marker::PhantomData +} + +impl <'a, T, C> Extrinsic<'a, T, C> +where + T: Config, + C: OfflineClientT +{ + /// The index of the extrinsic in the block. + pub fn index(&self) -> u32 { + self.index + } + + /// The bytes of the extrinsic. + pub fn bytes(&self) -> &'a [u8] { + &self.bytes + } +} + +impl <'a, T, C> Extrinsic<'a, T, C> +where + T: Config, + C: OnlineClientT +{ + /// The events associated with the extrinsic. + pub async fn events(&self) -> Result, Error> { + let ext_hash = T::Hashing::hash_of(&self.bytes); + let events = events::EventsClient::new(self.client.clone()) + .at(Some(self.block_hash)) + .await?; + + Ok(ExtrinsicEvents::new(ext_hash, self.index, events)) + } +} + +/// The events associated with a given extrinsic. +#[derive(Derivative)] +#[derivative(Debug(bound = ""))] +pub struct ExtrinsicEvents { + // The hash of the extrinsic (handy to expose here because + // this type is returned from TxProgress things in the most + // basic flows, so it's the only place people can access it + // without complicating things for themselves). + ext_hash: T::Hash, + // The index of the extrinsic: + idx: u32, + // All of the events in the block: + events: events::Events +} + +impl ExtrinsicEvents { + pub (crate) fn new( + ext_hash: T::Hash, + idx: u32, + events: events::Events + ) -> Self { + Self { ext_hash, idx, events } + } + + /// Return the hash of the block that the extrinsic is in. + pub fn block_hash(&self) -> T::Hash { + self.events.block_hash() + } + + /// Return the hash of the extrinsic. + pub fn extrinsic_hash(&self) -> T::Hash { + self.ext_hash + } + + /// Return all of the events in the block that the extrinsic is in. + pub fn all_events_in_block(&self) -> &events::Events { + &self.events + } + + /// Iterate over all of the raw events associated with this transaction. + /// + /// This works in the same way that [`events::Events::iter()`] does, with the + /// exception that it filters out events not related to the submitted extrinsic. + pub fn iter(&self) -> impl Iterator> + '_ { + self.events.iter().filter(|ev| { + ev.as_ref() + .map(|ev| ev.phase() == events::Phase::ApplyExtrinsic(self.idx)) + .unwrap_or(true) // Keep any errors. + }) + } + + /// Find all of the transaction events matching the event type provided as a generic parameter. + /// + /// This works in the same way that [`events::Events::find()`] does, with the + /// exception that it filters out events not related to the submitted extrinsic. + pub fn find(&self) -> impl Iterator> + '_ { + self.iter().filter_map(|ev| { + ev.and_then(|ev| ev.as_event::().map_err(Into::into)) + .transpose() + }) + } + + /// Iterate through the transaction events using metadata to dynamically decode and skip + /// them, and return the first event found which decodes to the provided `Ev` type. + /// + /// This works in the same way that [`events::Events::find_first()`] does, with the + /// exception that it ignores events not related to the submitted extrinsic. + pub fn find_first(&self) -> Result, Error> { + self.find::().next().transpose() + } + + /// Find an event in those associated with this transaction. Returns true if it was found. + /// + /// This works in the same way that [`events::Events::has()`] does, with the + /// exception that it ignores events not related to the submitted extrinsic. + pub fn has(&self) -> Result { + Ok(self.find::().next().transpose()?.is_some()) + } +} diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index 190ec9f4f1..6bee110217 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -4,7 +4,10 @@ use crate::{ client::OnlineClientT, - error::Error, + error::{ + Error, + BlockError + }, utils::PhantomDataSendSync, Config, }; @@ -17,6 +20,9 @@ use futures::{ }; use sp_runtime::traits::Header; use std::future::Future; +use super::{ + Block +}; /// A client for working with blocks. #[derive(Derivative)] @@ -41,6 +47,72 @@ where T: Config, Client: OnlineClientT, { + /// Obtain block details given the provided block hash, or the latest block if `None` is + /// provided. + pub fn at( + &self, + block_hash: Option + ) -> impl Future, Error>> + Send + 'static { + let client = self.client.clone(); + async move { + // If block hash is not provided, get the hash + // for the latest block and use that. + let block_hash = match block_hash { + Some(hash) => hash, + None => { + client + .rpc() + .block_hash(None) + .await? + .expect("didn't pass a block number; qed") + } + }; + + let res = match client.rpc().block(Some(block_hash)).await? { + Some(block) => block, + None => return Err(BlockError::BlockHashNotFound(hex::encode(block_hash)).into()) + }; + + Ok(Block::new(block_hash, res, client)) + } + } + + /// Subscribe to finalized blocks. + /// + /// This builds upon [`BlocksClient::subscribe_finalized_headers`] and returns details for + /// each block once it is finalized. + pub fn subscribe_finalized( + &self, + ) -> impl Future, Error>>, Error>> + + Send + + 'static { + let this = self.clone(); + async move { + let client = this.client.clone(); + let sub = this + .subscribe_finalized_headers() + .await? + .then(move |header| { + let client = client.clone(); + async move { + let header = match header { + Ok(header) => header, + Err(e) => return Err(e) + }; + + let block_hash = header.hash(); + let block_details = match client.rpc().block(Some(block_hash)).await? { + Some(block) => block, + None => return Err(BlockError::BlockHashNotFound(hex::encode(block_hash)).into()) + }; + + Ok(Block::new(block_hash, block_details, client)) + } + }); + Ok(sub) + } + } + /// Subscribe to new best block headers. /// /// # Note @@ -58,47 +130,38 @@ where + Send + 'static { let client = self.client.clone(); - async move { client.rpc().subscribe_blocks().await } + async move { client.rpc().subscribe_block_headers().await } } /// Subscribe to finalized block headers. /// /// While the Substrate RPC method does not guarantee that all finalized block headers are /// provided, this function does. - /// ``` pub fn subscribe_finalized_headers( &self, ) -> impl Future>, Error>> + Send + 'static { let client = self.client.clone(); - async move { subscribe_finalized_headers(client).await } - } -} + async move { + // Fetch the last finalised block details immediately, so that we'll get + // all blocks after this one. + let last_finalized_block_hash = client.rpc().finalized_head().await?; + let last_finalized_block_num = client + .rpc() + .header(Some(last_finalized_block_hash)) + .await? + .map(|h| (*h.number()).into()); -async fn subscribe_finalized_headers( - client: Client, -) -> Result>, Error> -where - T: Config, - Client: OnlineClientT, -{ - // Fetch the last finalised block details immediately, so that we'll get - // all blocks after this one. - let last_finalized_block_hash = client.rpc().finalized_head().await?; - let last_finalized_block_num = client - .rpc() - .header(Some(last_finalized_block_hash)) - .await? - .map(|h| (*h.number()).into()); - - let sub = client.rpc().subscribe_finalized_blocks().await?; - - // Adjust the subscription stream to fill in any missing blocks. - Ok( - subscribe_to_block_headers_filling_in_gaps(client, last_finalized_block_num, sub) - .boxed(), - ) + let sub = client.rpc().subscribe_finalized_block_headers().await?; + + // Adjust the subscription stream to fill in any missing blocks. + Ok( + subscribe_to_block_headers_filling_in_gaps(client, last_finalized_block_num, sub) + .boxed(), + ) + } + } } /// Note: This is exposed for testing but is not considered stable and may change diff --git a/subxt/src/blocks/mod.rs b/subxt/src/blocks/mod.rs index f3a575e8bd..446144092e 100644 --- a/subxt/src/blocks/mod.rs +++ b/subxt/src/blocks/mod.rs @@ -5,8 +5,14 @@ //! This module exposes the necessary functionality for working with events. mod blocks_client; +mod block_types; pub use blocks_client::{ subscribe_to_block_headers_filling_in_gaps, BlocksClient, }; +pub use block_types::{ + Block, + Extrinsic, + ExtrinsicEvents, +}; \ No newline at end of file diff --git a/subxt/src/config.rs b/subxt/src/config.rs index e7a7a0efba..ddd04d763c 100644 --- a/subxt/src/config.rs +++ b/subxt/src/config.rs @@ -16,7 +16,6 @@ use codec::{ use core::fmt::Debug; use sp_runtime::traits::{ AtLeast32Bit, - Extrinsic, Hash, Header, MaybeSerializeDeserialize, @@ -78,9 +77,6 @@ pub trait Config: 'static { /// Signature type. type Signature: Verify + Encode + Send + Sync + 'static; - /// Extrinsic type within blocks. - type Extrinsic: Parameter + Extrinsic + Debug + MaybeSerializeDeserialize + Send; - /// This type defines the extrinsic extra and additional parameters. type ExtrinsicParams: crate::tx::ExtrinsicParams; } @@ -104,7 +100,6 @@ impl Config for SubstrateConfig { type Header = sp_runtime::generic::Header; type Signature = sp_runtime::MultiSignature; - type Extrinsic = sp_runtime::OpaqueExtrinsic; type ExtrinsicParams = crate::tx::SubstrateExtrinsicParams; } @@ -145,6 +140,5 @@ impl> Config type Address = T::Address; type Header = T::Header; type Signature = T::Signature; - type Extrinsic = T::Extrinsic; type ExtrinsicParams = E; } diff --git a/subxt/src/error.rs b/subxt/src/error.rs index 04f1ed9134..c01389692a 100644 --- a/subxt/src/error.rs +++ b/subxt/src/error.rs @@ -63,6 +63,9 @@ pub enum Error { /// Transaction progress error. #[error("Transaction error: {0}")] Transaction(#[from] TransactionError), + /// Block related error. + #[error("Block error: {0}")] + Block(#[from] BlockError), /// An error encoding a storage address. #[error("Error encoding storage address: {0}")] StorageAddress(#[from] StorageAddressError), @@ -230,6 +233,14 @@ impl DispatchError { } } +/// Block error +#[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] +pub enum BlockError { + /// The block + #[error("Could not find a block with hash {0} (perhaps it was on a non-finalized fork?)")] + BlockHashNotFound(String), +} + /// Transaction error. #[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] pub enum TransactionError { diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs index fc19231cf9..42fa5071f4 100644 --- a/subxt/src/events/events_client.rs +++ b/subxt/src/events/events_client.rs @@ -44,6 +44,12 @@ where Client: OnlineClientT, { /// Obtain events at some block hash. + /// + /// # Warning + /// + /// This call only supports blocks produced since the most recent + /// runtime upgrade. You can attempt to retrieve events from older blocks, + /// but may run into errors attempting to work with them. pub fn at( &self, block_hash: Option, diff --git a/subxt/src/events/events_type.rs b/subxt/src/events/events_type.rs index f14e245877..a9aa21c875 100644 --- a/subxt/src/events/events_type.rs +++ b/subxt/src/events/events_type.rs @@ -83,6 +83,8 @@ impl Events { /// Iterate over all of the events, using metadata to dynamically /// decode them as we go, and returning the raw bytes and other associated /// details. If an error occurs, all subsequent iterations return `None`. + // Dev note: The returned iterator is 'static + Send so that we can box it up and make + // use of it with our `FilterEvents` stuff. pub fn iter( &self, ) -> impl Iterator> + Send + Sync + 'static { diff --git a/subxt/src/rpc/rpc.rs b/subxt/src/rpc/rpc.rs index f8f54823df..52ccf85455 100644 --- a/subxt/src/rpc/rpc.rs +++ b/subxt/src/rpc/rpc.rs @@ -70,10 +70,6 @@ use sp_core::{ U256, }; use sp_runtime::{ - generic::{ - Block, - SignedBlock, - }, ApplyExtrinsicResult, }; use std::{ @@ -98,9 +94,40 @@ pub enum NumberOrHex { Hex(U256), } -/// Alias for the type of a block returned by `chain_getBlock` -pub type ChainBlock = - SignedBlock::Header, ::Extrinsic>>; +/// The response from `chain_getBlock` +#[derive(Debug, Deserialize)] +#[serde(bound = "T: Config")] +pub struct ChainBlockResponse { + /// The block itself. + pub block: ChainBlock, + /// Block justification. + pub justifications: Option +} + +/// Block details in the [`ChainBlockResponse`]. +#[derive(Debug, Deserialize)] +pub struct ChainBlock { + /// The block header. + pub header: T::Header, + /// The accompanying extrinsics. + pub extrinsics: Vec, +} + +/// Bytes representing an extrinsic in a [`ChainBlock`]. +#[derive(Debug)] +pub struct ChainBlockExtrinsic(pub Vec); + +impl<'a> ::serde::Deserialize<'a> for ChainBlockExtrinsic { + fn deserialize(de: D) -> Result + where + D: ::serde::Deserializer<'a>, + { + let r = sp_core::bytes::deserialize(de)?; + let bytes = Decode::decode(&mut &r[..]) + .map_err(|e| ::serde::de::Error::custom(format!("Decode error: {}", e)))?; + Ok(ChainBlockExtrinsic(bytes)) + } +} /// Wrapper for NumberOrHex to allow custom From impls #[derive(Serialize)] @@ -498,7 +525,7 @@ impl Rpc { pub async fn block( &self, hash: Option, - ) -> Result>, Error> { + ) -> Result>, Error> { let params = rpc_params![hash]; let block = self.client.request("chain_getBlock", params).await?; Ok(block) @@ -544,7 +571,7 @@ impl Rpc { } /// Subscribe to blocks. - pub async fn subscribe_blocks(&self) -> Result, Error> { + pub async fn subscribe_block_headers(&self) -> Result, Error> { let subscription = self .client .subscribe( @@ -558,7 +585,7 @@ impl Rpc { } /// Subscribe to finalized blocks. - pub async fn subscribe_finalized_blocks( + pub async fn subscribe_finalized_block_headers( &self, ) -> Result, Error> { let subscription = self diff --git a/subxt/src/tx/mod.rs b/subxt/src/tx/mod.rs index 8288898efb..cb0fcd4e51 100644 --- a/subxt/src/tx/mod.rs +++ b/subxt/src/tx/mod.rs @@ -52,7 +52,6 @@ pub use self::{ TxPayload, }, tx_progress::{ - TxEvents, TxInBlock, TxProgress, TxStatus, diff --git a/subxt/src/tx/tx_progress.rs b/subxt/src/tx/tx_progress.rs index 9cbf752164..74205fa329 100644 --- a/subxt/src/tx/tx_progress.rs +++ b/subxt/src/tx/tx_progress.rs @@ -15,12 +15,7 @@ use crate::{ TransactionError, }, events::{ - self, - EventDetails, - Events, EventsClient, - Phase, - StaticEvent, }, rpc::{ Subscription, @@ -147,7 +142,7 @@ where /// may well indicate with some probability that the transaction will not make it into a block, /// there is no guarantee that this is true. Thus, we prefer to "play it safe" here. Use the lower /// level [`TxProgress::next_item()`] API if you'd like to handle these statuses yourself. - pub async fn wait_for_finalized_success(self) -> Result, Error> { + pub async fn wait_for_finalized_success(self) -> Result, Error> { let evs = self.wait_for_finalized().await?.wait_for_success().await?; Ok(evs) } @@ -343,7 +338,7 @@ impl> TxInBlock { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn wait_for_success(&self) -> Result, Error> { + pub async fn wait_for_success(&self) -> Result, Error> { let events = self.fetch_events().await?; // Try to find any errors; return the first one we encounter. @@ -365,7 +360,7 @@ impl> TxInBlock { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn fetch_events(&self) -> Result, Error> { + pub async fn fetch_events(&self) -> Result, Error> { let block = self .client .rpc() @@ -376,7 +371,7 @@ impl> TxInBlock { let extrinsic_idx = block.block.extrinsics .iter() .position(|ext| { - let hash = T::Hashing::hash_of(ext); + let hash = T::Hashing::hash_of(&ext.0); hash == self.ext_hash }) // If we successfully obtain the block hash we think contains our @@ -387,77 +382,10 @@ impl> TxInBlock { .at(Some(self.block_hash)) .await?; - Ok(TxEvents { - ext_hash: self.ext_hash, - ext_idx: extrinsic_idx as u32, + Ok(crate::blocks::ExtrinsicEvents::new( + self.ext_hash, + extrinsic_idx as u32, events, - }) - } -} - -/// This represents the events related to our transaction. -/// We can iterate over the events, or look for a specific one. -#[derive(Derivative)] -#[derivative(Debug(bound = ""))] -pub struct TxEvents { - ext_hash: T::Hash, - ext_idx: u32, - events: Events, -} - -impl TxEvents { - /// Return the hash of the block that the transaction has made it into. - pub fn block_hash(&self) -> T::Hash { - self.events.block_hash() - } - - /// Return the hash of the extrinsic. - pub fn extrinsic_hash(&self) -> T::Hash { - self.ext_hash - } - - /// Return all of the events in the block that the transaction made it into. - pub fn all_events_in_block(&self) -> &events::Events { - &self.events - } - - /// Iterate over all of the raw events associated with this transaction. - /// - /// This works in the same way that [`events::Events::iter()`] does, with the - /// exception that it filters out events not related to the submitted extrinsic. - pub fn iter(&self) -> impl Iterator> + '_ { - self.events.iter().filter(|ev| { - ev.as_ref() - .map(|ev| ev.phase() == Phase::ApplyExtrinsic(self.ext_idx)) - .unwrap_or(true) // Keep any errors. - }) - } - - /// Find all of the transaction events matching the event type provided as a generic parameter. - /// - /// This works in the same way that [`events::Events::find()`] does, with the - /// exception that it filters out events not related to the submitted extrinsic. - pub fn find(&self) -> impl Iterator> + '_ { - self.iter().filter_map(|ev| { - ev.and_then(|ev| ev.as_event::().map_err(Into::into)) - .transpose() - }) - } - - /// Iterate through the transaction events using metadata to dynamically decode and skip - /// them, and return the first event found which decodes to the provided `Ev` type. - /// - /// This works in the same way that [`events::Events::find_first()`] does, with the - /// exception that it ignores events not related to the submitted extrinsic. - pub fn find_first(&self) -> Result, Error> { - self.find::().next().transpose() - } - - /// Find an event in those associated with this transaction. Returns true if it was found. - /// - /// This works in the same way that [`events::Events::has()`] does, with the - /// exception that it ignores events not related to the submitted extrinsic. - pub fn has(&self) -> Result { - Ok(self.find::().next().transpose()?.is_some()) + )) } } diff --git a/testing/integration-tests/src/blocks/mod.rs b/testing/integration-tests/src/blocks/mod.rs index 3ec348b6d2..c8c264deca 100644 --- a/testing/integration-tests/src/blocks/mod.rs +++ b/testing/integration-tests/src/blocks/mod.rs @@ -52,7 +52,7 @@ async fn missing_block_headers_will_be_filled_in() -> Result<(), subxt::Error> { // that there will be some gaps, even if there aren't any from the subscription. let some_finalized_blocks = api .rpc() - .subscribe_finalized_blocks() + .subscribe_finalized_block_headers() .await? .enumerate() .take(6) diff --git a/testing/integration-tests/src/client/mod.rs b/testing/integration-tests/src/client/mod.rs index b8aa43f535..05f5818b6c 100644 --- a/testing/integration-tests/src/client/mod.rs +++ b/testing/integration-tests/src/client/mod.rs @@ -78,7 +78,7 @@ async fn chain_subscribe_blocks() { let ctx = test_context().await; let api = ctx.client(); - let mut blocks = api.rpc().subscribe_blocks().await.unwrap(); + let mut blocks = api.rpc().subscribe_block_headers().await.unwrap(); blocks.next().await.unwrap().unwrap(); } @@ -87,7 +87,7 @@ async fn chain_subscribe_finalized_blocks() { let ctx = test_context().await; let api = ctx.client(); - let mut blocks = api.rpc().subscribe_finalized_blocks().await.unwrap(); + let mut blocks = api.rpc().subscribe_finalized_block_headers().await.unwrap(); blocks.next().await.unwrap().unwrap(); } diff --git a/testing/integration-tests/src/utils/wait_for_blocks.rs b/testing/integration-tests/src/utils/wait_for_blocks.rs index 0d190ec8ec..e5b84b37d4 100644 --- a/testing/integration-tests/src/utils/wait_for_blocks.rs +++ b/testing/integration-tests/src/utils/wait_for_blocks.rs @@ -11,7 +11,7 @@ use subxt::{ /// (the genesis block and another one) seems to be enough to allow tests /// like `dry_run_passes` to work properly. pub async fn wait_for_blocks(api: &impl OnlineClientT) { - let mut sub = api.rpc().subscribe_blocks().await.unwrap(); + let mut sub = api.rpc().subscribe_block_headers().await.unwrap(); sub.next().await; sub.next().await; } From 8b1285f4a593d398cc0cedfd305bd33fc951696e Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 19 Oct 2022 11:36:44 +0100 Subject: [PATCH 02/17] cargo fmt and cache block events --- subxt/src/blocks/block_types.rs | 104 +++++++++++++++++------------- subxt/src/blocks/blocks_client.rs | 45 ++++++++----- subxt/src/blocks/mod.rs | 12 ++-- subxt/src/error.rs | 4 +- subxt/src/events/events_type.rs | 2 +- subxt/src/rpc/rpc.rs | 32 ++++----- subxt/src/tx/tx_progress.rs | 12 ++-- 7 files changed, 121 insertions(+), 90 deletions(-) diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index 7616217894..d5cf67fb6c 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -3,42 +3,40 @@ // see LICENSE for license details. use crate::{ - Config, - error::{ - Error, - }, client::{ OfflineClientT, OnlineClientT, }, - rpc::{ - ChainBlockResponse, - }, - events + error::Error, + events, + rpc::ChainBlockResponse, + Config, }; use derivative::Derivative; +use futures::lock::Mutex as AsyncMutex; use sp_runtime::traits::Hash; +use std::sync::Arc; /// A representation of a block from which you can obtain details /// including the block header, extrinsics and events for the block. pub struct Block { hash: T::Hash, details: ChainBlockResponse, + cached_events: Arc>>>, client: C, } -impl Block +impl Block where T: Config, - C: OfflineClientT + C: OfflineClientT, { - pub (crate) fn new( - hash: T::Hash, - details: ChainBlockResponse, - client: C - ) -> Self { + pub(crate) fn new(hash: T::Hash, details: ChainBlockResponse, client: C) -> Self { Block { - hash, details, client + hash, + details, + cached_events: Default::default(), + client, } } @@ -53,16 +51,22 @@ where } /// Returns an iterator over the extrinsics in the block. - pub fn extrinsics<'a>(&'a self) -> impl Iterator> { - self.details.block.extrinsics.iter().enumerate().map(|(idx, e)| { - Extrinsic { - index: idx as u32, - bytes: &e.0, - client: self.client.clone(), - block_hash: self.hash, - _marker: std::marker::PhantomData - } - }) + pub fn extrinsics(&self) -> impl Iterator> { + self.details + .block + .extrinsics + .iter() + .enumerate() + .map(|(idx, e)| { + Extrinsic { + index: idx as u32, + bytes: &e.0, + client: self.client.clone(), + block_hash: self.hash, + cached_events: self.cached_events.clone(), + _marker: std::marker::PhantomData, + } + }) } } @@ -72,13 +76,14 @@ pub struct Extrinsic<'a, T: Config, C> { bytes: &'a [u8], client: C, block_hash: T::Hash, - _marker: std::marker::PhantomData + cached_events: Arc>>>, + _marker: std::marker::PhantomData, } -impl <'a, T, C> Extrinsic<'a, T, C> +impl<'a, T, C> Extrinsic<'a, T, C> where T: Config, - C: OfflineClientT + C: OfflineClientT, { /// The index of the extrinsic in the block. pub fn index(&self) -> u32 { @@ -87,22 +92,31 @@ where /// The bytes of the extrinsic. pub fn bytes(&self) -> &'a [u8] { - &self.bytes + self.bytes } } -impl <'a, T, C> Extrinsic<'a, T, C> +impl<'a, T, C> Extrinsic<'a, T, C> where T: Config, - C: OnlineClientT + C: OnlineClientT, { /// The events associated with the extrinsic. pub async fn events(&self) -> Result, Error> { - let ext_hash = T::Hashing::hash_of(&self.bytes); - let events = events::EventsClient::new(self.client.clone()) - .at(Some(self.block_hash)) - .await?; + // Acquire lock on the events cache. We either get back our events or we fetch and set them + // before unlocking, so only one fetch call should ever be made. We do this because the + // same events can be shared across all extrinsics in the block. + let lock = self.cached_events.lock().await; + let events = match &*lock { + Some(events) => events.clone(), + None => { + events::EventsClient::new(self.client.clone()) + .at(Some(self.block_hash)) + .await? + } + }; + let ext_hash = T::Hashing::hash_of(&self.bytes); Ok(ExtrinsicEvents::new(ext_hash, self.index, events)) } } @@ -119,16 +133,16 @@ pub struct ExtrinsicEvents { // The index of the extrinsic: idx: u32, // All of the events in the block: - events: events::Events + events: events::Events, } impl ExtrinsicEvents { - pub (crate) fn new( - ext_hash: T::Hash, - idx: u32, - events: events::Events - ) -> Self { - Self { ext_hash, idx, events } + pub(crate) fn new(ext_hash: T::Hash, idx: u32, events: events::Events) -> Self { + Self { + ext_hash, + idx, + events, + } } /// Return the hash of the block that the extrinsic is in. @@ -162,7 +176,9 @@ impl ExtrinsicEvents { /// /// This works in the same way that [`events::Events::find()`] does, with the /// exception that it filters out events not related to the submitted extrinsic. - pub fn find(&self) -> impl Iterator> + '_ { + pub fn find( + &self, + ) -> impl Iterator> + '_ { self.iter().filter_map(|ev| { ev.and_then(|ev| ev.as_event::().map_err(Into::into)) .transpose() diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index 6bee110217..32e88a2908 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -2,11 +2,12 @@ // This file is dual-licensed as Apache-2.0 or GPL-3.0. // see LICENSE for license details. +use super::Block; use crate::{ client::OnlineClientT, error::{ + BlockError, Error, - BlockError }, utils::PhantomDataSendSync, Config, @@ -20,9 +21,6 @@ use futures::{ }; use sp_runtime::traits::Header; use std::future::Future; -use super::{ - Block -}; /// A client for working with blocks. #[derive(Derivative)] @@ -51,7 +49,7 @@ where /// provided. pub fn at( &self, - block_hash: Option + block_hash: Option, ) -> impl Future, Error>> + Send + 'static { let client = self.client.clone(); async move { @@ -70,7 +68,11 @@ where let res = match client.rpc().block(Some(block_hash)).await? { Some(block) => block, - None => return Err(BlockError::BlockHashNotFound(hex::encode(block_hash)).into()) + None => { + return Err( + BlockError::BlockHashNotFound(hex::encode(block_hash)).into() + ) + } }; Ok(Block::new(block_hash, res, client)) @@ -83,9 +85,10 @@ where /// each block once it is finalized. pub fn subscribe_finalized( &self, - ) -> impl Future, Error>>, Error>> - + Send - + 'static { + ) -> impl Future< + Output = Result, Error>>, Error>, + > + Send + + 'static { let this = self.clone(); async move { let client = this.client.clone(); @@ -97,14 +100,20 @@ where async move { let header = match header { Ok(header) => header, - Err(e) => return Err(e) + Err(e) => return Err(e), }; let block_hash = header.hash(); - let block_details = match client.rpc().block(Some(block_hash)).await? { - Some(block) => block, - None => return Err(BlockError::BlockHashNotFound(hex::encode(block_hash)).into()) - }; + let block_details = + match client.rpc().block(Some(block_hash)).await? { + Some(block) => block, + None => { + return Err(BlockError::BlockHashNotFound( + hex::encode(block_hash), + ) + .into()) + } + }; Ok(Block::new(block_hash, block_details, client)) } @@ -156,10 +165,12 @@ where let sub = client.rpc().subscribe_finalized_block_headers().await?; // Adjust the subscription stream to fill in any missing blocks. - Ok( - subscribe_to_block_headers_filling_in_gaps(client, last_finalized_block_num, sub) - .boxed(), + Ok(subscribe_to_block_headers_filling_in_gaps( + client, + last_finalized_block_num, + sub, ) + .boxed()) } } } diff --git a/subxt/src/blocks/mod.rs b/subxt/src/blocks/mod.rs index 446144092e..ae7f212f48 100644 --- a/subxt/src/blocks/mod.rs +++ b/subxt/src/blocks/mod.rs @@ -4,15 +4,15 @@ //! This module exposes the necessary functionality for working with events. -mod blocks_client; mod block_types; +mod blocks_client; -pub use blocks_client::{ - subscribe_to_block_headers_filling_in_gaps, - BlocksClient, -}; pub use block_types::{ Block, Extrinsic, ExtrinsicEvents, -}; \ No newline at end of file +}; +pub use blocks_client::{ + subscribe_to_block_headers_filling_in_gaps, + BlocksClient, +}; diff --git a/subxt/src/error.rs b/subxt/src/error.rs index c01389692a..54bba62e7c 100644 --- a/subxt/src/error.rs +++ b/subxt/src/error.rs @@ -237,7 +237,9 @@ impl DispatchError { #[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] pub enum BlockError { /// The block - #[error("Could not find a block with hash {0} (perhaps it was on a non-finalized fork?)")] + #[error( + "Could not find a block with hash {0} (perhaps it was on a non-finalized fork?)" + )] BlockHashNotFound(String), } diff --git a/subxt/src/events/events_type.rs b/subxt/src/events/events_type.rs index a9aa21c875..d0b8ade853 100644 --- a/subxt/src/events/events_type.rs +++ b/subxt/src/events/events_type.rs @@ -25,7 +25,7 @@ use std::sync::Arc; /// A collection of events obtained from a block, bundled with the necessary /// information needed to decode and iterate over them. #[derive(Derivative)] -#[derivative(Debug(bound = ""))] +#[derivative(Debug(bound = ""), Clone(bound = ""))] pub struct Events { metadata: Metadata, block_hash: T::Hash, diff --git a/subxt/src/rpc/rpc.rs b/subxt/src/rpc/rpc.rs index 52ccf85455..17bd184e4b 100644 --- a/subxt/src/rpc/rpc.rs +++ b/subxt/src/rpc/rpc.rs @@ -69,9 +69,7 @@ use sp_core::{ Bytes, U256, }; -use sp_runtime::{ - ApplyExtrinsicResult, -}; +use sp_runtime::ApplyExtrinsicResult; use std::{ collections::HashMap, sync::Arc, @@ -100,16 +98,16 @@ pub enum NumberOrHex { pub struct ChainBlockResponse { /// The block itself. pub block: ChainBlock, - /// Block justification. - pub justifications: Option + /// Block justification. + pub justifications: Option, } /// Block details in the [`ChainBlockResponse`]. #[derive(Debug, Deserialize)] pub struct ChainBlock { - /// The block header. + /// The block header. pub header: T::Header, - /// The accompanying extrinsics. + /// The accompanying extrinsics. pub extrinsics: Vec, } @@ -118,15 +116,15 @@ pub struct ChainBlock { pub struct ChainBlockExtrinsic(pub Vec); impl<'a> ::serde::Deserialize<'a> for ChainBlockExtrinsic { - fn deserialize(de: D) -> Result - where - D: ::serde::Deserializer<'a>, - { - let r = sp_core::bytes::deserialize(de)?; - let bytes = Decode::decode(&mut &r[..]) - .map_err(|e| ::serde::de::Error::custom(format!("Decode error: {}", e)))?; + fn deserialize(de: D) -> Result + where + D: ::serde::Deserializer<'a>, + { + let r = sp_core::bytes::deserialize(de)?; + let bytes = Decode::decode(&mut &r[..]) + .map_err(|e| ::serde::de::Error::custom(format!("Decode error: {}", e)))?; Ok(ChainBlockExtrinsic(bytes)) - } + } } /// Wrapper for NumberOrHex to allow custom From impls @@ -571,7 +569,9 @@ impl Rpc { } /// Subscribe to blocks. - pub async fn subscribe_block_headers(&self) -> Result, Error> { + pub async fn subscribe_block_headers( + &self, + ) -> Result, Error> { let subscription = self .client .subscribe( diff --git a/subxt/src/tx/tx_progress.rs b/subxt/src/tx/tx_progress.rs index 74205fa329..d2de451eb5 100644 --- a/subxt/src/tx/tx_progress.rs +++ b/subxt/src/tx/tx_progress.rs @@ -14,9 +14,7 @@ use crate::{ RpcError, TransactionError, }, - events::{ - EventsClient, - }, + events::EventsClient, rpc::{ Subscription, SubstrateTxStatus, @@ -142,7 +140,9 @@ where /// may well indicate with some probability that the transaction will not make it into a block, /// there is no guarantee that this is true. Thus, we prefer to "play it safe" here. Use the lower /// level [`TxProgress::next_item()`] API if you'd like to handle these statuses yourself. - pub async fn wait_for_finalized_success(self) -> Result, Error> { + pub async fn wait_for_finalized_success( + self, + ) -> Result, Error> { let evs = self.wait_for_finalized().await?.wait_for_success().await?; Ok(evs) } @@ -338,7 +338,9 @@ impl> TxInBlock { /// /// **Note:** This has to download block details from the node and decode events /// from them. - pub async fn wait_for_success(&self) -> Result, Error> { + pub async fn wait_for_success( + &self, + ) -> Result, Error> { let events = self.fetch_events().await?; // Try to find any errors; return the first one we encounter. From 51af76c6941dbd2ffc5acc386e7950e94101fda4 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 19 Oct 2022 11:44:36 +0100 Subject: [PATCH 03/17] prefix block hash with 0x --- subxt/src/blocks/blocks_client.rs | 10 +++------- subxt/src/error.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index 32e88a2908..a11cc64754 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -68,11 +68,7 @@ where let res = match client.rpc().block(Some(block_hash)).await? { Some(block) => block, - None => { - return Err( - BlockError::BlockHashNotFound(hex::encode(block_hash)).into() - ) - } + None => return Err(BlockError::block_hash_not_found(block_hash).into()), }; Ok(Block::new(block_hash, res, client)) @@ -108,8 +104,8 @@ where match client.rpc().block(Some(block_hash)).await? { Some(block) => block, None => { - return Err(BlockError::BlockHashNotFound( - hex::encode(block_hash), + return Err(BlockError::block_hash_not_found( + block_hash, ) .into()) } diff --git a/subxt/src/error.rs b/subxt/src/error.rs index 54bba62e7c..298dc9e01d 100644 --- a/subxt/src/error.rs +++ b/subxt/src/error.rs @@ -243,6 +243,14 @@ pub enum BlockError { BlockHashNotFound(String), } +impl BlockError { + /// Produce an error that a block with the given hash cannot be found. + pub fn block_hash_not_found(hash: impl AsRef<[u8]>) -> BlockError { + let hash = format!("0x{}", hex::encode(hash)); + BlockError::BlockHashNotFound(hash) + } +} + /// Transaction error. #[derive(Clone, Debug, Eq, thiserror::Error, PartialEq)] pub enum TransactionError { From 036d333988c5096f23bce54041a741a5b9273287 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 19 Oct 2022 17:00:50 +0100 Subject: [PATCH 04/17] pin streams for better ergonomics and add an example of subscribing to blocks --- examples/examples/subscribe_blocks.rs | 64 +++++++++++++++++++++++++++ subxt/src/blocks/block_types.rs | 2 + subxt/src/blocks/blocks_client.rs | 45 +++++++++++-------- subxt/src/events/events_client.rs | 4 +- 4 files changed, 95 insertions(+), 20 deletions(-) create mode 100644 examples/examples/subscribe_blocks.rs diff --git a/examples/examples/subscribe_blocks.rs b/examples/examples/subscribe_blocks.rs new file mode 100644 index 0000000000..d22c76bd41 --- /dev/null +++ b/examples/examples/subscribe_blocks.rs @@ -0,0 +1,64 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.29-41a9d84b152. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.29/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +use futures::StreamExt; +use subxt::{ + OnlineClient, + PolkadotConfig, +}; + +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +pub mod polkadot {} + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Subscribe to all finalized blocks: + let mut blocks_sub = api.blocks().subscribe_finalized().await?; + + while let Some(block) = blocks_sub.next().await { + let block = block?; + + let block_number = block.header().number; + let block_hash = block.hash(); + + println!("Block #{block_number}:"); + println!(" Hash: {block_hash}"); + println!(" Extrinsics:"); + + for ext in block.extrinsics() { + let idx = ext.index(); + let events = ext.events().await?; + let bytes_hex = format!("0x{}", hex::encode(ext.bytes())); + + println!(" Extrinsic #{idx}:"); + println!(" Bytes: {bytes_hex}"); + println!(" Events:"); + + for evt in events.iter() { + let evt = evt?; + + let pallet_name = evt.pallet_name(); + let event_name = evt.variant_name(); + let event_idx = evt.index(); + + println!(" {pallet_name}_{event_name}"); + } + } + } + + Ok(()) +} diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index d5cf67fb6c..415d3bd142 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -22,6 +22,8 @@ use std::sync::Arc; pub struct Block { hash: T::Hash, details: ChainBlockResponse, + // Since we obtain the same events for every extrinsic, let's + // cache them so that we only ever do that once: cached_events: Arc>>>, client: C, } diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index a11cc64754..34211a2d3e 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -20,7 +20,13 @@ use futures::{ StreamExt, }; use sp_runtime::traits::Header; -use std::future::Future; +use std::{ + future::Future, + pin::Pin, +}; + +type BlockStream = Pin> + Send>>; +type BlockStreamRes = Result, Error>; /// A client for working with blocks. #[derive(Derivative)] @@ -81,10 +87,10 @@ where /// each block once it is finalized. pub fn subscribe_finalized( &self, - ) -> impl Future< - Output = Result, Error>>, Error>, - > + Send - + 'static { + ) -> impl Future>, Error>> + Send + 'static + where + Client: Send + Sync + 'static, + { let this = self.clone(); async move { let client = this.client.clone(); @@ -114,7 +120,7 @@ where Ok(Block::new(block_hash, block_details, client)) } }); - Ok(sub) + BlockStreamRes::Ok(Box::pin(sub)) } } @@ -131,11 +137,13 @@ where /// [`BlocksClient::subscribe_finalized_headers()`] if that is important. pub fn subscribe_headers( &self, - ) -> impl Future>, Error>> - + Send - + 'static { + ) -> impl Future, Error>> + Send + 'static + { let client = self.client.clone(); - async move { client.rpc().subscribe_block_headers().await } + async move { + let sub = client.rpc().subscribe_block_headers().await?; + BlockStreamRes::Ok(Box::pin(sub)) + } } /// Subscribe to finalized block headers. @@ -144,9 +152,8 @@ where /// provided, this function does. pub fn subscribe_finalized_headers( &self, - ) -> impl Future>, Error>> - + Send - + 'static { + ) -> impl Future, Error>> + Send + 'static + { let client = self.client.clone(); async move { // Fetch the last finalised block details immediately, so that we'll get @@ -161,12 +168,14 @@ where let sub = client.rpc().subscribe_finalized_block_headers().await?; // Adjust the subscription stream to fill in any missing blocks. - Ok(subscribe_to_block_headers_filling_in_gaps( - client, - last_finalized_block_num, - sub, + BlockStreamRes::Ok( + subscribe_to_block_headers_filling_in_gaps( + client, + last_finalized_block_num, + sub, + ) + .boxed(), ) - .boxed()) } } } diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs index 42fa5071f4..ca86a0cc10 100644 --- a/subxt/src/events/events_client.rs +++ b/subxt/src/events/events_client.rs @@ -160,7 +160,7 @@ where Client: OnlineClientT, { let block_subscription = client.blocks().subscribe_headers().await?; - Ok(EventSubscription::new(client, Box::pin(block_subscription))) + Ok(EventSubscription::new(client, block_subscription)) } /// Subscribe to events from finalized blocks. @@ -172,7 +172,7 @@ where Client: OnlineClientT, { let block_subscription = client.blocks().subscribe_finalized_headers().await?; - Ok(EventSubscription::new(client, Box::pin(block_subscription))) + Ok(EventSubscription::new(client, block_subscription)) } // The storage key needed to access events. From da74c7b5962c47c5b96b621410049f153d803443 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 19 Oct 2022 17:18:38 +0100 Subject: [PATCH 05/17] remove unused var --- examples/examples/subscribe_blocks.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/examples/subscribe_blocks.rs b/examples/examples/subscribe_blocks.rs index d22c76bd41..4871d92c35 100644 --- a/examples/examples/subscribe_blocks.rs +++ b/examples/examples/subscribe_blocks.rs @@ -53,7 +53,6 @@ async fn main() -> Result<(), Box> { let pallet_name = evt.pallet_name(); let event_name = evt.variant_name(); - let event_idx = evt.index(); println!(" {pallet_name}_{event_name}"); } From fea170c1ece4172cda8134e3273758ac3c52381a Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 21 Oct 2022 15:26:39 +0100 Subject: [PATCH 06/17] standardise on _all, _best and _finalized for different block header subs --- examples/examples/subscribe_all_events.rs | 4 +- examples/examples/subscribe_one_event.rs | 2 +- examples/examples/subscribe_some_events.rs | 2 +- subxt/src/blocks/blocks_client.rs | 135 +++++++++++------ subxt/src/events/events_client.rs | 139 +++++++++--------- subxt/src/rpc/rpc.rs | 33 ++++- testing/integration-tests/src/blocks/mod.rs | 2 +- testing/integration-tests/src/client/mod.rs | 13 +- testing/integration-tests/src/events/mod.rs | 12 +- .../src/utils/wait_for_blocks.rs | 2 +- 10 files changed, 210 insertions(+), 134 deletions(-) diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index 5eef7447d4..d0d5591f8c 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -31,8 +31,8 @@ async fn main() -> Result<(), Box> { // Create a client to use: let api = OnlineClient::::new().await?; - // Subscribe to any events that occur: - let mut event_sub = api.events().subscribe().await?; + // Subscribe to any events that occur in finalized blocks: + let mut event_sub = api.events().subscribe_finalized().await?; // While this subscription is active, balance transfers are made somewhere: tokio::task::spawn({ diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index 72baa1a21c..30ca32cf10 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -35,7 +35,7 @@ async fn main() -> Result<(), Box> { // to select a single event type (note the 1-tuple) to filter out and return. let mut transfer_events = api .events() - .subscribe() + .subscribe_finalized() .await? .filter_events::<(polkadot::balances::events::Transfer,)>(); diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index bea82460aa..2f39ebf73e 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -34,7 +34,7 @@ async fn main() -> Result<(), Box> { // Subscribe to several balance related events. If we ask for more than one event, // we'll be given a correpsonding tuple of `Option`'s, with exactly one // variant populated each time. - let mut balance_events = api.events().subscribe().await?.filter_events::<( + let mut balance_events = api.events().subscribe_finalized().await?.filter_events::<( polkadot::balances::events::Withdraw, polkadot::balances::events::Transfer, polkadot::balances::events::Deposit, diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index 34211a2d3e..98db507cb5 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -53,6 +53,12 @@ where { /// Obtain block details given the provided block hash, or the latest block if `None` is /// provided. + /// + /// # Warning + /// + /// This call only supports blocks produced since the most recent + /// runtime upgrade. You can attempt to retrieve older blocks, + /// but may run into errors attempting to work with them. pub fn at( &self, block_hash: Option, @@ -81,75 +87,79 @@ where } } + /// Subscribe to all new blocks imported by the node. + /// + /// **Note:** You probably want to use [`Self::subscribe_finalized()`] most of + /// the time. + pub fn subscribe_all( + &self, + ) -> impl Future>, Error>> + Send + 'static + where + Client: Send + Sync + 'static, + { + header_sub_fut_to_block_sub(self.clone(), self.subscribe_all_headers()) + } + + /// Subscribe to all new blocks imported by the node onto the current best fork. + /// + /// **Note:** You probably want to use [`Self::subscribe_finalized()`] most of + /// the time. + pub fn subscribe_best( + &self, + ) -> impl Future>, Error>> + Send + 'static + where + Client: Send + Sync + 'static, + { + header_sub_fut_to_block_sub(self.clone(), self.subscribe_best_headers()) + } + /// Subscribe to finalized blocks. /// /// This builds upon [`BlocksClient::subscribe_finalized_headers`] and returns details for - /// each block once it is finalized. + /// every block, in order, that has been finalized. pub fn subscribe_finalized( &self, ) -> impl Future>, Error>> + Send + 'static where Client: Send + Sync + 'static, { - let this = self.clone(); + header_sub_fut_to_block_sub(self.clone(), self.subscribe_finalized_headers()) + } + + /// Subscribe to headers for every new block that is imported by the node. + /// These headers might be for blocks not on the current best chain. + /// + /// **Note:** You probably want to use [`Self::subscribe_finalized_headers()`] most + /// of the time. + pub fn subscribe_all_headers( + &self, + ) -> impl Future, Error>> + Send + 'static + { + let client = self.client.clone(); async move { - let client = this.client.clone(); - let sub = this - .subscribe_finalized_headers() - .await? - .then(move |header| { - let client = client.clone(); - async move { - let header = match header { - Ok(header) => header, - Err(e) => return Err(e), - }; - - let block_hash = header.hash(); - let block_details = - match client.rpc().block(Some(block_hash)).await? { - Some(block) => block, - None => { - return Err(BlockError::block_hash_not_found( - block_hash, - ) - .into()) - } - }; - - Ok(Block::new(block_hash, block_details, client)) - } - }); + let sub = client.rpc().subscribe_all_block_headers().await?; BlockStreamRes::Ok(Box::pin(sub)) } } - /// Subscribe to new best block headers. - /// - /// # Note + /// Subscribe to headers for each new block that is imported by the node and + /// added to the current best fork. /// - /// This does not produce all the blocks from the chain, just the best blocks. - /// The best block is selected by the consensus algorithm. - /// This calls under the hood the `chain_subscribeNewHeads` RPC method, if you need - /// a subscription of all the blocks please use the `chain_subscribeAllHeads` method. - /// - /// These blocks haven't necessarily been finalised yet. Prefer - /// [`BlocksClient::subscribe_finalized_headers()`] if that is important. - pub fn subscribe_headers( + /// **Note:** You probably want to use [`Self::subscribe_finalized_headers()`] most + /// of the time. + pub fn subscribe_best_headers( &self, ) -> impl Future, Error>> + Send + 'static { let client = self.client.clone(); async move { - let sub = client.rpc().subscribe_block_headers().await?; + let sub = client.rpc().subscribe_best_block_headers().await?; BlockStreamRes::Ok(Box::pin(sub)) } } - /// Subscribe to finalized block headers. - /// - /// While the Substrate RPC method does not guarantee that all finalized block headers are - /// provided, this function does. + /// Subscribe to finalized block headers. This subscription returns every block that is part of + /// the finalized chain, in order, from the first finalized block seen at the time of calling this. pub fn subscribe_finalized_headers( &self, ) -> impl Future, Error>> + Send + 'static @@ -180,6 +190,41 @@ where } } +/// Take a promise that will return a subscription to some block headers, +/// and return a subscription to some blocks based on this. +fn header_sub_fut_to_block_sub( + blocks_client: BlocksClient, + sub: S, +) -> impl Future>, Error>> + Send + 'static +where + T: Config, + S: Future, Error>> + Send + 'static, + Client: OnlineClientT + Send + Sync + 'static, +{ + async move { + let sub = sub.await?.then(move |header| { + let client = blocks_client.client.clone(); + async move { + let header = match header { + Ok(header) => header, + Err(e) => return Err(e), + }; + + let block_hash = header.hash(); + let block_details = match client.rpc().block(Some(block_hash)).await? { + Some(block) => block, + None => { + return Err(BlockError::block_hash_not_found(block_hash).into()) + } + }; + + Ok(Block::new(block_hash, block_details, client)) + } + }); + BlockStreamRes::Ok(Box::pin(sub)) + } +} + /// Note: This is exposed for testing but is not considered stable and may change /// without notice in a patch release. #[doc(hidden)] diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs index ca86a0cc10..6c5fefd14a 100644 --- a/subxt/src/events/events_client.rs +++ b/subxt/src/events/events_client.rs @@ -57,13 +57,72 @@ where // Clone and pass the client in like this so that we can explicitly // return a Future that's Send + 'static, rather than tied to &self. let client = self.client.clone(); - async move { at(client, block_hash).await } + async move { + // If block hash is not provided, get the hash + // for the latest block and use that. + let block_hash = match block_hash { + Some(hash) => hash, + None => { + client + .rpc() + .block_hash(None) + .await? + .expect("didn't pass a block number; qed") + } + }; + + let event_bytes = client + .rpc() + .storage(&*system_events_key().0, Some(block_hash)) + .await? + .map(|e| e.0) + .unwrap_or_else(Vec::new); + + Ok(Events::new(client.metadata(), block_hash, event_bytes)) + } } - /// Subscribe to all events from blocks. + /// Subscribe to events from all newly imported blocks. /// /// **Note:** these blocks haven't necessarily been finalised yet; prefer /// [`EventsClient::subscribe_finalized()`] if that is important. + pub fn subscribe_all( + &self, + ) -> impl Future< + Output = Result>, Error>, + > + Send + + 'static + where + Client: Send + Sync + 'static, + { + let client = self.client.clone(); + async move { + let block_subscription = client.blocks().subscribe_all_headers().await?; + Ok(EventSubscription::new(client, block_subscription)) + } + } + + /// Subscribe to events from all newly imported blocks that are added to the best fork. + /// + /// **Note:** these blocks haven't necessarily been finalised yet; prefer + /// [`EventsClient::subscribe_finalized()`] if that is important. + pub fn subscribe_best( + &self, + ) -> impl Future< + Output = Result>, Error>, + > + Send + + 'static + where + Client: Send + Sync + 'static, + { + let client = self.client.clone(); + async move { + let block_subscription = client.blocks().subscribe_best_headers().await?; + Ok(EventSubscription::new(client, block_subscription)) + } + } + + /// Subscribe to events from all finalized blocks. /// /// # Example /// @@ -75,7 +134,7 @@ where /// /// let api = OnlineClient::::new().await.unwrap(); /// - /// let mut events = api.events().subscribe().await.unwrap(); + /// let mut events = api.events().subscribe_finalized().await.unwrap(); /// /// while let Some(ev) = events.next().await { /// // Obtain all events from this block. @@ -90,20 +149,6 @@ where /// } /// # } /// ``` - pub fn subscribe( - &self, - ) -> impl Future< - Output = Result>, Error>, - > + Send - + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - async move { subscribe(client).await } - } - - /// Subscribe to events from finalized blocks. See [`EventsClient::subscribe()`] for details. pub fn subscribe_finalized( &self, ) -> impl Future< @@ -117,62 +162,12 @@ where Client: Send + Sync + 'static, { let client = self.client.clone(); - async move { subscribe_finalized(client).await } - } -} - -async fn at( - client: Client, - block_hash: Option, -) -> Result, Error> -where - T: Config, - Client: OnlineClientT, -{ - // If block hash is not provided, get the hash - // for the latest block and use that. - let block_hash = match block_hash { - Some(hash) => hash, - None => { - client - .rpc() - .block_hash(None) - .await? - .expect("didn't pass a block number; qed") + async move { + let block_subscription = + client.blocks().subscribe_finalized_headers().await?; + Ok(EventSubscription::new(client, block_subscription)) } - }; - - let event_bytes = client - .rpc() - .storage(&*system_events_key().0, Some(block_hash)) - .await? - .map(|e| e.0) - .unwrap_or_else(Vec::new); - - Ok(Events::new(client.metadata(), block_hash, event_bytes)) -} - -async fn subscribe( - client: Client, -) -> Result>, Error> -where - T: Config, - Client: OnlineClientT, -{ - let block_subscription = client.blocks().subscribe_headers().await?; - Ok(EventSubscription::new(client, block_subscription)) -} - -/// Subscribe to events from finalized blocks. -async fn subscribe_finalized( - client: Client, -) -> Result>, Error> -where - T: Config, - Client: OnlineClientT, -{ - let block_subscription = client.blocks().subscribe_finalized_headers().await?; - Ok(EventSubscription::new(client, block_subscription)) + } } // The storage key needed to access events. diff --git a/subxt/src/rpc/rpc.rs b/subxt/src/rpc/rpc.rs index 17bd184e4b..47f716c8db 100644 --- a/subxt/src/rpc/rpc.rs +++ b/subxt/src/rpc/rpc.rs @@ -568,13 +568,16 @@ impl Rpc { Ok(version) } - /// Subscribe to blocks. - pub async fn subscribe_block_headers( + /// Subscribe to all new best block headers. + pub async fn subscribe_best_block_headers( &self, ) -> Result, Error> { let subscription = self .client .subscribe( + // Despite the name, this returns a stream of all new blocks + // imported by the node that happen to be added to the current best chain + // (ie all best blocks). "chain_subscribeNewHeads", rpc_params![], "chain_unsubscribeNewHeads", @@ -584,7 +587,31 @@ impl Rpc { Ok(subscription) } - /// Subscribe to finalized blocks. + /// Subscribe to all new block headers. + pub async fn subscribe_all_block_headers( + &self, + ) -> Result, Error> { + let subscription = self + .client + .subscribe( + // Despite the name, this returns a stream of all new blocks + // imported by the node that happen to be added to the current best chain + // (ie all best blocks). + "chain_subscribeAllHeads", + rpc_params![], + "chain_unsubscribeAllHeads", + ) + .await?; + + Ok(subscription) + } + + /// Subscribe to finalized block headers. + /// + /// Note: this may not produce _every_ block in the finalized chain; + /// sometimes multiple blocks are finalized at once, and in this case only the + /// latest one is returned. the higher level APIs that use this "fill in" the + /// gaps for us. pub async fn subscribe_finalized_block_headers( &self, ) -> Result, Error> { diff --git a/testing/integration-tests/src/blocks/mod.rs b/testing/integration-tests/src/blocks/mod.rs index c8c264deca..cbac2a9207 100644 --- a/testing/integration-tests/src/blocks/mod.rs +++ b/testing/integration-tests/src/blocks/mod.rs @@ -11,7 +11,7 @@ async fn non_finalized_headers_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let mut sub = api.blocks().subscribe_headers().await?; + let mut sub = api.blocks().subscribe_best_headers().await?; // Wait for the next set of headers, and check that the // associated block hash is the one we just finalized. diff --git a/testing/integration-tests/src/client/mod.rs b/testing/integration-tests/src/client/mod.rs index 05f5818b6c..92cdbf2a5c 100644 --- a/testing/integration-tests/src/client/mod.rs +++ b/testing/integration-tests/src/client/mod.rs @@ -74,11 +74,20 @@ async fn fetch_read_proof() { } #[tokio::test] -async fn chain_subscribe_blocks() { +async fn chain_subscribe_all_blocks() { let ctx = test_context().await; let api = ctx.client(); - let mut blocks = api.rpc().subscribe_block_headers().await.unwrap(); + let mut blocks = api.rpc().subscribe_all_block_headers().await.unwrap(); + blocks.next().await.unwrap().unwrap(); +} + +#[tokio::test] +async fn chain_subscribe_best_blocks() { + let ctx = test_context().await; + let api = ctx.client(); + + let mut blocks = api.rpc().subscribe_best_block_headers().await.unwrap(); blocks.next().await.unwrap().unwrap(); } diff --git a/testing/integration-tests/src/events/mod.rs b/testing/integration-tests/src/events/mod.rs index bf629d600e..4d5255a7ab 100644 --- a/testing/integration-tests/src/events/mod.rs +++ b/testing/integration-tests/src/events/mod.rs @@ -21,7 +21,7 @@ async fn non_finalized_block_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let mut event_sub = api.events().subscribe().await?; + let mut event_sub = api.events().subscribe_best().await?; // Wait for the next set of events, and check that the // associated block hash is not finalized yet. @@ -61,7 +61,7 @@ async fn subscription_produces_events_each_block() -> Result<(), subxt::Error> { wait_for_blocks(&api).await; - let mut event_sub = api.events().subscribe().await?; + let mut event_sub = api.events().subscribe_best().await?; for i in 0..3 { let events = event_sub @@ -90,7 +90,7 @@ async fn decoding_all_events_in_a_block_works() -> Result<(), subxt::Error> { wait_for_blocks(&api).await; - let mut event_sub = api.events().subscribe().await?; + let mut event_sub = api.events().subscribe_best().await?; tokio::spawn(async move { let alice = pair_signer(AccountKeyring::Alice.pair()); @@ -135,7 +135,7 @@ async fn balance_transfer_subscription() -> Result<(), subxt::Error> { // Subscribe to balance transfer events, ignoring all else. let event_sub = api .events() - .subscribe() + .subscribe_best() .await? .filter_events::<(balances::events::Transfer,)>(); @@ -179,7 +179,7 @@ async fn check_events_are_sendable() { tokio::task::spawn(async { let ctx = test_context().await; - let mut event_sub = ctx.client().events().subscribe().await?; + let mut event_sub = ctx.client().events().subscribe_best().await?; while let Some(ev) = event_sub.next().await { // if `event_sub` doesn't implement Send, we can't hold @@ -197,7 +197,7 @@ async fn check_events_are_sendable() { let mut event_sub = ctx .client() .events() - .subscribe() + .subscribe_all() .await? .filter_events::<(balances::events::Transfer,)>(); diff --git a/testing/integration-tests/src/utils/wait_for_blocks.rs b/testing/integration-tests/src/utils/wait_for_blocks.rs index e5b84b37d4..d17ae33076 100644 --- a/testing/integration-tests/src/utils/wait_for_blocks.rs +++ b/testing/integration-tests/src/utils/wait_for_blocks.rs @@ -11,7 +11,7 @@ use subxt::{ /// (the genesis block and another one) seems to be enough to allow tests /// like `dry_run_passes` to work properly. pub async fn wait_for_blocks(api: &impl OnlineClientT) { - let mut sub = api.rpc().subscribe_block_headers().await.unwrap(); + let mut sub = api.rpc().subscribe_all_block_headers().await.unwrap(); sub.next().await; sub.next().await; } From ba85a920695d2711bdf33bda9589a7a49a79c56a Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 21 Oct 2022 16:32:18 +0100 Subject: [PATCH 07/17] WIP center subscribing around blocks --- ...ll_events.rs => subscribe_block_events.rs} | 16 ++- examples/examples/subscribe_blocks.rs | 3 +- subxt/src/blocks/block_types.rs | 124 +++++++++++++----- subxt/src/blocks/blocks_client.rs | 76 +++-------- subxt/src/events/events_client.rs | 94 +------------ 5 files changed, 123 insertions(+), 190 deletions(-) rename examples/examples/{subscribe_all_events.rs => subscribe_block_events.rs} (88%) diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_block_events.rs similarity index 88% rename from examples/examples/subscribe_all_events.rs rename to examples/examples/subscribe_block_events.rs index d0d5591f8c..b1c60580e5 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_block_events.rs @@ -31,8 +31,8 @@ async fn main() -> Result<(), Box> { // Create a client to use: let api = OnlineClient::::new().await?; - // Subscribe to any events that occur in finalized blocks: - let mut event_sub = api.events().subscribe_finalized().await?; + // Subscribe to (in this case, finalized) blocks. + let mut block_sub = api.blocks().subscribe_finalized().await?; // While this subscription is active, balance transfers are made somewhere: tokio::task::spawn({ @@ -58,10 +58,14 @@ async fn main() -> Result<(), Box> { } }); - // Our subscription will see the events emitted as a result of this: - while let Some(events) = event_sub.next().await { - let events = events?; - let block_hash = events.block_hash(); + // Get each finalized block as it arrives. + while let Some(block) = block_sub.next().await { + let block = block?; + + // Ask for the events for this block. + let events = block.events().await?; + + let block_hash = block.hash(); // We can dynamically decode events: println!(" Dynamic event details: {block_hash:?}:"); diff --git a/examples/examples/subscribe_blocks.rs b/examples/examples/subscribe_blocks.rs index 4871d92c35..1838952a46 100644 --- a/examples/examples/subscribe_blocks.rs +++ b/examples/examples/subscribe_blocks.rs @@ -39,7 +39,8 @@ async fn main() -> Result<(), Box> { println!(" Hash: {block_hash}"); println!(" Extrinsics:"); - for ext in block.extrinsics() { + let body = block.body().await?; + for ext in body.extrinsics() { let idx = ext.index(); let events = ext.events().await?; let bytes_hex = format!("0x{}", hex::encode(ext.bytes())); diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index 415d3bd142..afeb5f9785 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -7,52 +7,106 @@ use crate::{ OfflineClientT, OnlineClientT, }, - error::Error, + error::{ + Error, + BlockError, + }, events, rpc::ChainBlockResponse, Config, }; use derivative::Derivative; use futures::lock::Mutex as AsyncMutex; -use sp_runtime::traits::Hash; +use sp_runtime::traits::{ Hash, Header }; use std::sync::Arc; -/// A representation of a block from which you can obtain details -/// including the block header, extrinsics and events for the block. +/// A representation of a block. pub struct Block { - hash: T::Hash, - details: ChainBlockResponse, + header: T::Header, + client: C, // Since we obtain the same events for every extrinsic, let's // cache them so that we only ever do that once: - cached_events: Arc>>>, - client: C, + cached_events: CachedEvents, } +// A cache for our events so we don't fetch them more than once when +// iterating over events for extrinsics. +type CachedEvents = Arc>>>; + impl Block where T: Config, C: OfflineClientT, { - pub(crate) fn new(hash: T::Hash, details: ChainBlockResponse, client: C) -> Self { + pub(crate) fn new(header: T::Header, client: C) -> Self { Block { - hash, - details, - cached_events: Default::default(), + header, client, + cached_events: Default::default(), } } /// Return the block hash. pub fn hash(&self) -> T::Hash { - self.hash + self.header.hash() + } + + /// Return the block number. + pub fn number(&self) -> T::BlockNumber { + *self.header().number() } - /// Return the block header. + /// Return the entire block header. pub fn header(&self) -> &T::Header { - &self.details.block.header + &self.header + } +} + +impl Block +where + T: Config, + C: OnlineClientT, +{ + /// Return the events associated with the block, fetching them from the node if necessary. + pub async fn events(&self) -> Result, Error> { + get_events(&self.client, self.header.hash(), &self.cached_events).await } - /// Returns an iterator over the extrinsics in the block. + /// Fetch and return the block body. + pub async fn body(&self) -> Result, Error> { + let block_hash = self.header.hash(); + let block_details = match self.client.rpc().block(Some(block_hash)).await? { + Some(block) => block, + None => { + return Err(BlockError::block_hash_not_found(block_hash).into()) + } + }; + + Ok(BlockBody::new(self.client.clone(), block_details, self.cached_events.clone())) + } +} + +/// The body of a block. +pub struct BlockBody { + details: ChainBlockResponse, + client: C, + cached_events: CachedEvents +} + +impl BlockBody +where + T: Config, + C: OfflineClientT, +{ + pub (crate) fn new(client: C, details: ChainBlockResponse, cached_events: CachedEvents) -> Self { + Self { + details, + client, + cached_events + } + } + + /// Returns an iterator over the extrinsics in the block body. pub fn extrinsics(&self) -> impl Iterator> { self.details .block @@ -64,7 +118,7 @@ where index: idx as u32, bytes: &e.0, client: self.client.clone(), - block_hash: self.hash, + block_hash: self.details.block.header.hash(), cached_events: self.cached_events.clone(), _marker: std::marker::PhantomData, } @@ -105,19 +159,7 @@ where { /// The events associated with the extrinsic. pub async fn events(&self) -> Result, Error> { - // Acquire lock on the events cache. We either get back our events or we fetch and set them - // before unlocking, so only one fetch call should ever be made. We do this because the - // same events can be shared across all extrinsics in the block. - let lock = self.cached_events.lock().await; - let events = match &*lock { - Some(events) => events.clone(), - None => { - events::EventsClient::new(self.client.clone()) - .at(Some(self.block_hash)) - .await? - } - }; - + let events = get_events(&self.client, self.block_hash, &self.cached_events).await?; let ext_hash = T::Hashing::hash_of(&self.bytes); Ok(ExtrinsicEvents::new(ext_hash, self.index, events)) } @@ -204,3 +246,25 @@ impl ExtrinsicEvents { Ok(self.find::().next().transpose()?.is_some()) } } + +// Return Events from the cache, or fetch from the node if needed. +async fn get_events(client: &C, block_hash: T::Hash, cached_events: &AsyncMutex>>) -> Result, Error> +where + T: Config, + C: OnlineClientT +{ + // Acquire lock on the events cache. We either get back our events or we fetch and set them + // before unlocking, so only one fetch call should ever be made. We do this because the + // same events can be shared across all extrinsics in the block. + let lock = cached_events.lock().await; + let events = match &*lock { + Some(events) => events.clone(), + None => { + events::EventsClient::new(client.clone()) + .at(Some(block_hash)) + .await? + } + }; + + Ok(events) +} diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index 98db507cb5..dc81d892f4 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -78,12 +78,12 @@ where } }; - let res = match client.rpc().block(Some(block_hash)).await? { - Some(block) => block, + let block_header = match client.rpc().header(Some(block_hash)).await? { + Some(header) => header, None => return Err(BlockError::block_hash_not_found(block_hash).into()), }; - Ok(Block::new(block_hash, res, client)) + Ok(Block::new(block_header, client)) } } @@ -97,7 +97,11 @@ where where Client: Send + Sync + 'static, { - header_sub_fut_to_block_sub(self.clone(), self.subscribe_all_headers()) + let client = self.client.clone(); + header_sub_fut_to_block_sub(self.clone(), async move { + let sub = client.rpc().subscribe_all_block_headers().await?; + BlockStreamRes::Ok(Box::pin(sub)) + }) } /// Subscribe to all new blocks imported by the node onto the current best fork. @@ -110,62 +114,22 @@ where where Client: Send + Sync + 'static, { - header_sub_fut_to_block_sub(self.clone(), self.subscribe_best_headers()) + let client = self.client.clone(); + header_sub_fut_to_block_sub(self.clone(), async move { + let sub = client.rpc().subscribe_best_block_headers().await?; + BlockStreamRes::Ok(Box::pin(sub)) + }) } /// Subscribe to finalized blocks. - /// - /// This builds upon [`BlocksClient::subscribe_finalized_headers`] and returns details for - /// every block, in order, that has been finalized. pub fn subscribe_finalized( &self, ) -> impl Future>, Error>> + Send + 'static where Client: Send + Sync + 'static, - { - header_sub_fut_to_block_sub(self.clone(), self.subscribe_finalized_headers()) - } - - /// Subscribe to headers for every new block that is imported by the node. - /// These headers might be for blocks not on the current best chain. - /// - /// **Note:** You probably want to use [`Self::subscribe_finalized_headers()`] most - /// of the time. - pub fn subscribe_all_headers( - &self, - ) -> impl Future, Error>> + Send + 'static { let client = self.client.clone(); - async move { - let sub = client.rpc().subscribe_all_block_headers().await?; - BlockStreamRes::Ok(Box::pin(sub)) - } - } - - /// Subscribe to headers for each new block that is imported by the node and - /// added to the current best fork. - /// - /// **Note:** You probably want to use [`Self::subscribe_finalized_headers()`] most - /// of the time. - pub fn subscribe_best_headers( - &self, - ) -> impl Future, Error>> + Send + 'static - { - let client = self.client.clone(); - async move { - let sub = client.rpc().subscribe_best_block_headers().await?; - BlockStreamRes::Ok(Box::pin(sub)) - } - } - - /// Subscribe to finalized block headers. This subscription returns every block that is part of - /// the finalized chain, in order, from the first finalized block seen at the time of calling this. - pub fn subscribe_finalized_headers( - &self, - ) -> impl Future, Error>> + Send + 'static - { - let client = self.client.clone(); - async move { + header_sub_fut_to_block_sub(self.clone(), async move { // Fetch the last finalised block details immediately, so that we'll get // all blocks after this one. let last_finalized_block_hash = client.rpc().finalized_head().await?; @@ -186,7 +150,7 @@ where ) .boxed(), ) - } + }) } } @@ -210,15 +174,7 @@ where Err(e) => return Err(e), }; - let block_hash = header.hash(); - let block_details = match client.rpc().block(Some(block_hash)).await? { - Some(block) => block, - None => { - return Err(BlockError::block_hash_not_found(block_hash).into()) - } - }; - - Ok(Block::new(block_hash, block_details, client)) + Ok(Block::new(header, client)) } }); BlockStreamRes::Ok(Box::pin(sub)) diff --git a/subxt/src/events/events_client.rs b/subxt/src/events/events_client.rs index 6c5fefd14a..d774ff1fa7 100644 --- a/subxt/src/events/events_client.rs +++ b/subxt/src/events/events_client.rs @@ -5,12 +5,7 @@ use crate::{ client::OnlineClientT, error::Error, - events::{ - EventSub, - EventSubscription, - Events, - FinalizedEventSub, - }, + events::Events, Config, }; use derivative::Derivative; @@ -81,93 +76,6 @@ where Ok(Events::new(client.metadata(), block_hash, event_bytes)) } } - - /// Subscribe to events from all newly imported blocks. - /// - /// **Note:** these blocks haven't necessarily been finalised yet; prefer - /// [`EventsClient::subscribe_finalized()`] if that is important. - pub fn subscribe_all( - &self, - ) -> impl Future< - Output = Result>, Error>, - > + Send - + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - async move { - let block_subscription = client.blocks().subscribe_all_headers().await?; - Ok(EventSubscription::new(client, block_subscription)) - } - } - - /// Subscribe to events from all newly imported blocks that are added to the best fork. - /// - /// **Note:** these blocks haven't necessarily been finalised yet; prefer - /// [`EventsClient::subscribe_finalized()`] if that is important. - pub fn subscribe_best( - &self, - ) -> impl Future< - Output = Result>, Error>, - > + Send - + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - async move { - let block_subscription = client.blocks().subscribe_best_headers().await?; - Ok(EventSubscription::new(client, block_subscription)) - } - } - - /// Subscribe to events from all finalized blocks. - /// - /// # Example - /// - /// ```no_run - /// # #[tokio::main] - /// # async fn main() { - /// use futures::StreamExt; - /// use subxt::{ OnlineClient, PolkadotConfig }; - /// - /// let api = OnlineClient::::new().await.unwrap(); - /// - /// let mut events = api.events().subscribe_finalized().await.unwrap(); - /// - /// while let Some(ev) = events.next().await { - /// // Obtain all events from this block. - /// let ev = ev.unwrap(); - /// // Print block hash. - /// println!("Event at block hash {:?}", ev.block_hash()); - /// // Iterate over all events. - /// let mut iter = ev.iter(); - /// while let Some(event_details) = iter.next() { - /// println!("Event details {:?}", event_details); - /// } - /// } - /// # } - /// ``` - pub fn subscribe_finalized( - &self, - ) -> impl Future< - Output = Result< - EventSubscription>, - Error, - >, - > + Send - + 'static - where - Client: Send + Sync + 'static, - { - let client = self.client.clone(); - async move { - let block_subscription = - client.blocks().subscribe_finalized_headers().await?; - Ok(EventSubscription::new(client, block_subscription)) - } - } } // The storage key needed to access events. From c9080f1996db97dfb59b2876f3744bb9d2a5555c Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 21 Oct 2022 16:36:28 +0100 Subject: [PATCH 08/17] Remove the event filtering/subscribing stuff --- examples/examples/subscribe_one_event.rs | 72 ---- examples/examples/subscribe_some_events.rs | 87 ----- subxt/src/blocks/block_types.rs | 40 +- subxt/src/events/event_subscription.rs | 208 ---------- subxt/src/events/filter_events.rs | 403 -------------------- subxt/src/events/mod.rs | 12 - testing/integration-tests/src/blocks/mod.rs | 4 +- testing/integration-tests/src/events/mod.rs | 212 ---------- testing/integration-tests/src/lib.rs | 2 - 9 files changed, 29 insertions(+), 1011 deletions(-) delete mode 100644 examples/examples/subscribe_one_event.rs delete mode 100644 examples/examples/subscribe_some_events.rs delete mode 100644 subxt/src/events/event_subscription.rs delete mode 100644 subxt/src/events/filter_events.rs delete mode 100644 testing/integration-tests/src/events/mod.rs diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs deleted file mode 100644 index 30ca32cf10..0000000000 --- a/examples/examples/subscribe_one_event.rs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! To run this example, a local polkadot node should be running. Example verified against polkadot v0.9.28-9ffe6e9e3da. -//! -//! E.g. -//! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.28/polkadot" --output /usr/local/bin/polkadot --location -//! polkadot --dev --tmp -//! ``` - -use futures::StreamExt; -use sp_keyring::AccountKeyring; -use std::time::Duration; -use subxt::{ - tx::PairSigner, - OnlineClient, - PolkadotConfig, -}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -pub mod polkadot {} - -/// Subscribe to all events, and then manually look through them and -/// pluck out the events that we care about. -#[tokio::main] -async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); - - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Subscribe to just balance transfer events, making use of `filter_events` - // to select a single event type (note the 1-tuple) to filter out and return. - let mut transfer_events = api - .events() - .subscribe_finalized() - .await? - .filter_events::<(polkadot::balances::events::Transfer,)>(); - - // While this subscription is active, balance transfers are made somewhere: - tokio::task::spawn({ - let api = api.clone(); - async move { - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let mut transfer_amount = 1_000_000_000; - - // Make small balance transfers from Alice to Bob in a loop: - loop { - let transfer_tx = polkadot::tx().balances().transfer( - AccountKeyring::Bob.to_account_id().into(), - transfer_amount, - ); - api.tx() - .sign_and_submit_default(&transfer_tx, &signer) - .await - .unwrap(); - - tokio::time::sleep(Duration::from_secs(10)).await; - transfer_amount += 100_000_000; - } - } - }); - - // Our subscription will see all of the transfer events emitted as a result of this: - while let Some(transfer_event) = transfer_events.next().await { - println!("Balance transfer event: {transfer_event:?}"); - } - - Ok(()) -} diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs deleted file mode 100644 index 2f39ebf73e..0000000000 --- a/examples/examples/subscribe_some_events.rs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! To run this example, a local polkadot node should be running. Example verified against polkadot v0.9.28-9ffe6e9e3da. -//! -//! E.g. -//! ```bash -//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.28/polkadot" --output /usr/local/bin/polkadot --location -//! polkadot --dev --tmp -//! ``` - -use futures::StreamExt; -use sp_keyring::AccountKeyring; -use std::time::Duration; -use subxt::{ - tx::PairSigner, - OnlineClient, - PolkadotConfig, -}; - -#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] -pub mod polkadot {} - -/// Subscribe to all events, and then manually look through them and -/// pluck out the events that we care about. -#[tokio::main] -async fn main() -> Result<(), Box> { - tracing_subscriber::fmt::init(); - - // Create a client to use: - let api = OnlineClient::::new().await?; - - // Subscribe to several balance related events. If we ask for more than one event, - // we'll be given a correpsonding tuple of `Option`'s, with exactly one - // variant populated each time. - let mut balance_events = api.events().subscribe_finalized().await?.filter_events::<( - polkadot::balances::events::Withdraw, - polkadot::balances::events::Transfer, - polkadot::balances::events::Deposit, - )>(); - - // While this subscription is active, balance transfers are made somewhere: - tokio::task::spawn({ - let api = api.clone(); - async move { - let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let mut transfer_amount = 1_000_000_000; - - // Make small balance transfers from Alice to Bob in a loop: - loop { - let transfer_tx = polkadot::tx().balances().transfer( - AccountKeyring::Bob.to_account_id().into(), - transfer_amount, - ); - api.tx() - .sign_and_submit_default(&transfer_tx, &signer) - .await - .unwrap(); - - tokio::time::sleep(Duration::from_secs(10)).await; - transfer_amount += 100_000_000; - } - } - }); - - // Our subscription will see all of the balance events we're filtering on: - while let Some(ev) = balance_events.next().await { - let event_details = ev?; - - let block_hash = event_details.block_hash; - let event = event_details.event; - println!("Event at {:?}:", block_hash); - - if let (Some(withdraw), _, _) = &event { - println!(" Withdraw event: {withdraw:?}"); - } - if let (_, Some(transfer), _) = &event { - println!(" Transfer event: {transfer:?}"); - } - if let (_, _, Some(deposit)) = &event { - println!(" Deposit event: {deposit:?}"); - } - } - - Ok(()) -} diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index afeb5f9785..eec41be396 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -8,8 +8,8 @@ use crate::{ OnlineClientT, }, error::{ - Error, BlockError, + Error, }, events, rpc::ChainBlockResponse, @@ -17,7 +17,10 @@ use crate::{ }; use derivative::Derivative; use futures::lock::Mutex as AsyncMutex; -use sp_runtime::traits::{ Hash, Header }; +use sp_runtime::traits::{ + Hash, + Header, +}; use std::sync::Arc; /// A representation of a block. @@ -77,12 +80,14 @@ where let block_hash = self.header.hash(); let block_details = match self.client.rpc().block(Some(block_hash)).await? { Some(block) => block, - None => { - return Err(BlockError::block_hash_not_found(block_hash).into()) - } + None => return Err(BlockError::block_hash_not_found(block_hash).into()), }; - Ok(BlockBody::new(self.client.clone(), block_details, self.cached_events.clone())) + Ok(BlockBody::new( + self.client.clone(), + block_details, + self.cached_events.clone(), + )) } } @@ -90,19 +95,23 @@ where pub struct BlockBody { details: ChainBlockResponse, client: C, - cached_events: CachedEvents + cached_events: CachedEvents, } -impl BlockBody +impl BlockBody where T: Config, C: OfflineClientT, { - pub (crate) fn new(client: C, details: ChainBlockResponse, cached_events: CachedEvents) -> Self { + pub(crate) fn new( + client: C, + details: ChainBlockResponse, + cached_events: CachedEvents, + ) -> Self { Self { details, client, - cached_events + cached_events, } } @@ -159,7 +168,8 @@ where { /// The events associated with the extrinsic. pub async fn events(&self) -> Result, Error> { - let events = get_events(&self.client, self.block_hash, &self.cached_events).await?; + let events = + get_events(&self.client, self.block_hash, &self.cached_events).await?; let ext_hash = T::Hashing::hash_of(&self.bytes); Ok(ExtrinsicEvents::new(ext_hash, self.index, events)) } @@ -248,10 +258,14 @@ impl ExtrinsicEvents { } // Return Events from the cache, or fetch from the node if needed. -async fn get_events(client: &C, block_hash: T::Hash, cached_events: &AsyncMutex>>) -> Result, Error> +async fn get_events( + client: &C, + block_hash: T::Hash, + cached_events: &AsyncMutex>>, +) -> Result, Error> where T: Config, - C: OnlineClientT + C: OnlineClientT, { // Acquire lock on the events cache. We either get back our events or we fetch and set them // before unlocking, so only one fetch call should ever be made. We do this because the diff --git a/subxt/src/events/event_subscription.rs b/subxt/src/events/event_subscription.rs deleted file mode 100644 index 85fd4f221a..0000000000 --- a/subxt/src/events/event_subscription.rs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Subscribing to events. - -use crate::{ - client::OnlineClientT, - error::Error, - events::EventsClient, - Config, -}; -use derivative::Derivative; -use futures::{ - stream::BoxStream, - Future, - FutureExt, - Stream, - StreamExt, -}; -use sp_runtime::traits::Header; -use std::{ - marker::Unpin, - task::Poll, -}; - -pub use super::{ - EventDetails, - EventFilter, - Events, - FilterEvents, -}; - -/// A Subscription. This forms a part of the `EventSubscription` type handed back -/// in codegen from `subscribe_finalized`, and is exposed to be used in codegen. -#[doc(hidden)] -pub type FinalizedEventSub
= BoxStream<'static, Result>; - -/// A Subscription. This forms a part of the `EventSubscription` type handed back -/// in codegen from `subscribe`, and is exposed to be used in codegen. -#[doc(hidden)] -pub type EventSub = BoxStream<'static, Result>; - -/// A subscription to events that implements [`Stream`], and returns [`Events`] objects for each block. -#[derive(Derivative)] -#[derivative(Debug(bound = "Sub: std::fmt::Debug, Client: std::fmt::Debug"))] -pub struct EventSubscription { - finished: bool, - client: Client, - block_header_subscription: Sub, - #[derivative(Debug = "ignore")] - at: Option, Error>> + Send>>>, -} - -impl> EventSubscription -where - Sub: Stream> + Unpin, -{ - /// Create a new [`EventSubscription`] from a client and a subscription - /// which returns block headers. - pub fn new(client: Client, block_header_subscription: Sub) -> Self { - EventSubscription { - finished: false, - client, - block_header_subscription, - at: None, - } - } - - /// Return only specific events matching the tuple of 1 or more event - /// types that has been provided as the `Filter` type parameter. - /// - /// # Example - /// - /// ```no_run - /// use futures::StreamExt; - /// use subxt::{OnlineClient, PolkadotConfig}; - /// - /// #[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] - /// pub mod polkadot {} - /// - /// # #[tokio::main] - /// # async fn main() { - /// let api = OnlineClient::::new().await.unwrap(); - /// - /// let mut events = api - /// .events() - /// .subscribe() - /// .await - /// .unwrap() - /// .filter_events::<( - /// polkadot::balances::events::Transfer, - /// polkadot::balances::events::Deposit - /// )>(); - /// - /// while let Some(ev) = events.next().await { - /// let event_details = ev.unwrap(); - /// match event_details.event { - /// (Some(transfer), None) => println!("Balance transfer event: {transfer:?}"), - /// (None, Some(deposit)) => println!("Balance deposit event: {deposit:?}"), - /// _ => unreachable!() - /// } - /// } - /// # } - /// ``` - pub fn filter_events( - self, - ) -> FilterEvents<'static, Self, T, Filter> { - FilterEvents::new(self) - } -} - -impl Unpin for EventSubscription {} - -// We want `EventSubscription` to implement Stream. The below implementation is the rather verbose -// way to roughly implement the following function: -// -// ``` -// fn subscribe_events(client: &'_ Client, block_sub: Subscription) -> impl Stream, Error>> + '_ { -// use futures::StreamExt; -// block_sub.then(move |block_header_res| async move { -// use sp_runtime::traits::Header; -// let block_header = block_header_res?; -// let block_hash = block_header.hash(); -// at(client, block_hash).await -// }) -// } -// ``` -// -// The advantage of this manual implementation is that we have a named type that we (and others) -// can derive things on, store away, alias etc. -impl Stream for EventSubscription -where - T: Config, - Client: OnlineClientT, - Sub: Stream> + Unpin, - E: Into, -{ - type Item = Result, Error>; - - fn poll_next( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - // We are finished; return None. - if self.finished { - return Poll::Ready(None) - } - - // If there isn't an `at` function yet that's busy resolving a block hash into - // some event details, then poll the block header subscription to get one. - if self.at.is_none() { - match futures::ready!(self.block_header_subscription.poll_next_unpin(cx)) { - None => { - self.finished = true; - return Poll::Ready(None) - } - Some(Err(e)) => { - self.finished = true; - return Poll::Ready(Some(Err(e.into()))) - } - Some(Ok(block_header)) => { - // Note [jsdw]: We may be able to get rid of the per-item allocation - // with https://github.com/oblique/reusable-box-future. - let at = EventsClient::new(self.client.clone()) - .at(Some(block_header.hash())); - self.at = Some(Box::pin(at)); - // Continue, so that we poll this function future we've just created. - } - } - } - - // If we get here, there will be an `at` function stored. Unwrap it and poll it to - // completion to get our events, throwing it away as soon as it is ready. - let at_fn = self - .at - .as_mut() - .expect("'at' function should have been set above'"); - let events = futures::ready!(at_fn.poll_unpin(cx)); - self.at = None; - Poll::Ready(Some(events)) - } -} - -#[cfg(test)] -mod test { - use super::*; - - // Ensure `EventSubscription` can be sent; only actually a compile-time check. - #[allow(unused)] - fn check_sendability() { - fn assert_send() {} - assert_send::< - EventSubscription< - crate::SubstrateConfig, - (), - EventSub<::Header>, - >, - >(); - assert_send::< - EventSubscription< - crate::SubstrateConfig, - (), - FinalizedEventSub<::Header>, - >, - >(); - } -} diff --git a/subxt/src/events/filter_events.rs b/subxt/src/events/filter_events.rs deleted file mode 100644 index 9507c1c412..0000000000 --- a/subxt/src/events/filter_events.rs +++ /dev/null @@ -1,403 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -//! Filtering individual events from subscriptions. - -use super::{ - Events, - Phase, - StaticEvent, -}; -use crate::{ - Config, - Error, -}; -use futures::{ - Stream, - StreamExt, -}; -use std::{ - marker::Unpin, - task::Poll, -}; - -/// A stream which filters events based on the `Filter` param provided. -/// If `Filter` is a 1-tuple of a single `Event` type, it will return every -/// instance of that event as it's found. If `filter` is ` tuple of multiple -/// `Event` types, it will return a corresponding tuple of `Option`s, where -/// exactly one of these will be `Some(event)` each iteration. -pub struct FilterEvents<'a, Sub: 'a, T: Config, Filter: EventFilter> { - // A subscription; in order for the Stream impl to apply, this will - // impl `Stream, Error>> + Unpin + 'a`. - sub: Sub, - // Each time we get Events from our subscription, they are stored here - // and iterated through in future stream iterations until exhausted. - events: Option< - Box< - dyn Iterator< - Item = Result< - FilteredEventDetails, - Error, - >, - > + Send - + 'a, - >, - >, -} - -impl<'a, Sub: 'a, T: Config, Filter: EventFilter> Unpin - for FilterEvents<'a, Sub, T, Filter> -{ -} - -impl<'a, Sub: 'a, T: Config, Filter: EventFilter> FilterEvents<'a, Sub, T, Filter> { - pub(crate) fn new(sub: Sub) -> Self { - Self { sub, events: None } - } -} - -impl<'a, Sub, T, Filter> Stream for FilterEvents<'a, Sub, T, Filter> -where - Sub: Stream, Error>> + Unpin + 'a, - T: Config, - Filter: EventFilter, -{ - type Item = Result, Error>; - fn poll_next( - mut self: std::pin::Pin<&mut Self>, - cx: &mut std::task::Context<'_>, - ) -> std::task::Poll> { - loop { - // Drain the current events we're iterating over first: - if let Some(events_iter) = self.events.as_mut() { - match events_iter.next() { - Some(res) => return Poll::Ready(Some(res)), - None => { - self.events = None; - } - } - } - - // Wait for new events to come in: - match futures::ready!(self.sub.poll_next_unpin(cx)) { - None => return Poll::Ready(None), - Some(Err(e)) => return Poll::Ready(Some(Err(e))), - Some(Ok(events)) => { - self.events = Some(Filter::filter(events)); - } - }; - } - } -} - -/// This is returned from the [`FilterEvents`] impl of [`Stream`]. It contains -/// some type representing an event we've filtered on, along with couple of additional -/// pieces of information about that event. -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct FilteredEventDetails { - /// During which [`Phase`] was the event produced? - pub phase: Phase, - /// Hash of the block that this event came from. - pub block_hash: BlockHash, - /// A type containing an event that we've filtered on. - /// Depending on the filter type, this may be a tuple - /// or a single event. - pub event: Evs, -} - -/// This trait is implemented for tuples of Event types; any such tuple (up to size 8) can be -/// used to filter an event subscription to return only the specified events. -pub trait EventFilter: private::Sealed { - /// The type we'll be handed back from filtering. - type ReturnType; - /// Filter the events based on the type implementing this trait. - fn filter( - events: Events, - ) -> Box< - dyn Iterator< - Item = Result, Error>, - > + Send, - >; -} - -// Prevent userspace implementations of the above trait; the interface is not considered stable -// and is not a particularly nice API to work with (particularly because it involves boxing, which -// would be nice to get rid of eventually). -pub(crate) mod private { - pub trait Sealed {} -} - -// A special case impl for searching for a tuple of exactly one event (in this case, we don't -// need to return an `(Option,)`; we can just return `Event`. -impl private::Sealed for (Ev,) {} -impl EventFilter for (Ev,) { - type ReturnType = Ev; - fn filter( - events: Events, - ) -> Box, Error>> + Send> - { - let block_hash = events.block_hash(); - let mut iter = events.iter(); - Box::new(std::iter::from_fn(move || { - for ev in iter.by_ref() { - // Forward any error immediately: - let raw_event = match ev { - Ok(ev) => ev, - Err(e) => return Some(Err(e)), - }; - // Try decoding each type until we hit a match or an error: - let ev = raw_event.as_event::(); - if let Ok(Some(event)) = ev { - // We found a match; return our tuple. - return Some(Ok(FilteredEventDetails { - phase: raw_event.phase(), - block_hash, - event, - })) - } - if let Err(e) = ev { - // We hit an error. Return it. - return Some(Err(e.into())) - } - } - None - })) - } -} - -// A generalised impl for tuples of sizes greater than 1: -macro_rules! impl_event_filter { - ($($ty:ident $idx:tt),+) => { - impl <$($ty: StaticEvent),+> private::Sealed for ( $($ty,)+ ) {} - impl <$($ty: StaticEvent),+> EventFilter for ( $($ty,)+ ) { - type ReturnType = ( $(Option<$ty>,)+ ); - fn filter( - events: Events - ) -> Box, Error>> + Send> { - let block_hash = events.block_hash(); - let mut iter = events.iter(); - Box::new(std::iter::from_fn(move || { - let mut out: ( $(Option<$ty>,)+ ) = Default::default(); - for ev in iter.by_ref() { - // Forward any error immediately: - let raw_event = match ev { - Ok(ev) => ev, - Err(e) => return Some(Err(e)) - }; - // Try decoding each type until we hit a match or an error: - $({ - let ev = raw_event.as_event::<$ty>(); - if let Ok(Some(ev)) = ev { - // We found a match; return our tuple. - out.$idx = Some(ev); - return Some(Ok(FilteredEventDetails { - phase: raw_event.phase(), - block_hash, - event: out - })) - } - if let Err(e) = ev { - // We hit an error. Return it. - return Some(Err(e.into())) - } - })+ - } - None - })) - } - } - } -} - -impl_event_filter!(A 0, B 1); -impl_event_filter!(A 0, B 1, C 2); -impl_event_filter!(A 0, B 1, C 2, D 3); -impl_event_filter!(A 0, B 1, C 2, D 3, E 4); -impl_event_filter!(A 0, B 1, C 2, D 3, E 4, F 5); -impl_event_filter!(A 0, B 1, C 2, D 3, E 4, F 5, G 6); -impl_event_filter!(A 0, B 1, C 2, D 3, E 4, F 5, G 6, H 7); - -#[cfg(test)] -mod test { - use super::{ - super::events_type::test_utils::{ - event_record, - events, - metadata, - }, - *, - }; - use crate::{ - Config, - Metadata, - SubstrateConfig, - }; - use codec::{ - Decode, - Encode, - }; - use futures::{ - stream, - Stream, - StreamExt, - }; - use scale_info::TypeInfo; - - // Some pretend events in a pallet - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - enum PalletEvents { - A(EventA), - B(EventB), - C(EventC), - } - - // An event in our pallet that we can filter on. - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - struct EventA(u8); - impl StaticEvent for EventA { - const PALLET: &'static str = "Test"; - const EVENT: &'static str = "A"; - } - - // An event in our pallet that we can filter on. - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - struct EventB(bool); - impl StaticEvent for EventB { - const PALLET: &'static str = "Test"; - const EVENT: &'static str = "B"; - } - - // An event in our pallet that we can filter on. - #[derive(Clone, Debug, PartialEq, Decode, Encode, TypeInfo)] - struct EventC(u8, bool); - impl StaticEvent for EventC { - const PALLET: &'static str = "Test"; - const EVENT: &'static str = "C"; - } - - // A stream of fake events for us to try filtering on. - fn events_stream( - metadata: Metadata, - ) -> impl Stream, Error>> { - stream::iter(vec![ - events::( - metadata.clone(), - vec![ - event_record(Phase::Initialization, PalletEvents::A(EventA(1))), - event_record(Phase::ApplyExtrinsic(0), PalletEvents::B(EventB(true))), - event_record(Phase::Finalization, PalletEvents::A(EventA(2))), - ], - ), - events::( - metadata.clone(), - vec![event_record( - Phase::ApplyExtrinsic(1), - PalletEvents::B(EventB(false)), - )], - ), - events::( - metadata, - vec![ - event_record(Phase::ApplyExtrinsic(2), PalletEvents::B(EventB(true))), - event_record(Phase::ApplyExtrinsic(3), PalletEvents::A(EventA(3))), - ], - ), - ]) - .map(Ok::<_, Error>) - } - - #[tokio::test] - async fn filter_one_event_from_stream() { - let metadata = metadata::(); - - // Filter out fake event stream to select events matching `EventA` only. - let actual: Vec<_> = - FilterEvents::<_, SubstrateConfig, (EventA,)>::new(events_stream(metadata)) - .map(|e| e.unwrap()) - .collect() - .await; - - let expected = vec![ - FilteredEventDetails { - phase: Phase::Initialization, - block_hash: ::Hash::default(), - event: EventA(1), - }, - FilteredEventDetails { - phase: Phase::Finalization, - block_hash: ::Hash::default(), - event: EventA(2), - }, - FilteredEventDetails { - phase: Phase::ApplyExtrinsic(3), - block_hash: ::Hash::default(), - event: EventA(3), - }, - ]; - - assert_eq!(actual, expected); - } - - #[tokio::test] - async fn filter_some_events_from_stream() { - let metadata = metadata::(); - - // Filter out fake event stream to select events matching `EventA` or `EventB`. - let actual: Vec<_> = FilterEvents::<_, SubstrateConfig, (EventA, EventB)>::new( - events_stream(metadata), - ) - .map(|e| e.unwrap()) - .collect() - .await; - - let expected = vec![ - FilteredEventDetails { - phase: Phase::Initialization, - block_hash: ::Hash::default(), - event: (Some(EventA(1)), None), - }, - FilteredEventDetails { - phase: Phase::ApplyExtrinsic(0), - block_hash: ::Hash::default(), - event: (None, Some(EventB(true))), - }, - FilteredEventDetails { - phase: Phase::Finalization, - block_hash: ::Hash::default(), - event: (Some(EventA(2)), None), - }, - FilteredEventDetails { - phase: Phase::ApplyExtrinsic(1), - block_hash: ::Hash::default(), - event: (None, Some(EventB(false))), - }, - FilteredEventDetails { - phase: Phase::ApplyExtrinsic(2), - block_hash: ::Hash::default(), - event: (None, Some(EventB(true))), - }, - FilteredEventDetails { - phase: Phase::ApplyExtrinsic(3), - block_hash: ::Hash::default(), - event: (Some(EventA(3)), None), - }, - ]; - - assert_eq!(actual, expected); - } - - #[tokio::test] - async fn filter_no_events_from_stream() { - let metadata = metadata::(); - - // Filter out fake event stream to select events matching `EventC` (none exist). - let actual: Vec<_> = - FilterEvents::<_, SubstrateConfig, (EventC,)>::new(events_stream(metadata)) - .map(|e| e.unwrap()) - .collect() - .await; - - assert_eq!(actual, vec![]); - } -} diff --git a/subxt/src/events/mod.rs b/subxt/src/events/mod.rs index fb66f1502c..69213532b6 100644 --- a/subxt/src/events/mod.rs +++ b/subxt/src/events/mod.rs @@ -6,26 +6,14 @@ //! The two main entry points into events are [`crate::OnlineClient::events()`] //! and calls like [crate::tx::TxProgress::wait_for_finalized_success()]. -mod event_subscription; mod events_client; mod events_type; -mod filter_events; -pub use event_subscription::{ - EventSub, - EventSubscription, - FinalizedEventSub, -}; pub use events_client::EventsClient; pub use events_type::{ EventDetails, Events, }; -pub use filter_events::{ - EventFilter, - FilterEvents, - FilteredEventDetails, -}; use codec::{ Decode, diff --git a/testing/integration-tests/src/blocks/mod.rs b/testing/integration-tests/src/blocks/mod.rs index cbac2a9207..d3449ecc66 100644 --- a/testing/integration-tests/src/blocks/mod.rs +++ b/testing/integration-tests/src/blocks/mod.rs @@ -11,7 +11,7 @@ async fn non_finalized_headers_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let mut sub = api.blocks().subscribe_best_headers().await?; + let mut sub = api.blocks().subscribe_best().await?; // Wait for the next set of headers, and check that the // associated block hash is the one we just finalized. @@ -30,7 +30,7 @@ async fn finalized_headers_subscription() -> Result<(), subxt::Error> { let ctx = test_context().await; let api = ctx.client(); - let mut sub = api.blocks().subscribe_finalized_headers().await?; + let mut sub = api.blocks().subscribe_finalized().await?; // Wait for the next set of headers, and check that the // associated block hash is the one we just finalized. diff --git a/testing/integration-tests/src/events/mod.rs b/testing/integration-tests/src/events/mod.rs deleted file mode 100644 index 4d5255a7ab..0000000000 --- a/testing/integration-tests/src/events/mod.rs +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is dual-licensed as Apache-2.0 or GPL-3.0. -// see LICENSE for license details. - -use crate::{ - node_runtime::{ - self, - balances, - system, - }, - pair_signer, - test_context, - utils::wait_for_blocks, -}; -use futures::StreamExt; -use sp_keyring::AccountKeyring; - -// Check that we can subscribe to non-finalized block events. -#[tokio::test] -async fn non_finalized_block_subscription() -> Result<(), subxt::Error> { - let ctx = test_context().await; - let api = ctx.client(); - - let mut event_sub = api.events().subscribe_best().await?; - - // Wait for the next set of events, and check that the - // associated block hash is not finalized yet. - let events = event_sub.next().await.unwrap()?; - let event_block_hash = events.block_hash(); - let current_block_hash = api.rpc().block_hash(None).await?.unwrap(); - - assert_eq!(event_block_hash, current_block_hash); - Ok(()) -} - -// Check that we can subscribe to finalized block events. -#[tokio::test] -async fn finalized_block_subscription() -> Result<(), subxt::Error> { - let ctx = test_context().await; - let api = ctx.client(); - - let mut event_sub = api.events().subscribe_finalized().await?; - - // Wait for the next set of events, and check that the - // associated block hash is the one we just finalized. - // (this can be a bit slow as we have to wait for finalization) - let events = event_sub.next().await.unwrap()?; - let event_block_hash = events.block_hash(); - let finalized_hash = api.rpc().finalized_head().await?; - - assert_eq!(event_block_hash, finalized_hash); - Ok(()) -} - -// Check that our subscription actually keeps producing events for -// a few blocks. -#[tokio::test] -async fn subscription_produces_events_each_block() -> Result<(), subxt::Error> { - let ctx = test_context().await; - let api = ctx.client(); - - wait_for_blocks(&api).await; - - let mut event_sub = api.events().subscribe_best().await?; - - for i in 0..3 { - let events = event_sub - .next() - .await - .expect("events expected each block")?; - - let success_event = events - .find_first::() - .expect("decode error"); - - if success_event.is_none() { - let n = events.len(); - panic!("Expected an extrinsic success event on iteration {i} (saw {n} other events)") - } - } - - Ok(()) -} - -// Iterate all of the events in a few blocks to ensure we can decode them properly. -#[tokio::test] -async fn decoding_all_events_in_a_block_works() -> Result<(), subxt::Error> { - let ctx = test_context().await; - let api = ctx.client(); - - wait_for_blocks(&api).await; - - let mut event_sub = api.events().subscribe_best().await?; - - tokio::spawn(async move { - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id(); - let transfer_tx = node_runtime::tx() - .balances() - .transfer(bob.clone().into(), 10_000); - - // Make a load of transfers to get lots of events going. - for _i in 0..10 { - api.tx() - .sign_and_submit_then_watch_default(&transfer_tx, &alice) - .await - .expect("can submit_transaction"); - } - }); - - for _ in 0..4 { - let events = event_sub - .next() - .await - .expect("events expected each block")?; - - for event in events.iter() { - // make sure that we can get every event properly. - let event = event.expect("valid event decoded"); - // make sure that we can decode the field values from every event. - event.field_values().expect("can decode fields"); - } - } - - Ok(()) -} - -// Check that our subscription receives events, and we can filter them based on -// it's Stream impl, and ultimately see the event we expect. -#[tokio::test] -async fn balance_transfer_subscription() -> Result<(), subxt::Error> { - let ctx = test_context().await; - let api = ctx.client(); - - // Subscribe to balance transfer events, ignoring all else. - let event_sub = api - .events() - .subscribe_best() - .await? - .filter_events::<(balances::events::Transfer,)>(); - - // Calling `.next()` on the above borrows it, and the `filter_map` - // means it's no longer `Unpin`, so we pin it on the stack: - futures::pin_mut!(event_sub); - - // Make a transfer: - let alice = pair_signer(AccountKeyring::Alice.pair()); - let bob = AccountKeyring::Bob.to_account_id(); - let transfer_tx = node_runtime::tx() - .balances() - .transfer(bob.clone().into(), 10_000); - - api.tx() - .sign_and_submit_then_watch_default(&transfer_tx, &alice) - .await?; - - // Wait for the next balance transfer event in our subscription stream - // and check that it lines up: - let event = event_sub.next().await.unwrap().unwrap().event; - assert_eq!( - event, - balances::events::Transfer { - from: alice.account_id().clone(), - to: bob.clone(), - amount: 10_000 - } - ); - - Ok(()) -} - -// This is just a compile-time check that we can subscribe to events in -// a context that requires the event subscription/filtering to be Send-able. -// We test a typical use of EventSubscription and FilterEvents. We don't need -// to run this code; just check that it compiles. -#[allow(unused)] -async fn check_events_are_sendable() { - // check that EventSubscription can be used across await points. - tokio::task::spawn(async { - let ctx = test_context().await; - - let mut event_sub = ctx.client().events().subscribe_best().await?; - - while let Some(ev) = event_sub.next().await { - // if `event_sub` doesn't implement Send, we can't hold - // it across an await point inside of a tokio::spawn, which - // requires Send. This will lead to a compile error. - } - - Ok::<_, subxt::Error>(()) - }); - - // Check that FilterEvents can be used across await points. - tokio::task::spawn(async { - let ctx = test_context().await; - - let mut event_sub = ctx - .client() - .events() - .subscribe_all() - .await? - .filter_events::<(balances::events::Transfer,)>(); - - while let Some(ev) = event_sub.next().await { - // if `event_sub` doesn't implement Send, we can't hold - // it across an await point inside of a tokio::spawn, which - // requires Send; This will lead to a compile error. - } - - Ok::<_, subxt::Error>(()) - }); -} diff --git a/testing/integration-tests/src/lib.rs b/testing/integration-tests/src/lib.rs index 4959d67506..12f61e5667 100644 --- a/testing/integration-tests/src/lib.rs +++ b/testing/integration-tests/src/lib.rs @@ -14,8 +14,6 @@ mod blocks; #[cfg(test)] mod client; #[cfg(test)] -mod events; -#[cfg(test)] mod frame; #[cfg(test)] mod metadata; From 16dd212480719fe51e397d6ddfdd2e2c3ed591b4 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 21 Oct 2022 16:40:01 +0100 Subject: [PATCH 09/17] clippy --- subxt/Cargo.toml | 2 -- subxt/src/blocks/blocks_client.rs | 30 ++++++++++++++---------------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 67dc9eaae1..5a4d425443 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -48,5 +48,3 @@ sp-runtime = "6.0.0" frame-metadata = "15.0.0" derivative = "2.2.0" -[dev-dependencies] -tokio = { version = "1.8", features = ["macros", "time", "rt-multi-thread"] } diff --git a/subxt/src/blocks/blocks_client.rs b/subxt/src/blocks/blocks_client.rs index dc81d892f4..9fa82b66cc 100644 --- a/subxt/src/blocks/blocks_client.rs +++ b/subxt/src/blocks/blocks_client.rs @@ -156,29 +156,27 @@ where /// Take a promise that will return a subscription to some block headers, /// and return a subscription to some blocks based on this. -fn header_sub_fut_to_block_sub( +async fn header_sub_fut_to_block_sub( blocks_client: BlocksClient, sub: S, -) -> impl Future>, Error>> + Send + 'static +) -> Result>, Error> where T: Config, S: Future, Error>> + Send + 'static, Client: OnlineClientT + Send + Sync + 'static, { - async move { - let sub = sub.await?.then(move |header| { - let client = blocks_client.client.clone(); - async move { - let header = match header { - Ok(header) => header, - Err(e) => return Err(e), - }; - - Ok(Block::new(header, client)) - } - }); - BlockStreamRes::Ok(Box::pin(sub)) - } + let sub = sub.await?.then(move |header| { + let client = blocks_client.client.clone(); + async move { + let header = match header { + Ok(header) => header, + Err(e) => return Err(e), + }; + + Ok(Block::new(header, client)) + } + }); + BlockStreamRes::Ok(Box::pin(sub)) } /// Note: This is exposed for testing but is not considered stable and may change From f967ec944e60c6f6ea5a711bf6856526f55d9708 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 21 Oct 2022 16:57:39 +0100 Subject: [PATCH 10/17] we need tokio, silly clippy --- subxt/Cargo.toml | 2 ++ subxt/src/lib.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index 5a4d425443..67dc9eaae1 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -48,3 +48,5 @@ sp-runtime = "6.0.0" frame-metadata = "15.0.0" derivative = "2.2.0" +[dev-dependencies] +tokio = { version = "1.8", features = ["macros", "time", "rt-multi-thread"] } diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index 38287f4ca9..86a4db7496 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -133,6 +133,11 @@ )] #![allow(clippy::type_complexity)] +// Suppress an unused dependency warning because tokio is +// only used in example code snippets at the time of writing. +#[cfg(test)] +use tokio as _; + pub use subxt_macro::subxt; pub mod blocks; From 85ad19c7d905e5b04e9b4a63c62daac3f5fcb822 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 26 Oct 2022 16:51:57 +0200 Subject: [PATCH 11/17] add extrinsic_index() call --- subxt/src/blocks/block_types.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index eec41be396..c37146cb31 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -204,6 +204,11 @@ impl ExtrinsicEvents { self.events.block_hash() } + /// The index of the extrinsic that these events are produced from. + pub fn extrinsic_index(&self) -> u32 { + self.idx + } + /// Return the hash of the extrinsic. pub fn extrinsic_hash(&self) -> T::Hash { self.ext_hash From 0326e632265ca6037bf5c6eab441728af7cb883a Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 31 Oct 2022 15:30:16 +0100 Subject: [PATCH 12/17] Update subxt/src/blocks/block_types.rs Co-authored-by: Andrew Jones --- subxt/src/blocks/block_types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subxt/src/blocks/block_types.rs b/subxt/src/blocks/block_types.rs index c37146cb31..3522991521 100644 --- a/subxt/src/blocks/block_types.rs +++ b/subxt/src/blocks/block_types.rs @@ -141,7 +141,7 @@ pub struct Extrinsic<'a, T: Config, C> { bytes: &'a [u8], client: C, block_hash: T::Hash, - cached_events: Arc>>>, + cached_events: CachedEvents, _marker: std::marker::PhantomData, } From 6f1afc9634e3ce008d1cf2ee3393ccca79065ac0 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 10 Nov 2022 17:12:39 +0000 Subject: [PATCH 13/17] Add dynbamic nested query example and make dynamic::tx a little easier to work with --- examples/examples/dynamic_nested_query.rs | 78 +++++++++++++++++++++++ subxt/src/tx/tx_client.rs | 4 +- subxt/src/tx/tx_payload.rs | 60 ++++++++++++++--- 3 files changed, 132 insertions(+), 10 deletions(-) create mode 100644 examples/examples/dynamic_nested_query.rs diff --git a/examples/examples/dynamic_nested_query.rs b/examples/examples/dynamic_nested_query.rs new file mode 100644 index 0000000000..03f8949b5b --- /dev/null +++ b/examples/examples/dynamic_nested_query.rs @@ -0,0 +1,78 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! To run this example, a local polkadot node should be running. Example verified against polkadot v0.9.31-3711c6f9b2a. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.31/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +use sp_keyring::AccountKeyring; +use subxt::{ + dynamic::Value, + tx::{ + DynamicTxPayload, + PairSigner, + }, + OnlineClient, + PolkadotConfig, +}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + + // My account. + let signer_account = AccountKeyring::Alice; + let signer_account_id = signer_account.to_account_id(); + let signer = PairSigner::new(signer_account.pair()); + + // Transfer balance to this destination: + let dest = AccountKeyring::Bob.to_account_id(); + + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Create the inner balance transfer call. + let call_value = subxt::dynamic::tx( + "Balances", + "transfer", + vec![ + Value::unnamed_variant("Id", [Value::from_bytes(&dest)]), + Value::u128(123_456_789_012_345), + ], + ); + + // Now, build an outer call which this inner call will be a part of. In this case, + // we are setting up a multisig arrangement for the inner call (but we are only + // specifying one signer; the one we'll use). + let tx: DynamicTxPayload = subxt::dynamic::tx( + "Multisig", + "as_multi", + vec![ + ("threshold", Value::u128(1)), + ( + "other_signatories", + Value::unnamed_composite([Value::from_bytes(&signer_account_id)]), + ), + ("maybe_timepoint", Value::unnamed_variant("None", [])), + ("call", call_value.into_value()), + ( + "max_weight", + Value::named_composite([ + ("ref_time", Value::u128(10000000000)), + ("proof_size", Value::u128(1)), + ]), + ), + ], + ); + + // Submit it: + let tx_hash = api.tx().sign_and_submit_default(&tx, &signer).await?; + println!("Submitted tx with hash {tx_hash}"); + + Ok(()) +} diff --git a/subxt/src/tx/tx_client.rs b/subxt/src/tx/tx_client.rs index 346c5d9ed6..36d0fbad64 100644 --- a/subxt/src/tx/tx_client.rs +++ b/subxt/src/tx/tx_client.rs @@ -79,7 +79,7 @@ impl> TxClient { { let metadata = self.client.metadata(); let mut bytes = Vec::new(); - call.encode_call_data(&metadata, &mut bytes)?; + call.encode_call_data_to(&metadata, &mut bytes)?; Ok(bytes) } @@ -101,7 +101,7 @@ impl> TxClient { // transaction protocol version (4) (is not signed, so no 1 bit at the front). 4u8.encode_to(&mut encoded_inner); // encode call data after this byte. - call.encode_call_data(&self.client.metadata(), &mut encoded_inner)?; + call.encode_call_data_to(&self.client.metadata(), &mut encoded_inner)?; // now, prefix byte length: let len = Compact( u32::try_from(encoded_inner.len()) diff --git a/subxt/src/tx/tx_payload.rs b/subxt/src/tx/tx_payload.rs index 70b25be864..1abb7ae340 100644 --- a/subxt/src/tx/tx_payload.rs +++ b/subxt/src/tx/tx_payload.rs @@ -14,18 +14,31 @@ use crate::{ metadata::Metadata, }; use codec::Encode; +use scale_value::{ + Composite, + ValueDef, + Variant, +}; use std::borrow::Cow; /// This represents a transaction payload that can be submitted /// to a node. pub trait TxPayload { /// Encode call data to the provided output. - fn encode_call_data( + fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec, ) -> Result<(), Error>; + /// Encode call data and return the output. This is a convenience + /// wrapper around [`TxPayload::encode_call_data_to`]. + fn encode_call_data(&self, metadata: &Metadata) -> Result, Error> { + let mut v = Vec::new(); + self.encode_call_data_to(metadata, &mut v)?; + Ok(v) + } + /// Returns the details needed to validate the call, which /// include a statically generated hash, the pallet name, /// and the call name. @@ -83,7 +96,7 @@ impl StaticTxPayload { } impl TxPayload for StaticTxPayload { - fn encode_call_data( + fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec, @@ -113,32 +126,63 @@ impl TxPayload for StaticTxPayload { pub struct DynamicTxPayload<'a> { pallet_name: Cow<'a, str>, call_name: Cow<'a, str>, - fields: Vec>, + fields: Composite<()>, +} + +impl<'a> DynamicTxPayload<'a> { + /// Return the pallet name. + pub fn pallet_name(&self) -> &str { + &self.pallet_name + } + + /// Return the call name. + pub fn call_name(&self) -> &str { + &self.call_name + } + + /// Convert the dynamic payload into a [`Value`]. This is useful + /// if you need to submit this as part of a larger call. + pub fn into_value(self) -> Value<()> { + let call = Value { + context: (), + value: ValueDef::Variant(Variant { + name: self.call_name.into_owned(), + values: self.fields, + }), + }; + + Value::unnamed_variant(self.pallet_name, [call]) + } } /// Construct a new dynamic transaction payload to submit to a node. pub fn dynamic<'a>( pallet_name: impl Into>, call_name: impl Into>, - fields: Vec>, + fields: impl Into>, ) -> DynamicTxPayload<'a> { DynamicTxPayload { pallet_name: pallet_name.into(), call_name: call_name.into(), - fields, + fields: fields.into(), } } impl<'a> TxPayload for DynamicTxPayload<'a> { - fn encode_call_data( + fn encode_call_data_to( &self, metadata: &Metadata, out: &mut Vec, ) -> Result<(), Error> { let pallet = metadata.pallet(&self.pallet_name)?; let call_id = pallet.call_ty_id().ok_or(MetadataError::CallNotFound)?; - let call_value = - Value::unnamed_variant(self.call_name.to_owned(), self.fields.clone()); + let call_value = Value { + context: (), + value: ValueDef::Variant(Variant { + name: self.call_name.to_string(), + values: self.fields.clone(), + }), + }; pallet.index().encode_to(out); scale_value::scale::encode_as_type(&call_value, call_id, metadata.types(), out)?; From 7734eb2cb88507ba9c9a78f7c2ec684278a5c253 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 10 Nov 2022 17:18:27 +0000 Subject: [PATCH 14/17] calL_value -> inner_tx --- examples/examples/dynamic_nested_query.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/examples/dynamic_nested_query.rs b/examples/examples/dynamic_nested_query.rs index 03f8949b5b..8393f7f7c0 100644 --- a/examples/examples/dynamic_nested_query.rs +++ b/examples/examples/dynamic_nested_query.rs @@ -37,7 +37,7 @@ async fn main() -> Result<(), Box> { let api = OnlineClient::::new().await?; // Create the inner balance transfer call. - let call_value = subxt::dynamic::tx( + let inner_tx = subxt::dynamic::tx( "Balances", "transfer", vec![ @@ -59,7 +59,7 @@ async fn main() -> Result<(), Box> { Value::unnamed_composite([Value::from_bytes(&signer_account_id)]), ), ("maybe_timepoint", Value::unnamed_variant("None", [])), - ("call", call_value.into_value()), + ("call", inner_tx.into_value()), ( "max_weight", Value::named_composite([ From 6bf1009ef52971edc65617daa7a95dce89485455 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 10 Nov 2022 17:21:56 +0000 Subject: [PATCH 15/17] rename example to dynamic_multisig to align with #713 naming --- .../examples/{dynamic_nested_query.rs => dynamic_multisig.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/examples/{dynamic_nested_query.rs => dynamic_multisig.rs} (100%) diff --git a/examples/examples/dynamic_nested_query.rs b/examples/examples/dynamic_multisig.rs similarity index 100% rename from examples/examples/dynamic_nested_query.rs rename to examples/examples/dynamic_multisig.rs From 3cfcb69237cd6fe633c43e4ca4a892fb35d9dbcf Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 11 Nov 2022 11:21:53 +0000 Subject: [PATCH 16/17] align dynamic and static multisig examples --- artifacts/polkadot_metadata.scale | Bin 350913 -> 356565 bytes examples/examples/dynamic_multisig.rs | 17 +- examples/examples/multisig.rs | 76 + .../integration-tests/src/codegen/polkadot.rs | 3886 +++++++++-------- 4 files changed, 2119 insertions(+), 1860 deletions(-) create mode 100644 examples/examples/multisig.rs diff --git a/artifacts/polkadot_metadata.scale b/artifacts/polkadot_metadata.scale index 4c20b122ee8b003fde8b7de7209cf2cc816fc138..b0d3e7de879b563b10e38c65ea021b0e15d015bc 100644 GIT binary patch delta 30057 zcmdtL3wRVo+BV#E=*i6Fz=R}_Kmrp8kiaA)oCM^M06~JB&nS=#$s`#_W|GVdBnn0p zR9sMFizTb5xT3NPDn_=&GrFj(qN1YWD=Vm|s3^GNii-Ysb>Q?W|k3DTEg* zBsJ)-^Ogrfl%&ck=b-&lwAWZ>?A@uen*!(%S7v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bidIR&=Hwfz> z^%bOe#an~a6J&|LW3ZYJwO;*rff_-Ktlte$S0d1&FS}fwLUFrowZm@LC$7I-9i*Qd zroson67l;H>b-a^DpY@shKG$*Yfxl`*fdi88(I^i)N1rEU7Q=G-svu}kgbG|E{CtZ zh4_Car9nc{?fO3WC*fe*6>2tS3`_Z6u#B#5VuRWniZT2V4qosED=&g*ZF zRbjX@SM(ewp+_GzPVFx{AJ7+%S7%Z5==BNeS%B566V(r?d%f5&NxcULeE-R6qqV|9 zwqYeUh@VYX`?Fn`rS~VRpISC!luDgAlE{0CeN$8$s{Q>GwXf{VKT6cg339H~^QWmW zuGlQ@E>+`E{gb8YcBDfCp-lY++8?PWOjqk@UxZ|BQzkUkH^LiULxZ;to<#%F6p&zp z?*imLG1FM99s1;Q6>c#-aOR0l?GkUzQb&MnW3yH04DS*B=U|mi>xpw!5Lf%`2So3y z)N&x(z*X2UAcYF9R;#JiYazQ)`k>fUp=O{TtHrwrz$5!1bi=6v8wl4I7*|!5Y7;5f zs9zw5TB)W=ucHTW*-%fr4%^4a&ZzUFgXW7TOfkf!vcIdz5xYL7N`)R$y#=k@QLPGk z)GpjLY9;3U<{EV_p~vjvW3SpkPuRt@1?oSgn?^5Eaa5|Jb}<&#E$&&Y4x?_Hcy}=hW$33Ct6;As3Q@1lVTqA$ z@z;8_3V{?+-k@#**YIx*Kmgg|FMc(<4gOJ&U{dlTs|z5GoiMi63wgc2;VN&Fe+HCi zyiFq`SB^GPXEb`NgS1Uiq;sf|HuKtG%D6~pu90#j{318|nkPnPm^n&-UtydOXf27% z$OzS5?JbX7nI&WP#pcy&Zsba_xlv8*RS~&Tig*nvF06T^d->)-vnO(;H}d}g+1$wO diff --git a/examples/examples/dynamic_multisig.rs b/examples/examples/dynamic_multisig.rs index 8393f7f7c0..226ef98aee 100644 --- a/examples/examples/dynamic_multisig.rs +++ b/examples/examples/dynamic_multisig.rs @@ -13,10 +13,7 @@ use sp_keyring::AccountKeyring; use subxt::{ dynamic::Value, - tx::{ - DynamicTxPayload, - PairSigner, - }, + tx::PairSigner, OnlineClient, PolkadotConfig, }; @@ -46,10 +43,12 @@ async fn main() -> Result<(), Box> { ], ); - // Now, build an outer call which this inner call will be a part of. In this case, - // we are setting up a multisig arrangement for the inner call (but we are only - // specifying one signer; the one we'll use). - let tx: DynamicTxPayload = subxt::dynamic::tx( + // Now, build an outer call which this inner call will be a part of. + // This sets up the multisig arrangement. + // + // Note: Since this is a dynamic call, we can either use named or unnamed + // arguments (if unnamed, the order matters). + let tx = subxt::dynamic::tx( "Multisig", "as_multi", vec![ @@ -71,6 +70,8 @@ async fn main() -> Result<(), Box> { ); // Submit it: + let encoded = hex::encode(&api.tx().call_data(&tx)?); + println!("Call data: {encoded}"); let tx_hash = api.tx().sign_and_submit_default(&tx, &signer).await?; println!("Submitted tx with hash {tx_hash}"); diff --git a/examples/examples/multisig.rs b/examples/examples/multisig.rs new file mode 100644 index 0000000000..a267f43a53 --- /dev/null +++ b/examples/examples/multisig.rs @@ -0,0 +1,76 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is dual-licensed as Apache-2.0 or GPL-3.0. +// see LICENSE for license details. + +//! To run this example, a local polkadot node should be running. Example verified against polkadot v0.9.31-3711c6f9b2a. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.31/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +use sp_keyring::AccountKeyring; +use subxt::{ + tx::PairSigner, + OnlineClient, + PolkadotConfig, +}; + +#[subxt::subxt(runtime_metadata_path = "../artifacts/polkadot_metadata.scale")] +pub mod polkadot {} + +#[tokio::main] +async fn main() -> Result<(), Box> { + tracing_subscriber::fmt::init(); + + // My account. + let signer_account = AccountKeyring::Alice; + let signer_account_id = signer_account.to_account_id(); + let signer = PairSigner::new(signer_account.pair()); + + // Transfer balance to this destination: + let dest = AccountKeyring::Bob.to_account_id(); + + // Create a client to use: + let api = OnlineClient::::new().await?; + + // Create the inner balance transfer call. + // + // Note: This call, being manually constructed, will have a specific pallet and call index + // which is determined by the generated code. If you're trying to submit this to a node which + // has the pallets/calls at different indexes, it will fail. See `dynamic_multisig.rs` for a + // workaround in this case which will work regardless of pallet and call indexes. + let inner_tx = polkadot::runtime_types::polkadot_runtime::RuntimeCall::Balances( + polkadot::runtime_types::pallet_balances::pallet::Call::transfer { + dest: dest.into(), + value: 123_456_789_012_345, + }, + ); + + // Now, build an outer call which this inner call will be a part of. + // This sets up the multisig arrangement. + let tx = polkadot::tx().multisig().as_multi( + // threashold + 1, + // other signatories + vec![signer_account_id], + // maybe timepoint + None, + // call + inner_tx, + // max weight + polkadot::runtime_types::sp_weights::weight_v2::Weight { + ref_time: 10000000000, + proof_size: 1, + }, + ); + + // Submit the extrinsic with default params: + let encoded = hex::encode(&api.tx().call_data(&tx)?); + println!("Call data: {encoded}"); + let tx_hash = api.tx().sign_and_submit_default(&tx, &signer).await?; + println!("Submitted tx with hash {tx_hash}"); + + Ok(()) +} diff --git a/testing/integration-tests/src/codegen/polkadot.rs b/testing/integration-tests/src/codegen/polkadot.rs index 38bd3f5c85..54ec32b105 100644 --- a/testing/integration-tests/src/codegen/polkadot.rs +++ b/testing/integration-tests/src/codegen/polkadot.rs @@ -1,7 +1,7 @@ #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod api { use super::api as root_mod; - pub static PALLETS: [&str; 52usize] = [ + pub static PALLETS: [&str; 53usize] = [ "System", "Scheduler", "Preimage", @@ -36,6 +36,7 @@ pub mod api { "ElectionProviderMultiPhase", "VoterList", "NominationPools", + "FastUnstake", "ParachainsOrigin", "Configuration", "ParasShared", @@ -117,6 +118,8 @@ pub mod api { VoterList(voter_list::Event), #[codec(index = 39)] NominationPools(nomination_pools::Event), + #[codec(index = 40)] + FastUnstake(fast_unstake::Event), #[codec(index = 53)] ParaInclusion(para_inclusion::Event), #[codec(index = 56)] @@ -139,16 +142,12 @@ pub mod api { XcmPallet(xcm_pallet::Event), } pub mod system { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -600,10 +599,10 @@ pub mod api { "BlockWeight", vec![], [ - 25u8, 97u8, 54u8, 87u8, 196u8, 64u8, 243u8, 40u8, 63u8, - 215u8, 225u8, 108u8, 83u8, 110u8, 180u8, 62u8, 160u8, 84u8, - 65u8, 29u8, 225u8, 34u8, 221u8, 108u8, 242u8, 129u8, 215u8, - 27u8, 28u8, 158u8, 72u8, 250u8, + 120u8, 67u8, 71u8, 163u8, 36u8, 202u8, 52u8, 106u8, 143u8, + 155u8, 144u8, 87u8, 142u8, 241u8, 232u8, 183u8, 56u8, 235u8, + 27u8, 237u8, 20u8, 202u8, 33u8, 85u8, 189u8, 0u8, 28u8, 52u8, + 198u8, 40u8, 219u8, 54u8, ], ) } @@ -816,10 +815,10 @@ pub mod api { "Events", vec![], [ - 11u8, 21u8, 235u8, 160u8, 138u8, 69u8, 107u8, 13u8, 81u8, - 202u8, 214u8, 235u8, 227u8, 69u8, 232u8, 144u8, 128u8, 37u8, - 227u8, 111u8, 223u8, 34u8, 6u8, 182u8, 202u8, 242u8, 219u8, - 201u8, 155u8, 118u8, 81u8, 248u8, + 230u8, 215u8, 9u8, 223u8, 139u8, 55u8, 22u8, 144u8, 226u8, + 245u8, 166u8, 235u8, 8u8, 182u8, 131u8, 51u8, 41u8, 148u8, + 102u8, 40u8, 86u8, 230u8, 82u8, 41u8, 226u8, 151u8, 247u8, + 41u8, 186u8, 190u8, 85u8, 20u8, ], ) } @@ -1019,10 +1018,10 @@ pub mod api { "System", "BlockWeights", [ - 64u8, 123u8, 136u8, 20u8, 38u8, 151u8, 254u8, 81u8, 251u8, - 41u8, 4u8, 87u8, 167u8, 25u8, 149u8, 3u8, 17u8, 65u8, 145u8, - 192u8, 195u8, 87u8, 182u8, 78u8, 104u8, 147u8, 9u8, 56u8, - 146u8, 20u8, 47u8, 22u8, + 118u8, 253u8, 239u8, 217u8, 145u8, 115u8, 85u8, 86u8, 172u8, + 248u8, 139u8, 32u8, 158u8, 126u8, 172u8, 188u8, 197u8, 105u8, + 145u8, 235u8, 171u8, 50u8, 31u8, 225u8, 167u8, 187u8, 241u8, + 87u8, 6u8, 17u8, 234u8, 185u8, ], ) } @@ -1125,16 +1124,12 @@ pub mod api { } } pub mod scheduler { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -1148,12 +1143,7 @@ pub mod api { ::core::primitive::u32, )>, pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, - >, + pub call: ::std::boxed::Box, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -1170,19 +1160,14 @@ pub mod api { Debug, )] pub struct ScheduleNamed { - pub id: ::std::vec::Vec<::core::primitive::u8>, + pub id: [::core::primitive::u8; 32usize], pub when: ::core::primitive::u32, pub maybe_periodic: ::core::option::Option<( ::core::primitive::u32, ::core::primitive::u32, )>, pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, - >, + pub call: ::std::boxed::Box, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -1190,7 +1175,7 @@ pub mod api { Debug, )] pub struct CancelNamed { - pub id: ::std::vec::Vec<::core::primitive::u8>, + pub id: [::core::primitive::u8; 32usize], } #[derive( :: subxt :: ext :: codec :: Decode, @@ -1204,12 +1189,7 @@ pub mod api { ::core::primitive::u32, )>, pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, - >, + pub call: ::std::boxed::Box, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -1217,19 +1197,14 @@ pub mod api { Debug, )] pub struct ScheduleNamedAfter { - pub id: ::std::vec::Vec<::core::primitive::u8>, + pub id: [::core::primitive::u8; 32usize], pub after: ::core::primitive::u32, pub maybe_periodic: ::core::option::Option<( ::core::primitive::u32, ::core::primitive::u32, )>, pub priority: ::core::primitive::u8, - pub call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, - >, + pub call: ::std::boxed::Box, } pub struct TransactionApi; impl TransactionApi { @@ -1242,10 +1217,7 @@ pub mod api { ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + call: runtime_types::polkadot_runtime::RuntimeCall, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Scheduler", @@ -1257,10 +1229,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 9u8, 8u8, 133u8, 200u8, 126u8, 145u8, 7u8, 135u8, 31u8, - 148u8, 58u8, 52u8, 10u8, 44u8, 65u8, 91u8, 79u8, 143u8, 10u8, - 39u8, 73u8, 184u8, 182u8, 219u8, 216u8, 215u8, 54u8, 68u8, - 9u8, 252u8, 131u8, 66u8, + 110u8, 118u8, 202u8, 51u8, 211u8, 53u8, 194u8, 114u8, 80u8, + 166u8, 134u8, 18u8, 89u8, 144u8, 204u8, 155u8, 201u8, 237u8, + 138u8, 170u8, 86u8, 16u8, 7u8, 2u8, 12u8, 96u8, 17u8, 148u8, + 147u8, 144u8, 196u8, 4u8, ], ) } @@ -1285,17 +1257,14 @@ pub mod api { #[doc = "Schedule a named task."] pub fn schedule_named( &self, - id: ::std::vec::Vec<::core::primitive::u8>, + id: [::core::primitive::u8; 32usize], when: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + call: runtime_types::polkadot_runtime::RuntimeCall, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Scheduler", @@ -1308,27 +1277,27 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 175u8, 13u8, 120u8, 21u8, 176u8, 211u8, 82u8, 147u8, 219u8, - 249u8, 45u8, 109u8, 56u8, 122u8, 31u8, 172u8, 226u8, 148u8, - 30u8, 210u8, 178u8, 107u8, 94u8, 104u8, 155u8, 103u8, 53u8, - 87u8, 20u8, 204u8, 155u8, 243u8, + 84u8, 106u8, 212u8, 23u8, 117u8, 33u8, 204u8, 44u8, 79u8, + 178u8, 21u8, 241u8, 151u8, 179u8, 201u8, 1u8, 48u8, 13u8, + 125u8, 176u8, 166u8, 49u8, 118u8, 174u8, 1u8, 187u8, 45u8, + 75u8, 204u8, 219u8, 229u8, 24u8, ], ) } #[doc = "Cancel a named scheduled task."] pub fn cancel_named( &self, - id: ::std::vec::Vec<::core::primitive::u8>, + id: [::core::primitive::u8; 32usize], ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Scheduler", "cancel_named", CancelNamed { id }, [ - 42u8, 232u8, 92u8, 167u8, 113u8, 136u8, 7u8, 215u8, 88u8, - 117u8, 74u8, 26u8, 225u8, 230u8, 244u8, 106u8, 150u8, 112u8, - 46u8, 228u8, 96u8, 252u8, 78u8, 126u8, 39u8, 207u8, 36u8, - 110u8, 83u8, 62u8, 84u8, 241u8, + 51u8, 3u8, 140u8, 50u8, 214u8, 211u8, 50u8, 4u8, 19u8, 43u8, + 230u8, 114u8, 18u8, 108u8, 138u8, 67u8, 99u8, 24u8, 255u8, + 11u8, 246u8, 37u8, 192u8, 207u8, 90u8, 157u8, 171u8, 93u8, + 233u8, 189u8, 64u8, 180u8, ], ) } @@ -1345,10 +1314,7 @@ pub mod api { ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + call: runtime_types::polkadot_runtime::RuntimeCall, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Scheduler", @@ -1360,10 +1326,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 107u8, 85u8, 46u8, 40u8, 69u8, 211u8, 26u8, 185u8, 170u8, - 197u8, 171u8, 42u8, 96u8, 52u8, 179u8, 188u8, 237u8, 98u8, - 52u8, 57u8, 188u8, 68u8, 161u8, 39u8, 150u8, 175u8, 217u8, - 8u8, 134u8, 131u8, 228u8, 204u8, + 176u8, 3u8, 143u8, 176u8, 250u8, 9u8, 0u8, 75u8, 62u8, 93u8, + 220u8, 19u8, 98u8, 136u8, 178u8, 98u8, 187u8, 57u8, 228u8, + 147u8, 133u8, 88u8, 146u8, 58u8, 113u8, 166u8, 41u8, 25u8, + 163u8, 95u8, 6u8, 47u8, ], ) } @@ -1374,17 +1340,14 @@ pub mod api { #[doc = "# "] pub fn schedule_named_after( &self, - id: ::std::vec::Vec<::core::primitive::u8>, + id: [::core::primitive::u8; 32usize], after: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, ::core::primitive::u32, )>, priority: ::core::primitive::u8, - call: runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + call: runtime_types::polkadot_runtime::RuntimeCall, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Scheduler", @@ -1397,10 +1360,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 1u8, 36u8, 175u8, 4u8, 59u8, 0u8, 17u8, 47u8, 196u8, 194u8, - 104u8, 105u8, 215u8, 160u8, 12u8, 60u8, 200u8, 172u8, 104u8, - 57u8, 242u8, 250u8, 98u8, 56u8, 254u8, 201u8, 93u8, 1u8, - 179u8, 185u8, 225u8, 210u8, + 195u8, 224u8, 47u8, 168u8, 137u8, 114u8, 75u8, 129u8, 115u8, + 108u8, 190u8, 194u8, 60u8, 179u8, 249u8, 51u8, 110u8, 4u8, + 109u8, 50u8, 68u8, 121u8, 101u8, 41u8, 203u8, 4u8, 18u8, + 182u8, 245u8, 197u8, 244u8, 195u8, ], ) } @@ -1446,7 +1409,7 @@ pub mod api { #[doc = "Dispatched some task."] pub struct Dispatched { pub task: (::core::primitive::u32, ::core::primitive::u32), - pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub id: ::core::option::Option<[::core::primitive::u8; 32usize]>, pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, } @@ -1460,21 +1423,68 @@ pub mod api { Debug, )] #[doc = "The call for the provided hash was not found so the task has been aborted."] - pub struct CallLookupFailed { + pub struct CallUnavailable { pub task: (::core::primitive::u32, ::core::primitive::u32), - pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, - pub error: runtime_types::frame_support::traits::schedule::LookupError, + pub id: ::core::option::Option<[::core::primitive::u8; 32usize]>, } - impl ::subxt::events::StaticEvent for CallLookupFailed { + impl ::subxt::events::StaticEvent for CallUnavailable { const PALLET: &'static str = "Scheduler"; - const EVENT: &'static str = "CallLookupFailed"; + const EVENT: &'static str = "CallUnavailable"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "The given task was unable to be renewed since the agenda is full at that block."] + pub struct PeriodicFailed { + pub task: (::core::primitive::u32, ::core::primitive::u32), + pub id: ::core::option::Option<[::core::primitive::u8; 32usize]>, + } + impl ::subxt::events::StaticEvent for PeriodicFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PeriodicFailed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "The given task can never be executed since it is overweight."] + pub struct PermanentlyOverweight { + pub task: (::core::primitive::u32, ::core::primitive::u32), + pub id: ::core::option::Option<[::core::primitive::u8; 32usize]>, + } + impl ::subxt::events::StaticEvent for PermanentlyOverweight { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "PermanentlyOverweight"; } } pub mod storage { use super::runtime_types; pub struct StorageApi; impl StorageApi { - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda (& self , _0 : impl :: std :: borrow :: Borrow < :: core :: primitive :: u32 > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: ScheduledV3 < runtime_types :: frame_support :: traits :: schedule :: MaybeHashed < runtime_types :: polkadot_runtime :: RuntimeCall , :: subxt :: ext :: sp_core :: H256 > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + pub fn incomplete_since( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "IncompleteSince", + vec![], + [ + 149u8, 66u8, 239u8, 67u8, 235u8, 219u8, 101u8, 182u8, 145u8, + 56u8, 252u8, 150u8, 253u8, 221u8, 125u8, 57u8, 38u8, 152u8, + 153u8, 31u8, 92u8, 238u8, 66u8, 246u8, 104u8, 163u8, 94u8, + 73u8, 222u8, 168u8, 193u8, 227u8, + ], + ) + } + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda (& self , _0 : impl :: std :: borrow :: Borrow < :: core :: primitive :: u32 > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_core :: bounded :: bounded_vec :: BoundedVec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: Scheduled < [:: core :: primitive :: u8 ; 32usize] , runtime_types :: frame_support :: traits :: preimages :: Bounded < runtime_types :: polkadot_runtime :: RuntimeCall > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ ::subxt::storage::address::StaticStorageAddress::new( "Scheduler", "Agenda", @@ -1483,30 +1493,33 @@ pub mod api { ::subxt::storage::address::StorageHasher::Twox64Concat, )], [ - 76u8, 24u8, 115u8, 243u8, 106u8, 231u8, 161u8, 81u8, 164u8, - 110u8, 112u8, 105u8, 182u8, 109u8, 86u8, 22u8, 157u8, 68u8, - 162u8, 225u8, 5u8, 16u8, 101u8, 118u8, 196u8, 231u8, 252u8, - 191u8, 146u8, 30u8, 102u8, 180u8, + 159u8, 237u8, 79u8, 176u8, 214u8, 27u8, 183u8, 165u8, 63u8, + 185u8, 233u8, 151u8, 81u8, 170u8, 97u8, 115u8, 47u8, 90u8, + 254u8, 2u8, 66u8, 209u8, 3u8, 247u8, 92u8, 11u8, 54u8, 144u8, + 88u8, 172u8, 127u8, 143u8, ], ) } - #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < :: std :: vec :: Vec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: ScheduledV3 < runtime_types :: frame_support :: traits :: schedule :: MaybeHashed < runtime_types :: polkadot_runtime :: RuntimeCall , :: subxt :: ext :: sp_core :: H256 > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] pub fn agenda_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_core :: bounded :: bounded_vec :: BoundedVec < :: core :: option :: Option < runtime_types :: pallet_scheduler :: Scheduled < [:: core :: primitive :: u8 ; 32usize] , runtime_types :: frame_support :: traits :: preimages :: Bounded < runtime_types :: polkadot_runtime :: RuntimeCall > , :: core :: primitive :: u32 , runtime_types :: polkadot_runtime :: OriginCaller , :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ ::subxt::storage::address::StaticStorageAddress::new( "Scheduler", "Agenda", Vec::new(), [ - 76u8, 24u8, 115u8, 243u8, 106u8, 231u8, 161u8, 81u8, 164u8, - 110u8, 112u8, 105u8, 182u8, 109u8, 86u8, 22u8, 157u8, 68u8, - 162u8, 225u8, 5u8, 16u8, 101u8, 118u8, 196u8, 231u8, 252u8, - 191u8, 146u8, 30u8, 102u8, 180u8, + 159u8, 237u8, 79u8, 176u8, 214u8, 27u8, 183u8, 165u8, 63u8, + 185u8, 233u8, 151u8, 81u8, 170u8, 97u8, 115u8, 47u8, 90u8, + 254u8, 2u8, 66u8, 209u8, 3u8, 247u8, 92u8, 11u8, 54u8, 144u8, + 88u8, 172u8, 127u8, 143u8, ], ) } - #[doc = " Lookup from identity to the block number and index of the task."] + #[doc = " Lookup from a name to the block number and index of the task."] + #[doc = ""] + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] pub fn lookup( &self, - _0: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 32usize]>, ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType<( ::core::primitive::u32, @@ -1524,14 +1537,17 @@ pub mod api { ::subxt::storage::address::StorageHasher::Twox64Concat, )], [ - 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, 131u8, - 57u8, 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, 169u8, 182u8, - 168u8, 43u8, 36u8, 202u8, 222u8, 182u8, 41u8, 216u8, 222u8, - 1u8, 72u8, 165u8, 62u8, 166u8, + 82u8, 20u8, 178u8, 101u8, 108u8, 198u8, 71u8, 99u8, 16u8, + 175u8, 15u8, 187u8, 229u8, 243u8, 140u8, 200u8, 99u8, 77u8, + 248u8, 178u8, 45u8, 121u8, 193u8, 67u8, 165u8, 43u8, 234u8, + 211u8, 158u8, 250u8, 103u8, 243u8, ], ) } - #[doc = " Lookup from identity to the block number and index of the task."] + #[doc = " Lookup from a name to the block number and index of the task."] + #[doc = ""] + #[doc = " For v3 -> v4 the previously unbounded identities are Blake2-256 hashed to form the v4"] + #[doc = " identities."] pub fn lookup_root( &self, ) -> ::subxt::storage::address::StaticStorageAddress< @@ -1548,10 +1564,10 @@ pub mod api { "Lookup", Vec::new(), [ - 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, 131u8, - 57u8, 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, 169u8, 182u8, - 168u8, 43u8, 36u8, 202u8, 222u8, 182u8, 41u8, 216u8, 222u8, - 1u8, 72u8, 165u8, 62u8, 166u8, + 82u8, 20u8, 178u8, 101u8, 108u8, 198u8, 71u8, 99u8, 16u8, + 175u8, 15u8, 187u8, 229u8, 243u8, 140u8, 200u8, 99u8, 77u8, + 248u8, 178u8, 45u8, 121u8, 193u8, 67u8, 165u8, 43u8, 234u8, + 211u8, 158u8, 250u8, 103u8, 243u8, ], ) } @@ -1561,8 +1577,7 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - #[doc = " The maximum weight that may be scheduled per block for any dispatchables of less"] - #[doc = " priority than `schedule::HARD_DEADLINE`."] + #[doc = " The maximum weight that may be scheduled per block for any dispatchables."] pub fn maximum_weight( &self, ) -> ::subxt::constants::StaticConstantAddress< @@ -1574,15 +1589,14 @@ pub mod api { "Scheduler", "MaximumWeight", [ - 67u8, 70u8, 203u8, 252u8, 102u8, 92u8, 175u8, 48u8, 35u8, - 141u8, 85u8, 109u8, 102u8, 228u8, 244u8, 116u8, 6u8, 210u8, - 54u8, 115u8, 86u8, 234u8, 159u8, 246u8, 251u8, 91u8, 202u8, - 141u8, 32u8, 21u8, 97u8, 85u8, + 206u8, 61u8, 253u8, 247u8, 163u8, 40u8, 161u8, 52u8, 134u8, + 140u8, 206u8, 83u8, 44u8, 166u8, 226u8, 115u8, 181u8, 14u8, + 227u8, 130u8, 210u8, 32u8, 85u8, 29u8, 230u8, 97u8, 130u8, + 165u8, 147u8, 134u8, 106u8, 76u8, ], ) } #[doc = " The maximum number of scheduled calls in the queue for a single block."] - #[doc = " Not strictly enforced, but used for weight estimation."] pub fn max_scheduled_per_block( &self, ) -> ::subxt::constants::StaticConstantAddress< @@ -1603,16 +1617,12 @@ pub mod api { } } pub mod preimage { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -1669,6 +1679,11 @@ pub mod api { ) } #[doc = "Clear an unrequested preimage from the runtime storage."] + #[doc = ""] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] + #[doc = ""] + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] pub fn unnote_preimage( &self, hash: ::subxt::ext::sp_core::H256, @@ -1797,10 +1812,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Identity, )], [ - 244u8, 6u8, 120u8, 75u8, 164u8, 32u8, 39u8, 15u8, 107u8, - 127u8, 19u8, 242u8, 80u8, 121u8, 18u8, 219u8, 253u8, 174u8, - 138u8, 9u8, 76u8, 219u8, 156u8, 229u8, 78u8, 155u8, 233u8, - 162u8, 215u8, 237u8, 23u8, 123u8, + 103u8, 208u8, 88u8, 167u8, 244u8, 198u8, 129u8, 134u8, 182u8, + 80u8, 71u8, 192u8, 73u8, 92u8, 190u8, 15u8, 20u8, 132u8, + 37u8, 108u8, 88u8, 233u8, 18u8, 145u8, 9u8, 235u8, 5u8, + 132u8, 42u8, 17u8, 227u8, 56u8, ], ) } @@ -1823,17 +1838,17 @@ pub mod api { "StatusFor", Vec::new(), [ - 244u8, 6u8, 120u8, 75u8, 164u8, 32u8, 39u8, 15u8, 107u8, - 127u8, 19u8, 242u8, 80u8, 121u8, 18u8, 219u8, 253u8, 174u8, - 138u8, 9u8, 76u8, 219u8, 156u8, 229u8, 78u8, 155u8, 233u8, - 162u8, 215u8, 237u8, 23u8, 123u8, + 103u8, 208u8, 88u8, 167u8, 244u8, 198u8, 129u8, 134u8, 182u8, + 80u8, 71u8, 192u8, 73u8, 92u8, 190u8, 15u8, 20u8, 132u8, + 37u8, 108u8, 88u8, 233u8, 18u8, 145u8, 9u8, 235u8, 5u8, + 132u8, 42u8, 17u8, 227u8, 56u8, ], ) } - #[doc = " The preimages stored by this pallet."] pub fn preimage_for( &self, _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType< runtime_types::sp_core::bounded::bounded_vec::BoundedVec< @@ -1848,18 +1863,17 @@ pub mod api { "Preimage", "PreimageFor", vec![::subxt::storage::address::StorageMapKey::new( - _0.borrow(), + &(_0.borrow(), _1.borrow()), ::subxt::storage::address::StorageHasher::Identity, )], [ - 82u8, 216u8, 233u8, 5u8, 102u8, 206u8, 96u8, 64u8, 133u8, - 179u8, 63u8, 45u8, 53u8, 42u8, 190u8, 95u8, 77u8, 197u8, - 60u8, 11u8, 59u8, 231u8, 190u8, 219u8, 87u8, 149u8, 112u8, - 196u8, 33u8, 238u8, 247u8, 117u8, + 96u8, 74u8, 30u8, 112u8, 120u8, 41u8, 52u8, 187u8, 252u8, + 68u8, 42u8, 5u8, 61u8, 228u8, 250u8, 192u8, 224u8, 61u8, + 53u8, 222u8, 95u8, 148u8, 6u8, 53u8, 43u8, 152u8, 88u8, 58u8, + 185u8, 234u8, 131u8, 124u8, ], ) } - #[doc = " The preimages stored by this pallet."] pub fn preimage_for_root( &self, ) -> ::subxt::storage::address::StaticStorageAddress< @@ -1877,10 +1891,10 @@ pub mod api { "PreimageFor", Vec::new(), [ - 82u8, 216u8, 233u8, 5u8, 102u8, 206u8, 96u8, 64u8, 133u8, - 179u8, 63u8, 45u8, 53u8, 42u8, 190u8, 95u8, 77u8, 197u8, - 60u8, 11u8, 59u8, 231u8, 190u8, 219u8, 87u8, 149u8, 112u8, - 196u8, 33u8, 238u8, 247u8, 117u8, + 96u8, 74u8, 30u8, 112u8, 120u8, 41u8, 52u8, 187u8, 252u8, + 68u8, 42u8, 5u8, 61u8, 228u8, 250u8, 192u8, 224u8, 61u8, + 53u8, 222u8, 95u8, 148u8, 6u8, 53u8, 43u8, 152u8, 88u8, 58u8, + 185u8, 234u8, 131u8, 124u8, ], ) } @@ -1888,16 +1902,12 @@ pub mod api { } } pub mod babe { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -2528,16 +2538,12 @@ pub mod api { } } pub mod timestamp { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -2660,16 +2666,12 @@ pub mod api { } } pub mod indices { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: CompactAs, @@ -3043,16 +3045,12 @@ pub mod api { } } pub mod balances { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -3822,10 +3820,8 @@ pub mod api { } } pub mod transaction_payment { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub type Event = runtime_types::pallet_transaction_payment::pallet::Event; pub mod events { @@ -3942,16 +3938,12 @@ pub mod api { } } pub mod authorship { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -4098,16 +4090,12 @@ pub mod api { } } pub mod staking { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -4671,7 +4659,8 @@ pub mod api { ], ) } - #[doc = "Increments the ideal number of validators."] + #[doc = "Increments the ideal number of validators upto maximum of"] + #[doc = "`ElectionProviderBase::MaxWinners`."] #[doc = ""] #[doc = "The dispatch origin must be Root."] #[doc = ""] @@ -4695,7 +4684,8 @@ pub mod api { ], ) } - #[doc = "Scale up the ideal number of validators by a factor."] + #[doc = "Scale up the ideal number of validators by a factor upto maximum of"] + #[doc = "`ElectionProviderBase::MaxWinners`."] #[doc = ""] #[doc = "The dispatch origin must be Root."] #[doc = ""] @@ -5115,12 +5105,11 @@ pub mod api { )] #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] #[doc = "the remainder from the maximum amount of reward."] - #[doc = "\\[era_index, validator_payout, remainder\\]"] - pub struct EraPaid( - pub ::core::primitive::u32, - pub ::core::primitive::u128, - pub ::core::primitive::u128, - ); + pub struct EraPaid { + pub era_index: ::core::primitive::u32, + pub validator_payout: ::core::primitive::u128, + pub remainder: ::core::primitive::u128, + } impl ::subxt::events::StaticEvent for EraPaid { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "EraPaid"; @@ -5130,11 +5119,11 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] - pub struct Rewarded( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + #[doc = "The nominator has been rewarded by this amount."] + pub struct Rewarded { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::events::StaticEvent for Rewarded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Rewarded"; @@ -5144,12 +5133,11 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "One validator (and its nominators) has been slashed by the given amount."] - #[doc = "\\[validator, amount\\]"] - pub struct Slashed( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + #[doc = "One staker (and potentially its nominators) has been slashed by the given amount."] + pub struct Slashed { + pub staker: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::events::StaticEvent for Slashed { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Slashed"; @@ -5161,8 +5149,10 @@ pub mod api { Debug, )] #[doc = "An old slashing report from a prior era was discarded because it could"] - #[doc = "not be processed. \\[session_index\\]"] - pub struct OldSlashingReportDiscarded(pub ::core::primitive::u32); + #[doc = "not be processed."] + pub struct OldSlashingReportDiscarded { + pub session_index: ::core::primitive::u32, + } impl ::subxt::events::StaticEvent for OldSlashingReportDiscarded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "OldSlashingReportDiscarded"; @@ -5187,10 +5177,10 @@ pub mod api { #[doc = ""] #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] #[doc = "it will not be emitted for staking rewards when they are added to stake."] - pub struct Bonded( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + pub struct Bonded { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::events::StaticEvent for Bonded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Bonded"; @@ -5200,11 +5190,11 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] - pub struct Unbonded( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + #[doc = "An account has unbonded this amount."] + pub struct Unbonded { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::events::StaticEvent for Unbonded { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Unbonded"; @@ -5215,11 +5205,11 @@ pub mod api { Debug, )] #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] - #[doc = "from the unlocking queue. \\[stash, amount\\]"] - pub struct Withdrawn( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub ::core::primitive::u128, - ); + #[doc = "from the unlocking queue."] + pub struct Withdrawn { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } impl ::subxt::events::StaticEvent for Withdrawn { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Withdrawn"; @@ -5229,11 +5219,11 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] - pub struct Kicked( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub ::subxt::ext::sp_core::crypto::AccountId32, - ); + #[doc = "A nominator has been kicked from a validator."] + pub struct Kicked { + pub nominator: ::subxt::ext::sp_core::crypto::AccountId32, + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + } impl ::subxt::events::StaticEvent for Kicked { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Kicked"; @@ -5255,8 +5245,9 @@ pub mod api { Debug, )] #[doc = "An account has stopped participating as either a validator or nominator."] - #[doc = "\\[stash\\]"] - pub struct Chilled(pub ::subxt::ext::sp_core::crypto::AccountId32); + pub struct Chilled { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + } impl ::subxt::events::StaticEvent for Chilled { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "Chilled"; @@ -5266,11 +5257,11 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] - pub struct PayoutStarted( - pub ::core::primitive::u32, - pub ::subxt::ext::sp_core::crypto::AccountId32, - ); + #[doc = "The stakers' rewards are getting paid."] + pub struct PayoutStarted { + pub era_index: ::core::primitive::u32, + pub validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + } impl ::subxt::events::StaticEvent for PayoutStarted { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "PayoutStarted"; @@ -5281,10 +5272,10 @@ pub mod api { Debug, )] #[doc = "A validator has set their preferences."] - pub struct ValidatorPrefsSet( - pub ::subxt::ext::sp_core::crypto::AccountId32, - pub runtime_types::pallet_staking::ValidatorPrefs, - ); + pub struct ValidatorPrefsSet { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub prefs: runtime_types::pallet_staking::ValidatorPrefs, + } impl ::subxt::events::StaticEvent for ValidatorPrefsSet { const PALLET: &'static str = "Staking"; const EVENT: &'static str = "ValidatorPrefsSet"; @@ -5294,7 +5285,7 @@ pub mod api { use super::runtime_types; pub struct StorageApi; impl StorageApi { - #[doc = " The ideal number of staking participants."] + #[doc = " The ideal number of active validators."] pub fn validator_count( &self, ) -> ::subxt::storage::address::StaticStorageAddress< @@ -6802,8 +6793,9 @@ pub mod api { #[doc = ""] #[doc = " Note: `HistoryDepth` is used as the upper bound for the `BoundedVec`"] #[doc = " item `StakingLedger.claimed_rewards`. Setting this value lower than"] - #[doc = " the existing value can lead to inconsistencies and will need to be"] - #[doc = " handled properly in a migration."] + #[doc = " the existing value can lead to inconsistencies in the"] + #[doc = " `StakingLedger` and will need to be handled properly in a migration."] + #[doc = " The test `reducing_history_depth_abrupt` shows this effect."] pub fn history_depth( &self, ) -> ::subxt::constants::StaticConstantAddress< @@ -6894,8 +6886,16 @@ pub mod api { ], ) } - #[doc = " The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively"] - #[doc = " determines how many unique eras a staker may be unbonding in."] + #[doc = " The maximum number of `unlocking` chunks a [`StakingLedger`] can"] + #[doc = " have. Effectively determines how many unique eras a staker may be"] + #[doc = " unbonding in."] + #[doc = ""] + #[doc = " Note: `MaxUnlockingChunks` is used as the upper bound for the"] + #[doc = " `BoundedVec` item `StakingLedger.unlocking`. Setting this value"] + #[doc = " lower than the existing value can lead to inconsistencies in the"] + #[doc = " `StakingLedger` and will need to be handled properly in a runtime"] + #[doc = " migration. The test `reducing_max_unlocking_chunks_abrupt` shows"] + #[doc = " this effect."] pub fn max_unlocking_chunks( &self, ) -> ::subxt::constants::StaticConstantAddress< @@ -6916,10 +6916,8 @@ pub mod api { } } pub mod offences { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Events type."] pub type Event = runtime_types::pallet_offences::pallet::Event; pub mod events { @@ -7134,22 +7132,16 @@ pub mod api { } } pub mod historical { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; } pub mod session { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -7479,16 +7471,12 @@ pub mod api { } } pub mod grandpa { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -7864,16 +7852,12 @@ pub mod api { } } pub mod im_online { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -8178,22 +8162,16 @@ pub mod api { } } pub mod authority_discovery { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; } pub mod democracy { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -8201,7 +8179,9 @@ pub mod api { Debug, )] pub struct Propose { - pub proposal_hash: ::subxt::ext::sp_core::H256, + pub proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, #[codec(compact)] pub value: ::core::primitive::u128, } @@ -8213,8 +8193,6 @@ pub mod api { pub struct Second { #[codec(compact)] pub proposal: ::core::primitive::u32, - #[codec(compact)] - pub seconds_upper_bound: ::core::primitive::u32, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -8243,7 +8221,9 @@ pub mod api { Debug, )] pub struct ExternalPropose { - pub proposal_hash: ::subxt::ext::sp_core::H256, + pub proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -8251,7 +8231,9 @@ pub mod api { Debug, )] pub struct ExternalProposeMajority { - pub proposal_hash: ::subxt::ext::sp_core::H256, + pub proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -8259,7 +8241,9 @@ pub mod api { Debug, )] pub struct ExternalProposeDefault { - pub proposal_hash: ::subxt::ext::sp_core::H256, + pub proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -8288,15 +8272,6 @@ pub mod api { #[codec(compact)] pub ref_index: ::core::primitive::u32, } - #[derive( - :: subxt :: ext :: codec :: CompactAs, - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub struct CancelQueued { - pub which: ::core::primitive::u32, - } #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, @@ -8327,48 +8302,6 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct NotePreimage { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub struct NotePreimageOperational { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub struct NoteImminentPreimage { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub struct NoteImminentPreimageOperational { - pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub struct ReapPreimage { - pub proposal_hash: ::subxt::ext::sp_core::H256, - #[codec(compact)] - pub proposal_len_upper_bound: ::core::primitive::u32, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] pub struct Unlock { pub target: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -8401,15 +8334,6 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct EnactProposal { - pub proposal_hash: ::subxt::ext::sp_core::H256, - pub index: ::core::primitive::u32, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] pub struct Blacklist { pub proposal_hash: ::subxt::ext::sp_core::H256, pub maybe_ref_index: ::core::option::Option<::core::primitive::u32>, @@ -8434,25 +8358,22 @@ pub mod api { #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] #[doc = ""] #[doc = "Emits `Proposed`."] - #[doc = ""] - #[doc = "Weight: `O(p)`"] pub fn propose( &self, - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, value: ::core::primitive::u128, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Democracy", "propose", - Propose { - proposal_hash, - value, - }, + Propose { proposal, value }, [ - 151u8, 2u8, 117u8, 57u8, 201u8, 246u8, 181u8, 198u8, 83u8, - 74u8, 99u8, 211u8, 237u8, 53u8, 90u8, 173u8, 161u8, 250u8, - 139u8, 253u8, 223u8, 251u8, 39u8, 108u8, 254u8, 192u8, 233u8, - 23u8, 9u8, 99u8, 169u8, 195u8, + 123u8, 3u8, 204u8, 140u8, 194u8, 195u8, 214u8, 39u8, 167u8, + 126u8, 45u8, 4u8, 219u8, 17u8, 143u8, 185u8, 29u8, 224u8, + 230u8, 68u8, 253u8, 15u8, 170u8, 90u8, 232u8, 123u8, 46u8, + 255u8, 168u8, 39u8, 204u8, 63u8, ], ) } @@ -8462,27 +8383,19 @@ pub mod api { #[doc = "must have funds to cover the deposit, equal to the original deposit."] #[doc = ""] #[doc = "- `proposal`: The index of the proposal to second."] - #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] - #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] - #[doc = ""] - #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] pub fn second( &self, proposal: ::core::primitive::u32, - seconds_upper_bound: ::core::primitive::u32, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Democracy", "second", - Second { - proposal, - seconds_upper_bound, - }, + Second { proposal }, [ - 152u8, 56u8, 134u8, 181u8, 88u8, 224u8, 68u8, 238u8, 231u8, - 78u8, 237u8, 142u8, 133u8, 16u8, 93u8, 63u8, 253u8, 81u8, - 96u8, 200u8, 43u8, 21u8, 249u8, 92u8, 78u8, 24u8, 101u8, - 217u8, 143u8, 16u8, 213u8, 244u8, + 59u8, 240u8, 183u8, 218u8, 61u8, 93u8, 184u8, 67u8, 10u8, + 4u8, 138u8, 196u8, 168u8, 49u8, 42u8, 69u8, 154u8, 42u8, + 90u8, 112u8, 179u8, 69u8, 51u8, 148u8, 159u8, 212u8, 221u8, + 226u8, 132u8, 228u8, 51u8, 83u8, ], ) } @@ -8493,8 +8406,6 @@ pub mod api { #[doc = ""] #[doc = "- `ref_index`: The index of the referendum to vote for."] #[doc = "- `vote`: The vote configuration."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] pub fn vote( &self, ref_index: ::core::primitive::u32, @@ -8544,22 +8455,21 @@ pub mod api { #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] #[doc = ""] #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] - #[doc = " Decoding vec of length V. Charged as maximum"] pub fn external_propose( &self, - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Democracy", "external_propose", - ExternalPropose { proposal_hash }, + ExternalPropose { proposal }, [ - 8u8, 206u8, 229u8, 218u8, 203u8, 208u8, 253u8, 113u8, 43u8, - 62u8, 110u8, 155u8, 123u8, 35u8, 187u8, 211u8, 180u8, 225u8, - 41u8, 30u8, 204u8, 110u8, 202u8, 210u8, 143u8, 84u8, 117u8, - 20u8, 215u8, 110u8, 211u8, 89u8, + 164u8, 193u8, 14u8, 122u8, 105u8, 232u8, 20u8, 194u8, 99u8, + 227u8, 36u8, 105u8, 218u8, 146u8, 16u8, 208u8, 56u8, 62u8, + 100u8, 65u8, 35u8, 33u8, 51u8, 208u8, 17u8, 43u8, 223u8, + 198u8, 202u8, 16u8, 56u8, 75u8, ], ) } @@ -8576,18 +8486,20 @@ pub mod api { #[doc = "Weight: `O(1)`"] pub fn external_propose_majority( &self, - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Democracy", "external_propose_majority", - ExternalProposeMajority { proposal_hash }, + ExternalProposeMajority { proposal }, [ - 36u8, 47u8, 192u8, 177u8, 164u8, 82u8, 109u8, 215u8, 98u8, - 28u8, 47u8, 237u8, 159u8, 233u8, 53u8, 9u8, 158u8, 134u8, - 232u8, 249u8, 55u8, 189u8, 48u8, 133u8, 201u8, 46u8, 237u8, - 158u8, 181u8, 163u8, 166u8, 213u8, + 129u8, 124u8, 147u8, 253u8, 69u8, 115u8, 230u8, 186u8, 155u8, + 4u8, 220u8, 103u8, 28u8, 132u8, 115u8, 153u8, 196u8, 88u8, + 9u8, 130u8, 129u8, 234u8, 75u8, 96u8, 202u8, 216u8, 145u8, + 189u8, 231u8, 101u8, 127u8, 11u8, ], ) } @@ -8604,18 +8516,20 @@ pub mod api { #[doc = "Weight: `O(1)`"] pub fn external_propose_default( &self, - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Democracy", "external_propose_default", - ExternalProposeDefault { proposal_hash }, + ExternalProposeDefault { proposal }, [ - 32u8, 100u8, 249u8, 175u8, 187u8, 77u8, 30u8, 65u8, 90u8, - 103u8, 251u8, 21u8, 21u8, 220u8, 8u8, 118u8, 97u8, 160u8, - 152u8, 122u8, 71u8, 140u8, 96u8, 8u8, 245u8, 74u8, 112u8, - 164u8, 55u8, 130u8, 38u8, 14u8, + 96u8, 15u8, 108u8, 208u8, 141u8, 247u8, 4u8, 73u8, 2u8, 30u8, + 231u8, 40u8, 184u8, 250u8, 42u8, 161u8, 248u8, 45u8, 217u8, + 50u8, 53u8, 13u8, 181u8, 214u8, 136u8, 51u8, 93u8, 95u8, + 165u8, 3u8, 83u8, 190u8, ], ) } @@ -8626,7 +8540,7 @@ pub mod api { #[doc = "The dispatch of this call must be `FastTrackOrigin`."] #[doc = ""] #[doc = "- `proposal_hash`: The hash of the current external proposal."] - #[doc = "- `voting_period`: The period that is allowed for voting on this proposal."] + #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] #[doc = "\tMust be always greater than zero."] #[doc = "\tFor `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`."] #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] @@ -8705,29 +8619,6 @@ pub mod api { ], ) } - #[doc = "Cancel a proposal queued for enactment."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "- `which`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] - pub fn cancel_queued( - &self, - which: ::core::primitive::u32, - ) -> ::subxt::tx::StaticTxPayload { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "cancel_queued", - CancelQueued { which }, - [ - 6u8, 97u8, 182u8, 142u8, 165u8, 206u8, 218u8, 245u8, 206u8, - 224u8, 143u8, 164u8, 232u8, 129u8, 202u8, 141u8, 78u8, 65u8, - 79u8, 206u8, 3u8, 195u8, 151u8, 36u8, 8u8, 220u8, 184u8, - 239u8, 28u8, 187u8, 208u8, 174u8, - ], - ) - } #[doc = "Delegate the voting power (with some given conviction) of the sending account."] #[doc = ""] #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] @@ -8818,131 +8709,6 @@ pub mod api { ], ) } - #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] - #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - pub fn note_preimage( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::tx::StaticTxPayload { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "note_preimage", - NotePreimage { encoded_proposal }, - [ - 31u8, 252u8, 248u8, 238u8, 103u8, 1u8, 82u8, 84u8, 135u8, - 152u8, 246u8, 234u8, 251u8, 124u8, 193u8, 73u8, 52u8, 255u8, - 88u8, 31u8, 112u8, 99u8, 191u8, 245u8, 251u8, 202u8, 51u8, - 130u8, 136u8, 114u8, 177u8, 241u8, - ], - ) - } - #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] - pub fn note_preimage_operational( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::tx::StaticTxPayload - { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "note_preimage_operational", - NotePreimageOperational { encoded_proposal }, - [ - 184u8, 81u8, 31u8, 172u8, 81u8, 113u8, 84u8, 246u8, 189u8, - 219u8, 167u8, 32u8, 191u8, 126u8, 165u8, 250u8, 147u8, 199u8, - 241u8, 196u8, 253u8, 34u8, 51u8, 158u8, 2u8, 157u8, 16u8, - 122u8, 210u8, 66u8, 110u8, 234u8, - ], - ) - } - #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] - #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] - #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] - #[doc = "no fee is paid."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - pub fn note_imminent_preimage( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::tx::StaticTxPayload { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "note_imminent_preimage", - NoteImminentPreimage { encoded_proposal }, - [ - 32u8, 188u8, 10u8, 215u8, 245u8, 132u8, 234u8, 124u8, 19u8, - 90u8, 225u8, 216u8, 169u8, 105u8, 95u8, 231u8, 12u8, 109u8, - 16u8, 91u8, 153u8, 134u8, 240u8, 82u8, 80u8, 254u8, 117u8, - 230u8, 88u8, 203u8, 68u8, 42u8, - ], - ) - } - #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] - pub fn note_imminent_preimage_operational( - &self, - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - ) -> ::subxt::tx::StaticTxPayload - { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "note_imminent_preimage_operational", - NoteImminentPreimageOperational { encoded_proposal }, - [ - 7u8, 31u8, 49u8, 238u8, 155u8, 234u8, 187u8, 147u8, 123u8, - 84u8, 50u8, 98u8, 221u8, 39u8, 218u8, 204u8, 175u8, 136u8, - 44u8, 93u8, 140u8, 172u8, 73u8, 98u8, 168u8, 110u8, 31u8, - 82u8, 22u8, 1u8, 205u8, 84u8, - ], - ) - } - #[doc = "Remove an expired proposal preimage and collect the deposit."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of a proposal."] - #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] - #[doc = " weighted according to this value with no refund."] - #[doc = ""] - #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] - #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] - #[doc = "work an additional `EnactmentPeriod` later."] - #[doc = ""] - #[doc = "Emits `PreimageReaped`."] - #[doc = ""] - #[doc = "Weight: `O(D)` where D is length of proposal."] - pub fn reap_preimage( - &self, - proposal_hash: ::subxt::ext::sp_core::H256, - proposal_len_upper_bound: ::core::primitive::u32, - ) -> ::subxt::tx::StaticTxPayload { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "reap_preimage", - ReapPreimage { - proposal_hash, - proposal_len_upper_bound, - }, - [ - 135u8, 43u8, 115u8, 154u8, 93u8, 121u8, 112u8, 65u8, 145u8, - 141u8, 236u8, 252u8, 203u8, 155u8, 63u8, 130u8, 120u8, 221u8, - 13u8, 105u8, 81u8, 179u8, 167u8, 254u8, 213u8, 117u8, 146u8, - 232u8, 18u8, 104u8, 196u8, 112u8, - ], - ) - } #[doc = "Unlock tokens that have an expired lock."] #[doc = ""] #[doc = "The dispatch origin of this call must be _Signed_."] @@ -9047,27 +8813,6 @@ pub mod api { ], ) } - #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] - pub fn enact_proposal( - &self, - proposal_hash: ::subxt::ext::sp_core::H256, - index: ::core::primitive::u32, - ) -> ::subxt::tx::StaticTxPayload { - ::subxt::tx::StaticTxPayload::new( - "Democracy", - "enact_proposal", - EnactProposal { - proposal_hash, - index, - }, - [ - 191u8, 244u8, 244u8, 174u8, 95u8, 86u8, 132u8, 63u8, 2u8, - 94u8, 3u8, 117u8, 96u8, 54u8, 100u8, 89u8, 124u8, 117u8, - 205u8, 142u8, 214u8, 192u8, 137u8, 141u8, 178u8, 145u8, - 241u8, 167u8, 163u8, 76u8, 61u8, 31u8, - ], - ) - } #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] #[doc = "proposed again."] #[doc = ""] @@ -9155,8 +8900,6 @@ pub mod api { pub struct Tabled { pub proposal_index: ::core::primitive::u32, pub deposit: ::core::primitive::u128, - pub depositors: - ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, } impl ::subxt::events::StaticEvent for Tabled { const PALLET: &'static str = "Democracy"; @@ -9235,21 +8978,6 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "A proposal has been enacted."] - pub struct Executed { - pub ref_index: ::core::primitive::u32, - pub result: - ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, - } - impl ::subxt::events::StaticEvent for Executed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "Executed"; - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] #[doc = "An account has delegated their vote to another account."] pub struct Delegated { pub who: ::subxt::ext::sp_core::crypto::AccountId32, @@ -9292,80 +9020,6 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "A proposal's preimage was noted, and the deposit taken."] - pub struct PreimageNoted { - pub proposal_hash: ::subxt::ext::sp_core::H256, - pub who: ::subxt::ext::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::events::StaticEvent for PreimageNoted { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageNoted"; - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - #[doc = "A proposal preimage was removed and used (the deposit was returned)."] - pub struct PreimageUsed { - pub proposal_hash: ::subxt::ext::sp_core::H256, - pub provider: ::subxt::ext::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - } - impl ::subxt::events::StaticEvent for PreimageUsed { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageUsed"; - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - #[doc = "A proposal could not be executed because its preimage was invalid."] - pub struct PreimageInvalid { - pub proposal_hash: ::subxt::ext::sp_core::H256, - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::events::StaticEvent for PreimageInvalid { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageInvalid"; - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - #[doc = "A proposal could not be executed because its preimage was missing."] - pub struct PreimageMissing { - pub proposal_hash: ::subxt::ext::sp_core::H256, - pub ref_index: ::core::primitive::u32, - } - impl ::subxt::events::StaticEvent for PreimageMissing { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageMissing"; - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - #[doc = "A registered preimage was removed and the deposit collected by the reaper."] - pub struct PreimageReaped { - pub proposal_hash: ::subxt::ext::sp_core::H256, - pub provider: ::subxt::ext::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, - pub reaper: ::subxt::ext::sp_core::crypto::AccountId32, - } - impl ::subxt::events::StaticEvent for PreimageReaped { - const PALLET: &'static str = "Democracy"; - const EVENT: &'static str = "PreimageReaped"; - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] #[doc = "A proposal_hash has been blacklisted permanently."] pub struct Blacklisted { pub proposal_hash: ::subxt::ext::sp_core::H256, @@ -9445,14 +9099,16 @@ pub mod api { ], ) } - #[doc = " The public proposals. Unsorted. The second item is the proposal's hash."] + #[doc = " The public proposals. Unsorted. The second item is the proposal."] pub fn public_props( &self, ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType< - ::std::vec::Vec<( + runtime_types::sp_core::bounded::bounded_vec::BoundedVec<( ::core::primitive::u32, - ::subxt::ext::sp_core::H256, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, ::subxt::ext::sp_core::crypto::AccountId32, )>, >, @@ -9465,10 +9121,10 @@ pub mod api { "PublicProps", vec![], [ - 151u8, 247u8, 196u8, 97u8, 171u8, 230u8, 55u8, 45u8, 220u8, - 16u8, 12u8, 28u8, 22u8, 58u8, 127u8, 179u8, 130u8, 192u8, - 115u8, 165u8, 5u8, 173u8, 87u8, 104u8, 7u8, 186u8, 114u8, - 47u8, 162u8, 182u8, 252u8, 154u8, + 63u8, 172u8, 211u8, 85u8, 27u8, 14u8, 86u8, 49u8, 133u8, 5u8, + 132u8, 189u8, 138u8, 137u8, 219u8, 37u8, 209u8, 49u8, 172u8, + 86u8, 240u8, 235u8, 42u8, 201u8, 203u8, 12u8, 122u8, 225u8, + 0u8, 109u8, 205u8, 103u8, ], ) } @@ -9480,7 +9136,9 @@ pub mod api { _0: impl ::std::borrow::Borrow<::core::primitive::u32>, ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType<( - ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, ::core::primitive::u128, )>, ::subxt::storage::address::Yes, @@ -9495,10 +9153,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Twox64Concat, )], [ - 153u8, 236u8, 152u8, 224u8, 221u8, 90u8, 204u8, 183u8, 222u8, - 160u8, 227u8, 26u8, 8u8, 110u8, 230u8, 102u8, 133u8, 186u8, - 66u8, 2u8, 84u8, 31u8, 236u8, 228u8, 202u8, 75u8, 17u8, 97u8, - 133u8, 232u8, 64u8, 7u8, + 9u8, 219u8, 11u8, 58u8, 17u8, 194u8, 248u8, 154u8, 135u8, + 119u8, 123u8, 235u8, 252u8, 176u8, 190u8, 162u8, 236u8, 45u8, + 237u8, 125u8, 98u8, 176u8, 184u8, 160u8, 8u8, 181u8, 213u8, + 65u8, 14u8, 84u8, 200u8, 64u8, ], ) } @@ -9509,7 +9167,9 @@ pub mod api { &self, ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType<( - ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, ::core::primitive::u128, )>, (), @@ -9521,70 +9181,10 @@ pub mod api { "DepositOf", Vec::new(), [ - 153u8, 236u8, 152u8, 224u8, 221u8, 90u8, 204u8, 183u8, 222u8, - 160u8, 227u8, 26u8, 8u8, 110u8, 230u8, 102u8, 133u8, 186u8, - 66u8, 2u8, 84u8, 31u8, 236u8, 228u8, 202u8, 75u8, 17u8, 97u8, - 133u8, 232u8, 64u8, 7u8, - ], - ) - } - #[doc = " Map of hashes to the proposal preimage, along with who registered it and their deposit."] - #[doc = " The block number is the block at which it was deposited."] - pub fn preimages( - &self, - _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, - ) -> ::subxt::storage::address::StaticStorageAddress< - ::subxt::metadata::DecodeStaticType< - runtime_types::pallet_democracy::PreimageStatus< - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >, - >, - ::subxt::storage::address::Yes, - (), - ::subxt::storage::address::Yes, - > { - ::subxt::storage::address::StaticStorageAddress::new( - "Democracy", - "Preimages", - vec![::subxt::storage::address::StorageMapKey::new( - _0.borrow(), - ::subxt::storage::address::StorageHasher::Identity, - )], - [ - 206u8, 131u8, 7u8, 129u8, 172u8, 231u8, 164u8, 220u8, 129u8, - 0u8, 204u8, 227u8, 231u8, 244u8, 61u8, 145u8, 144u8, 146u8, - 173u8, 215u8, 174u8, 218u8, 192u8, 83u8, 174u8, 99u8, 87u8, - 102u8, 98u8, 235u8, 138u8, 127u8, - ], - ) - } - #[doc = " Map of hashes to the proposal preimage, along with who registered it and their deposit."] - #[doc = " The block number is the block at which it was deposited."] - pub fn preimages_root( - &self, - ) -> ::subxt::storage::address::StaticStorageAddress< - ::subxt::metadata::DecodeStaticType< - runtime_types::pallet_democracy::PreimageStatus< - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ::core::primitive::u32, - >, - >, - (), - (), - ::subxt::storage::address::Yes, - > { - ::subxt::storage::address::StaticStorageAddress::new( - "Democracy", - "Preimages", - Vec::new(), - [ - 206u8, 131u8, 7u8, 129u8, 172u8, 231u8, 164u8, 220u8, 129u8, - 0u8, 204u8, 227u8, 231u8, 244u8, 61u8, 145u8, 144u8, 146u8, - 173u8, 215u8, 174u8, 218u8, 192u8, 83u8, 174u8, 99u8, 87u8, - 102u8, 98u8, 235u8, 138u8, 127u8, + 9u8, 219u8, 11u8, 58u8, 17u8, 194u8, 248u8, 154u8, 135u8, + 119u8, 123u8, 235u8, 252u8, 176u8, 190u8, 162u8, 236u8, 45u8, + 237u8, 125u8, 98u8, 176u8, 184u8, 160u8, 8u8, 181u8, 213u8, + 65u8, 14u8, 84u8, 200u8, 64u8, ], ) } @@ -9641,7 +9241,9 @@ pub mod api { ::subxt::metadata::DecodeStaticType< runtime_types::pallet_democracy::types::ReferendumInfo< ::core::primitive::u32, - ::subxt::ext::sp_core::H256, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, ::core::primitive::u128, >, >, @@ -9657,10 +9259,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Twox64Concat, )], [ - 132u8, 4u8, 108u8, 126u8, 91u8, 168u8, 18u8, 17u8, 86u8, - 79u8, 219u8, 222u8, 195u8, 137u8, 149u8, 177u8, 101u8, 134u8, - 130u8, 41u8, 217u8, 109u8, 18u8, 18u8, 33u8, 206u8, 117u8, - 131u8, 98u8, 26u8, 51u8, 8u8, + 167u8, 58u8, 230u8, 197u8, 185u8, 56u8, 181u8, 32u8, 81u8, + 150u8, 29u8, 138u8, 142u8, 38u8, 255u8, 216u8, 139u8, 93u8, + 56u8, 148u8, 196u8, 169u8, 168u8, 144u8, 193u8, 200u8, 187u8, + 5u8, 141u8, 201u8, 254u8, 248u8, ], ) } @@ -9673,7 +9275,9 @@ pub mod api { ::subxt::metadata::DecodeStaticType< runtime_types::pallet_democracy::types::ReferendumInfo< ::core::primitive::u32, - ::subxt::ext::sp_core::H256, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, ::core::primitive::u128, >, >, @@ -9686,10 +9290,10 @@ pub mod api { "ReferendumInfoOf", Vec::new(), [ - 132u8, 4u8, 108u8, 126u8, 91u8, 168u8, 18u8, 17u8, 86u8, - 79u8, 219u8, 222u8, 195u8, 137u8, 149u8, 177u8, 101u8, 134u8, - 130u8, 41u8, 217u8, 109u8, 18u8, 18u8, 33u8, 206u8, 117u8, - 131u8, 98u8, 26u8, 51u8, 8u8, + 167u8, 58u8, 230u8, 197u8, 185u8, 56u8, 181u8, 32u8, 81u8, + 150u8, 29u8, 138u8, 142u8, 38u8, 255u8, 216u8, 139u8, 93u8, + 56u8, 148u8, 196u8, 169u8, 168u8, 144u8, 193u8, 200u8, 187u8, + 5u8, 141u8, 201u8, 254u8, 248u8, ], ) } @@ -9720,10 +9324,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Twox64Concat, )], [ - 211u8, 38u8, 232u8, 65u8, 215u8, 97u8, 157u8, 208u8, 177u8, - 150u8, 250u8, 226u8, 72u8, 185u8, 187u8, 162u8, 80u8, 67u8, - 195u8, 87u8, 190u8, 180u8, 167u8, 137u8, 253u8, 142u8, 34u8, - 158u8, 249u8, 168u8, 209u8, 18u8, + 125u8, 121u8, 167u8, 170u8, 18u8, 194u8, 183u8, 38u8, 176u8, + 48u8, 30u8, 88u8, 233u8, 196u8, 33u8, 119u8, 160u8, 201u8, + 29u8, 183u8, 88u8, 67u8, 219u8, 137u8, 6u8, 195u8, 11u8, + 63u8, 162u8, 181u8, 82u8, 243u8, ], ) } @@ -9750,10 +9354,10 @@ pub mod api { "VotingOf", Vec::new(), [ - 211u8, 38u8, 232u8, 65u8, 215u8, 97u8, 157u8, 208u8, 177u8, - 150u8, 250u8, 226u8, 72u8, 185u8, 187u8, 162u8, 80u8, 67u8, - 195u8, 87u8, 190u8, 180u8, 167u8, 137u8, 253u8, 142u8, 34u8, - 158u8, 249u8, 168u8, 209u8, 18u8, + 125u8, 121u8, 167u8, 170u8, 18u8, 194u8, 183u8, 38u8, 176u8, + 48u8, 30u8, 88u8, 233u8, 196u8, 33u8, 119u8, 160u8, 201u8, + 29u8, 183u8, 88u8, 67u8, 219u8, 137u8, 6u8, 195u8, 11u8, + 63u8, 162u8, 181u8, 82u8, 243u8, ], ) } @@ -9787,7 +9391,9 @@ pub mod api { &self, ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType<( - ::subxt::ext::sp_core::H256, + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, runtime_types::pallet_democracy::vote_threshold::VoteThreshold, )>, ::subxt::storage::address::Yes, @@ -9799,10 +9405,10 @@ pub mod api { "NextExternal", vec![], [ - 123u8, 49u8, 252u8, 184u8, 75u8, 204u8, 16u8, 130u8, 43u8, - 109u8, 62u8, 113u8, 95u8, 0u8, 20u8, 163u8, 186u8, 210u8, - 253u8, 33u8, 58u8, 121u8, 36u8, 80u8, 9u8, 242u8, 180u8, - 230u8, 167u8, 250u8, 32u8, 180u8, + 213u8, 36u8, 235u8, 75u8, 153u8, 33u8, 140u8, 121u8, 191u8, + 197u8, 17u8, 57u8, 234u8, 67u8, 81u8, 55u8, 123u8, 179u8, + 207u8, 124u8, 238u8, 147u8, 243u8, 126u8, 200u8, 2u8, 16u8, + 143u8, 165u8, 143u8, 159u8, 93u8, ], ) } @@ -9814,7 +9420,9 @@ pub mod api { ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType<( ::core::primitive::u32, - ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, )>, ::subxt::storage::address::Yes, (), @@ -9828,10 +9436,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Identity, )], [ - 93u8, 165u8, 219u8, 135u8, 41u8, 114u8, 144u8, 133u8, 171u8, - 83u8, 153u8, 157u8, 79u8, 14u8, 170u8, 29u8, 179u8, 23u8, - 222u8, 124u8, 237u8, 253u8, 122u8, 21u8, 186u8, 209u8, 184u8, - 89u8, 197u8, 5u8, 178u8, 255u8, + 8u8, 227u8, 185u8, 179u8, 192u8, 92u8, 171u8, 125u8, 237u8, + 224u8, 109u8, 207u8, 44u8, 181u8, 78u8, 17u8, 254u8, 183u8, + 199u8, 241u8, 49u8, 90u8, 101u8, 168u8, 46u8, 89u8, 253u8, + 155u8, 38u8, 183u8, 112u8, 35u8, ], ) } @@ -9842,7 +9450,9 @@ pub mod api { ) -> ::subxt::storage::address::StaticStorageAddress< ::subxt::metadata::DecodeStaticType<( ::core::primitive::u32, - ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, )>, (), (), @@ -9853,10 +9463,10 @@ pub mod api { "Blacklist", Vec::new(), [ - 93u8, 165u8, 219u8, 135u8, 41u8, 114u8, 144u8, 133u8, 171u8, - 83u8, 153u8, 157u8, 79u8, 14u8, 170u8, 29u8, 179u8, 23u8, - 222u8, 124u8, 237u8, 253u8, 122u8, 21u8, 186u8, 209u8, 184u8, - 89u8, 197u8, 5u8, 178u8, 255u8, + 8u8, 227u8, 185u8, 179u8, 192u8, 92u8, 171u8, 125u8, 237u8, + 224u8, 109u8, 207u8, 44u8, 181u8, 78u8, 17u8, 254u8, 183u8, + 199u8, 241u8, 49u8, 90u8, 101u8, 168u8, 46u8, 89u8, 253u8, + 155u8, 38u8, 183u8, 112u8, 35u8, ], ) } @@ -9906,31 +9516,6 @@ pub mod api { ], ) } - #[doc = " Storage version of the pallet."] - #[doc = ""] - #[doc = " New networks start with last version."] - pub fn storage_version( - &self, - ) -> ::subxt::storage::address::StaticStorageAddress< - ::subxt::metadata::DecodeStaticType< - runtime_types::pallet_democracy::Releases, - >, - ::subxt::storage::address::Yes, - (), - (), - > { - ::subxt::storage::address::StaticStorageAddress::new( - "Democracy", - "StorageVersion", - vec![], - [ - 39u8, 219u8, 134u8, 64u8, 250u8, 96u8, 95u8, 156u8, 100u8, - 236u8, 18u8, 78u8, 59u8, 146u8, 5u8, 245u8, 113u8, 125u8, - 220u8, 140u8, 125u8, 5u8, 194u8, 134u8, 248u8, 95u8, 250u8, - 108u8, 142u8, 230u8, 21u8, 120u8, - ], - ) - } } } pub mod constants { @@ -10082,23 +9667,6 @@ pub mod api { ], ) } - #[doc = " The amount of balance that must be deposited per byte of preimage stored."] - pub fn preimage_byte_deposit( - &self, - ) -> ::subxt::constants::StaticConstantAddress< - ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, - > { - ::subxt::constants::StaticConstantAddress::new( - "Democracy", - "PreimageByteDeposit", - [ - 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, - 200u8, 214u8, 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, - 101u8, 54u8, 210u8, 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, - 15u8, 178u8, 98u8, 148u8, 156u8, - ], - ) - } #[doc = " The maximum number of votes for an account."] #[doc = ""] #[doc = " Also used to compute weight, an overly big value can"] @@ -10136,20 +9704,50 @@ pub mod api { ], ) } + #[doc = " The maximum number of deposits a public proposal may have at any time."] + pub fn max_deposits( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "MaxDeposits", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) + } + #[doc = " The maximum number of items which can be blacklisted."] + pub fn max_blacklisted( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "MaxBlacklisted", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) + } } } } pub mod council { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -10203,12 +9801,12 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct Close { + pub struct CloseOldWeight { pub proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub index: ::core::primitive::u32, #[codec(compact)] - pub proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight, + pub proposal_weight_bound: runtime_types::sp_weights::OldWeight, #[codec(compact)] pub length_bound: ::core::primitive::u32, } @@ -10220,6 +9818,19 @@ pub mod api { pub struct DisapproveProposal { pub proposal_hash: ::subxt::ext::sp_core::H256, } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct Close { + pub proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + pub proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } pub struct TransactionApi; impl TransactionApi { #[doc = "Set the collective's membership."] @@ -10304,10 +9915,10 @@ pub mod api { length_bound, }, [ - 122u8, 193u8, 205u8, 29u8, 208u8, 42u8, 2u8, 42u8, 209u8, - 126u8, 230u8, 180u8, 136u8, 109u8, 55u8, 55u8, 111u8, 196u8, - 54u8, 200u8, 52u8, 156u8, 24u8, 41u8, 216u8, 147u8, 45u8, - 154u8, 175u8, 212u8, 185u8, 92u8, + 207u8, 108u8, 143u8, 240u8, 75u8, 66u8, 184u8, 27u8, 120u8, + 174u8, 60u8, 30u8, 179u8, 210u8, 21u8, 55u8, 253u8, 128u8, + 255u8, 184u8, 36u8, 121u8, 162u8, 148u8, 200u8, 98u8, 165u8, + 193u8, 132u8, 20u8, 244u8, 40u8, ], ) } @@ -10353,10 +9964,10 @@ pub mod api { length_bound, }, [ - 238u8, 193u8, 143u8, 24u8, 38u8, 102u8, 192u8, 150u8, 12u8, - 16u8, 190u8, 247u8, 50u8, 116u8, 181u8, 180u8, 90u8, 238u8, - 202u8, 226u8, 72u8, 213u8, 69u8, 163u8, 6u8, 17u8, 18u8, - 136u8, 35u8, 187u8, 151u8, 114u8, + 185u8, 29u8, 21u8, 240u8, 194u8, 157u8, 44u8, 223u8, 201u8, + 106u8, 168u8, 104u8, 111u8, 7u8, 168u8, 17u8, 73u8, 188u8, + 70u8, 235u8, 43u8, 82u8, 236u8, 70u8, 236u8, 94u8, 68u8, + 201u8, 201u8, 114u8, 236u8, 197u8, ], ) } @@ -10429,6 +10040,92 @@ pub mod api { #[doc = " - any mutations done while executing `proposal` (`P1`)"] #[doc = "- up to 3 events"] #[doc = "# "] + pub fn close_old_weight( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + proposal_weight_bound: runtime_types::sp_weights::OldWeight, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "close_old_weight", + CloseOldWeight { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }, + [ + 133u8, 219u8, 90u8, 40u8, 102u8, 95u8, 4u8, 199u8, 45u8, + 234u8, 109u8, 17u8, 162u8, 63u8, 102u8, 186u8, 95u8, 182u8, + 13u8, 123u8, 227u8, 20u8, 186u8, 207u8, 12u8, 47u8, 87u8, + 252u8, 244u8, 172u8, 60u8, 206u8, + ], + ) + } + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "disapprove_proposal", + DisapproveProposal { proposal_hash }, + [ + 25u8, 123u8, 1u8, 8u8, 74u8, 37u8, 3u8, 40u8, 97u8, 37u8, + 175u8, 224u8, 72u8, 155u8, 123u8, 109u8, 104u8, 43u8, 91u8, + 125u8, 199u8, 51u8, 17u8, 225u8, 133u8, 38u8, 120u8, 76u8, + 164u8, 5u8, 194u8, 201u8, + ], + ) + } + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] pub fn close( &self, proposal_hash: ::subxt::ext::sp_core::H256, @@ -10446,40 +10143,10 @@ pub mod api { length_bound, }, [ - 1u8, 155u8, 107u8, 199u8, 57u8, 58u8, 183u8, 207u8, 14u8, - 156u8, 87u8, 209u8, 166u8, 10u8, 178u8, 169u8, 94u8, 221u8, - 195u8, 185u8, 57u8, 6u8, 242u8, 78u8, 83u8, 169u8, 21u8, - 206u8, 45u8, 209u8, 64u8, 7u8, - ], - ) - } - #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] - #[doc = "state."] - #[doc = ""] - #[doc = "Must be called by the Root origin."] - #[doc = ""] - #[doc = "Parameters:"] - #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] - #[doc = ""] - #[doc = "# "] - #[doc = "Complexity: O(P) where P is the number of max proposals"] - #[doc = "DB Weight:"] - #[doc = "* Reads: Proposals"] - #[doc = "* Writes: Voting, Proposals, ProposalOf"] - #[doc = "# "] - pub fn disapprove_proposal( - &self, - proposal_hash: ::subxt::ext::sp_core::H256, - ) -> ::subxt::tx::StaticTxPayload { - ::subxt::tx::StaticTxPayload::new( - "Council", - "disapprove_proposal", - DisapproveProposal { proposal_hash }, - [ - 25u8, 123u8, 1u8, 8u8, 74u8, 37u8, 3u8, 40u8, 97u8, 37u8, - 175u8, 224u8, 72u8, 155u8, 123u8, 109u8, 104u8, 43u8, 91u8, - 125u8, 199u8, 51u8, 17u8, 225u8, 133u8, 38u8, 120u8, 76u8, - 164u8, 5u8, 194u8, 201u8, + 191u8, 138u8, 89u8, 247u8, 97u8, 51u8, 45u8, 193u8, 76u8, + 16u8, 80u8, 225u8, 197u8, 83u8, 204u8, 133u8, 169u8, 16u8, + 86u8, 32u8, 125u8, 16u8, 116u8, 185u8, 45u8, 20u8, 76u8, + 148u8, 206u8, 163u8, 154u8, 30u8, ], ) } @@ -10645,10 +10312,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Identity, )], [ - 36u8, 124u8, 4u8, 75u8, 169u8, 100u8, 118u8, 111u8, 49u8, - 147u8, 53u8, 113u8, 157u8, 11u8, 184u8, 134u8, 65u8, 80u8, - 60u8, 65u8, 131u8, 169u8, 213u8, 107u8, 238u8, 160u8, 216u8, - 224u8, 89u8, 55u8, 245u8, 164u8, + 99u8, 114u8, 104u8, 38u8, 106u8, 3u8, 76u8, 17u8, 152u8, + 13u8, 170u8, 109u8, 232u8, 209u8, 208u8, 60u8, 216u8, 48u8, + 170u8, 235u8, 241u8, 25u8, 78u8, 92u8, 141u8, 251u8, 247u8, + 253u8, 110u8, 183u8, 61u8, 225u8, ], ) } @@ -10668,10 +10335,10 @@ pub mod api { "ProposalOf", Vec::new(), [ - 36u8, 124u8, 4u8, 75u8, 169u8, 100u8, 118u8, 111u8, 49u8, - 147u8, 53u8, 113u8, 157u8, 11u8, 184u8, 134u8, 65u8, 80u8, - 60u8, 65u8, 131u8, 169u8, 213u8, 107u8, 238u8, 160u8, 216u8, - 224u8, 89u8, 55u8, 245u8, 164u8, + 99u8, 114u8, 104u8, 38u8, 106u8, 3u8, 76u8, 17u8, 152u8, + 13u8, 170u8, 109u8, 232u8, 209u8, 208u8, 60u8, 216u8, 48u8, + 170u8, 235u8, 241u8, 25u8, 78u8, 92u8, 141u8, 251u8, 247u8, + 253u8, 110u8, 183u8, 61u8, 225u8, ], ) } @@ -10802,16 +10469,12 @@ pub mod api { } } pub mod technical_committee { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -10865,12 +10528,12 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct Close { + pub struct CloseOldWeight { pub proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] pub index: ::core::primitive::u32, #[codec(compact)] - pub proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight, + pub proposal_weight_bound: runtime_types::sp_weights::OldWeight, #[codec(compact)] pub length_bound: ::core::primitive::u32, } @@ -10882,6 +10545,19 @@ pub mod api { pub struct DisapproveProposal { pub proposal_hash: ::subxt::ext::sp_core::H256, } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct Close { + pub proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + pub proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } pub struct TransactionApi; impl TransactionApi { #[doc = "Set the collective's membership."] @@ -10966,10 +10642,10 @@ pub mod api { length_bound, }, [ - 122u8, 193u8, 205u8, 29u8, 208u8, 42u8, 2u8, 42u8, 209u8, - 126u8, 230u8, 180u8, 136u8, 109u8, 55u8, 55u8, 111u8, 196u8, - 54u8, 200u8, 52u8, 156u8, 24u8, 41u8, 216u8, 147u8, 45u8, - 154u8, 175u8, 212u8, 185u8, 92u8, + 207u8, 108u8, 143u8, 240u8, 75u8, 66u8, 184u8, 27u8, 120u8, + 174u8, 60u8, 30u8, 179u8, 210u8, 21u8, 55u8, 253u8, 128u8, + 255u8, 184u8, 36u8, 121u8, 162u8, 148u8, 200u8, 98u8, 165u8, + 193u8, 132u8, 20u8, 244u8, 40u8, ], ) } @@ -11015,10 +10691,10 @@ pub mod api { length_bound, }, [ - 238u8, 193u8, 143u8, 24u8, 38u8, 102u8, 192u8, 150u8, 12u8, - 16u8, 190u8, 247u8, 50u8, 116u8, 181u8, 180u8, 90u8, 238u8, - 202u8, 226u8, 72u8, 213u8, 69u8, 163u8, 6u8, 17u8, 18u8, - 136u8, 35u8, 187u8, 151u8, 114u8, + 185u8, 29u8, 21u8, 240u8, 194u8, 157u8, 44u8, 223u8, 201u8, + 106u8, 168u8, 104u8, 111u8, 7u8, 168u8, 17u8, 73u8, 188u8, + 70u8, 235u8, 43u8, 82u8, 236u8, 70u8, 236u8, 94u8, 68u8, + 201u8, 201u8, 114u8, 236u8, 197u8, ], ) } @@ -11091,27 +10767,27 @@ pub mod api { #[doc = " - any mutations done while executing `proposal` (`P1`)"] #[doc = "- up to 3 events"] #[doc = "# "] - pub fn close( + pub fn close_old_weight( &self, proposal_hash: ::subxt::ext::sp_core::H256, index: ::core::primitive::u32, - proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight, + proposal_weight_bound: runtime_types::sp_weights::OldWeight, length_bound: ::core::primitive::u32, - ) -> ::subxt::tx::StaticTxPayload { + ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "TechnicalCommittee", - "close", - Close { + "close_old_weight", + CloseOldWeight { proposal_hash, index, proposal_weight_bound, length_bound, }, [ - 1u8, 155u8, 107u8, 199u8, 57u8, 58u8, 183u8, 207u8, 14u8, - 156u8, 87u8, 209u8, 166u8, 10u8, 178u8, 169u8, 94u8, 221u8, - 195u8, 185u8, 57u8, 6u8, 242u8, 78u8, 83u8, 169u8, 21u8, - 206u8, 45u8, 209u8, 64u8, 7u8, + 133u8, 219u8, 90u8, 40u8, 102u8, 95u8, 4u8, 199u8, 45u8, + 234u8, 109u8, 17u8, 162u8, 63u8, 102u8, 186u8, 95u8, 182u8, + 13u8, 123u8, 227u8, 20u8, 186u8, 207u8, 12u8, 47u8, 87u8, + 252u8, 244u8, 172u8, 60u8, 206u8, ], ) } @@ -11145,6 +10821,62 @@ pub mod api { ], ) } + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + pub fn close( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "close", + Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }, + [ + 191u8, 138u8, 89u8, 247u8, 97u8, 51u8, 45u8, 193u8, 76u8, + 16u8, 80u8, 225u8, 197u8, 83u8, 204u8, 133u8, 169u8, 16u8, + 86u8, 32u8, 125u8, 16u8, 116u8, 185u8, 45u8, 20u8, 76u8, + 148u8, 206u8, 163u8, 154u8, 30u8, + ], + ) + } } } #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] @@ -11307,10 +11039,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Identity, )], [ - 36u8, 124u8, 4u8, 75u8, 169u8, 100u8, 118u8, 111u8, 49u8, - 147u8, 53u8, 113u8, 157u8, 11u8, 184u8, 134u8, 65u8, 80u8, - 60u8, 65u8, 131u8, 169u8, 213u8, 107u8, 238u8, 160u8, 216u8, - 224u8, 89u8, 55u8, 245u8, 164u8, + 99u8, 114u8, 104u8, 38u8, 106u8, 3u8, 76u8, 17u8, 152u8, + 13u8, 170u8, 109u8, 232u8, 209u8, 208u8, 60u8, 216u8, 48u8, + 170u8, 235u8, 241u8, 25u8, 78u8, 92u8, 141u8, 251u8, 247u8, + 253u8, 110u8, 183u8, 61u8, 225u8, ], ) } @@ -11330,10 +11062,10 @@ pub mod api { "ProposalOf", Vec::new(), [ - 36u8, 124u8, 4u8, 75u8, 169u8, 100u8, 118u8, 111u8, 49u8, - 147u8, 53u8, 113u8, 157u8, 11u8, 184u8, 134u8, 65u8, 80u8, - 60u8, 65u8, 131u8, 169u8, 213u8, 107u8, 238u8, 160u8, 216u8, - 224u8, 89u8, 55u8, 245u8, 164u8, + 99u8, 114u8, 104u8, 38u8, 106u8, 3u8, 76u8, 17u8, 152u8, + 13u8, 170u8, 109u8, 232u8, 209u8, 208u8, 60u8, 216u8, 48u8, + 170u8, 235u8, 241u8, 25u8, 78u8, 92u8, 141u8, 251u8, 247u8, + 253u8, 110u8, 183u8, 61u8, 225u8, ], ) } @@ -11464,16 +11196,12 @@ pub mod api { } } pub mod phragmen_election { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -12188,16 +11916,12 @@ pub mod api { } } pub mod technical_membership { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -12557,16 +12281,12 @@ pub mod api { } } pub mod treasury { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -13132,16 +12852,12 @@ pub mod api { } } pub mod claims { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -13681,16 +13397,12 @@ pub mod api { } } pub mod vesting { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -14111,16 +13823,12 @@ pub mod api { } } pub mod utility { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -14169,13 +13877,13 @@ pub mod api { impl TransactionApi { #[doc = "Send a batch of dispatch calls."] #[doc = ""] - #[doc = "May be called from any origin."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "# "] #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] @@ -14195,10 +13903,10 @@ pub mod api { "batch", Batch { calls }, [ - 24u8, 119u8, 56u8, 158u8, 220u8, 44u8, 186u8, 125u8, 41u8, - 104u8, 182u8, 19u8, 52u8, 230u8, 4u8, 159u8, 113u8, 198u8, - 49u8, 208u8, 208u8, 180u8, 169u8, 182u8, 183u8, 57u8, 56u8, - 81u8, 136u8, 113u8, 222u8, 116u8, + 243u8, 245u8, 145u8, 160u8, 31u8, 99u8, 157u8, 224u8, 164u8, + 104u8, 116u8, 163u8, 209u8, 121u8, 149u8, 251u8, 122u8, 66u8, + 50u8, 7u8, 190u8, 93u8, 155u8, 159u8, 70u8, 132u8, 23u8, + 55u8, 47u8, 202u8, 146u8, 168u8, ], ) } @@ -14228,23 +13936,23 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 85u8, 73u8, 75u8, 105u8, 34u8, 25u8, 174u8, 155u8, 158u8, - 191u8, 198u8, 5u8, 45u8, 73u8, 239u8, 226u8, 225u8, 237u8, - 144u8, 215u8, 114u8, 240u8, 241u8, 19u8, 181u8, 196u8, 122u8, - 127u8, 99u8, 130u8, 4u8, 176u8, + 93u8, 108u8, 41u8, 206u8, 109u8, 149u8, 77u8, 161u8, 27u8, + 247u8, 177u8, 201u8, 245u8, 248u8, 46u8, 53u8, 207u8, 62u8, + 10u8, 174u8, 240u8, 59u8, 186u8, 0u8, 197u8, 135u8, 181u8, + 94u8, 1u8, 132u8, 60u8, 233u8, ], ) } #[doc = "Send a batch of dispatch calls and atomically execute them."] #[doc = "The whole transaction will rollback and fail if any of the calls failed."] #[doc = ""] - #[doc = "May be called from any origin."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "# "] #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] @@ -14258,10 +13966,10 @@ pub mod api { "batch_all", BatchAll { calls }, [ - 53u8, 233u8, 48u8, 200u8, 115u8, 125u8, 252u8, 54u8, 147u8, - 140u8, 143u8, 57u8, 235u8, 220u8, 181u8, 74u8, 115u8, 140u8, - 28u8, 151u8, 52u8, 116u8, 196u8, 106u8, 255u8, 7u8, 162u8, - 73u8, 115u8, 173u8, 9u8, 181u8, + 234u8, 106u8, 151u8, 10u8, 11u8, 227u8, 168u8, 197u8, 187u8, + 69u8, 202u8, 14u8, 120u8, 94u8, 156u8, 128u8, 103u8, 185u8, + 26u8, 181u8, 146u8, 249u8, 108u8, 67u8, 142u8, 209u8, 140u8, + 208u8, 2u8, 185u8, 175u8, 223u8, ], ) } @@ -14288,23 +13996,23 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 17u8, 2u8, 160u8, 149u8, 141u8, 61u8, 69u8, 195u8, 154u8, - 137u8, 249u8, 205u8, 46u8, 79u8, 53u8, 168u8, 212u8, 222u8, - 185u8, 214u8, 50u8, 36u8, 144u8, 181u8, 252u8, 40u8, 209u8, - 191u8, 186u8, 14u8, 126u8, 22u8, + 148u8, 0u8, 144u8, 26u8, 218u8, 140u8, 68u8, 101u8, 15u8, + 56u8, 160u8, 237u8, 202u8, 222u8, 125u8, 100u8, 209u8, 101u8, + 159u8, 117u8, 218u8, 192u8, 55u8, 235u8, 171u8, 54u8, 86u8, + 206u8, 126u8, 188u8, 143u8, 253u8, ], ) } #[doc = "Send a batch of dispatch calls."] #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] - #[doc = "May be called from any origin."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "# "] #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] @@ -14318,10 +14026,10 @@ pub mod api { "force_batch", ForceBatch { calls }, [ - 252u8, 71u8, 134u8, 157u8, 202u8, 6u8, 253u8, 159u8, 252u8, - 242u8, 190u8, 140u8, 152u8, 171u8, 138u8, 31u8, 83u8, 103u8, - 139u8, 27u8, 30u8, 213u8, 228u8, 150u8, 173u8, 108u8, 109u8, - 186u8, 31u8, 139u8, 4u8, 42u8, + 221u8, 22u8, 196u8, 62u8, 193u8, 137u8, 221u8, 234u8, 195u8, + 7u8, 133u8, 191u8, 243u8, 204u8, 109u8, 46u8, 94u8, 254u8, + 31u8, 16u8, 188u8, 65u8, 160u8, 80u8, 58u8, 202u8, 215u8, + 11u8, 99u8, 31u8, 12u8, 66u8, ], ) } @@ -14432,16 +14140,12 @@ pub mod api { } } pub mod identity { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Identity pallet declaration."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -15584,16 +15288,12 @@ pub mod api { } } pub mod proxy { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -15646,7 +15346,7 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct Anonymous { + pub struct CreatePure { pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub delay: ::core::primitive::u32, pub index: ::core::primitive::u16, @@ -15656,7 +15356,7 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct KillAnonymous { + pub struct KillPure { pub spawner: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, (), @@ -15735,10 +15435,6 @@ pub mod api { #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] pub fn proxy( &self, real: ::subxt::ext::sp_runtime::MultiAddress< @@ -15759,10 +15455,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 143u8, 116u8, 64u8, 163u8, 203u8, 48u8, 225u8, 25u8, 91u8, - 172u8, 102u8, 4u8, 22u8, 200u8, 64u8, 185u8, 224u8, 59u8, - 76u8, 98u8, 213u8, 152u8, 103u8, 133u8, 144u8, 1u8, 158u8, - 254u8, 33u8, 140u8, 150u8, 151u8, + 2u8, 110u8, 54u8, 249u8, 204u8, 49u8, 0u8, 174u8, 55u8, 97u8, + 168u8, 240u8, 133u8, 33u8, 119u8, 57u8, 207u8, 107u8, 9u8, + 58u8, 91u8, 16u8, 97u8, 49u8, 136u8, 119u8, 180u8, 187u8, + 105u8, 150u8, 228u8, 140u8, ], ) } @@ -15775,10 +15471,6 @@ pub mod api { #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] #[doc = "zero."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] pub fn add_proxy( &self, delegate: ::subxt::ext::sp_runtime::MultiAddress< @@ -15811,10 +15503,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] pub fn remove_proxy( &self, delegate: ::subxt::ext::sp_runtime::MultiAddress< @@ -15844,12 +15532,8 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] + #[doc = "WARNING: This may be called on accounts created by `pure`, however if done, then"] #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] pub fn remove_proxies( &self, ) -> ::subxt::tx::StaticTxPayload { @@ -15883,54 +15567,45 @@ pub mod api { #[doc = "same sender, with the same parameters."] #[doc = ""] #[doc = "Fails if there are insufficient funds to pay for deposit."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - #[doc = "TODO: Might be over counting 1 read"] - pub fn anonymous( + pub fn create_pure( &self, proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, index: ::core::primitive::u16, - ) -> ::subxt::tx::StaticTxPayload { + ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Proxy", - "anonymous", - Anonymous { + "create_pure", + CreatePure { proxy_type, delay, index, }, [ - 181u8, 76u8, 106u8, 208u8, 138u8, 11u8, 212u8, 10u8, 87u8, - 63u8, 201u8, 120u8, 26u8, 75u8, 120u8, 79u8, 225u8, 212u8, - 181u8, 9u8, 166u8, 24u8, 4u8, 15u8, 181u8, 28u8, 173u8, - 184u8, 122u8, 254u8, 20u8, 208u8, + 65u8, 120u8, 166u8, 57u8, 89u8, 119u8, 161u8, 93u8, 184u8, + 203u8, 190u8, 29u8, 64u8, 238u8, 70u8, 17u8, 151u8, 227u8, + 170u8, 84u8, 21u8, 161u8, 171u8, 180u8, 193u8, 175u8, 211u8, + 228u8, 246u8, 216u8, 152u8, 91u8, ], ) } - #[doc = "Removes a previously spawned anonymous proxy."] + #[doc = "Removes a previously spawned pure proxy."] #[doc = ""] #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] #[doc = "inaccessible."] #[doc = ""] #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`anonymous` with corresponding parameters."] - #[doc = ""] - #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] - #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] + #[doc = "`pure` with corresponding parameters."] #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] - #[doc = "account whose `anonymous` call has corresponding parameters."] + #[doc = "- `spawner`: The account that originally called `pure` to create this account."] + #[doc = "- `index`: The disambiguation index originally passed to `pure`. Probably `0`."] + #[doc = "- `proxy_type`: The proxy type originally passed to `pure`."] + #[doc = "- `height`: The height of the chain when the call to `pure` was processed."] + #[doc = "- `ext_index`: The extrinsic index in which the call to `pure` was processed."] #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - pub fn kill_anonymous( + #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] + #[doc = "account whose `pure` call has corresponding parameters."] + pub fn kill_pure( &self, spawner: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -15940,11 +15615,11 @@ pub mod api { index: ::core::primitive::u16, height: ::core::primitive::u32, ext_index: ::core::primitive::u32, - ) -> ::subxt::tx::StaticTxPayload { + ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Proxy", - "kill_anonymous", - KillAnonymous { + "kill_pure", + KillPure { spawner, proxy_type, index, @@ -15952,10 +15627,10 @@ pub mod api { ext_index, }, [ - 117u8, 168u8, 0u8, 103u8, 70u8, 178u8, 149u8, 176u8, 9u8, - 165u8, 177u8, 245u8, 38u8, 77u8, 166u8, 120u8, 239u8, 34u8, - 190u8, 148u8, 229u8, 109u8, 168u8, 227u8, 92u8, 113u8, 112u8, - 219u8, 227u8, 149u8, 230u8, 99u8, + 67u8, 233u8, 31u8, 138u8, 222u8, 70u8, 182u8, 77u8, 103u8, + 39u8, 195u8, 35u8, 39u8, 89u8, 50u8, 248u8, 187u8, 101u8, + 170u8, 188u8, 87u8, 143u8, 6u8, 180u8, 178u8, 181u8, 158u8, + 111u8, 19u8, 139u8, 222u8, 208u8, ], ) } @@ -15974,12 +15649,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] pub fn announce( &self, real: ::subxt::ext::sp_runtime::MultiAddress< @@ -16010,12 +15679,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] pub fn remove_announcement( &self, real: ::subxt::ext::sp_runtime::MultiAddress< @@ -16046,12 +15709,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `delegate`: The account that previously announced the call."] #[doc = "- `call_hash`: The hash of the call to be made."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] pub fn reject_announcement( &self, delegate: ::subxt::ext::sp_runtime::MultiAddress< @@ -16086,12 +15743,6 @@ pub mod api { #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] pub fn proxy_announced( &self, delegate: ::subxt::ext::sp_runtime::MultiAddress< @@ -16117,10 +15768,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 160u8, 2u8, 189u8, 146u8, 209u8, 60u8, 12u8, 196u8, 102u8, - 114u8, 74u8, 138u8, 75u8, 8u8, 26u8, 128u8, 58u8, 216u8, - 68u8, 118u8, 2u8, 170u8, 108u8, 173u8, 32u8, 165u8, 158u8, - 244u8, 170u8, 247u8, 89u8, 200u8, + 201u8, 208u8, 101u8, 152u8, 52u8, 146u8, 71u8, 255u8, 2u8, + 250u8, 225u8, 24u8, 117u8, 32u8, 113u8, 251u8, 230u8, 233u8, + 30u8, 187u8, 194u8, 116u8, 65u8, 51u8, 142u8, 106u8, 91u8, + 178u8, 193u8, 170u8, 150u8, 118u8, ], ) } @@ -16149,17 +15800,17 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - #[doc = "Anonymous account has been created by new proxy with given"] + #[doc = "A pure account has been created by new proxy with given"] #[doc = "disambiguation index and proxy type."] - pub struct AnonymousCreated { - pub anonymous: ::subxt::ext::sp_core::crypto::AccountId32, + pub struct PureCreated { + pub pure: ::subxt::ext::sp_core::crypto::AccountId32, pub who: ::subxt::ext::sp_core::crypto::AccountId32, pub proxy_type: runtime_types::polkadot_runtime::ProxyType, pub disambiguation_index: ::core::primitive::u16, } - impl ::subxt::events::StaticEvent for AnonymousCreated { + impl ::subxt::events::StaticEvent for PureCreated { const PALLET: &'static str = "Proxy"; - const EVENT: &'static str = "AnonymousCreated"; + const EVENT: &'static str = "PureCreated"; } #[derive( :: subxt :: ext :: codec :: Decode, @@ -16468,16 +16119,12 @@ pub mod api { } } pub mod multisig { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -16501,10 +16148,7 @@ pub mod api { pub maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, - pub call: ::subxt::utils::WrapperKeepOpaque< - runtime_types::polkadot_runtime::RuntimeCall, - >, - pub store_call: ::core::primitive::bool, + pub call: ::std::boxed::Box, pub max_weight: runtime_types::sp_weights::weight_v2::Weight, } #[derive( @@ -16568,10 +16212,10 @@ pub mod api { call: ::std::boxed::Box::new(call), }, [ - 118u8, 240u8, 60u8, 172u8, 156u8, 13u8, 184u8, 133u8, 164u8, - 104u8, 208u8, 5u8, 26u8, 253u8, 210u8, 143u8, 122u8, 171u8, - 24u8, 76u8, 92u8, 87u8, 5u8, 146u8, 188u8, 225u8, 136u8, - 243u8, 13u8, 31u8, 173u8, 111u8, + 147u8, 128u8, 190u8, 162u8, 129u8, 151u8, 240u8, 184u8, 12u8, + 100u8, 188u8, 81u8, 25u8, 140u8, 46u8, 215u8, 52u8, 135u8, + 134u8, 207u8, 40u8, 221u8, 114u8, 48u8, 102u8, 107u8, 173u8, + 90u8, 74u8, 56u8, 147u8, 238u8, ], ) } @@ -16616,8 +16260,8 @@ pub mod api { #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] #[doc = "-------------------------------"] #[doc = "- DB Weight:"] - #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = " - Reads: Multisig Storage, [Caller Account]"] + #[doc = " - Writes: Multisig Storage, [Caller Account]"] #[doc = "- Plus Call Weight"] #[doc = "# "] pub fn as_multi( @@ -16629,10 +16273,7 @@ pub mod api { maybe_timepoint: ::core::option::Option< runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, >, - call: ::subxt::utils::WrapperKeepOpaque< - runtime_types::polkadot_runtime::RuntimeCall, - >, - store_call: ::core::primitive::bool, + call: runtime_types::polkadot_runtime::RuntimeCall, max_weight: runtime_types::sp_weights::weight_v2::Weight, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( @@ -16642,15 +16283,14 @@ pub mod api { threshold, other_signatories, maybe_timepoint, - call, - store_call, + call: ::std::boxed::Box::new(call), max_weight, }, [ - 115u8, 35u8, 141u8, 177u8, 34u8, 249u8, 163u8, 249u8, 97u8, - 240u8, 127u8, 31u8, 174u8, 103u8, 251u8, 90u8, 27u8, 94u8, - 252u8, 242u8, 217u8, 94u8, 209u8, 38u8, 2u8, 94u8, 81u8, - 138u8, 1u8, 146u8, 149u8, 228u8, + 223u8, 45u8, 132u8, 89u8, 48u8, 61u8, 93u8, 46u8, 76u8, 28u8, + 217u8, 194u8, 89u8, 170u8, 245u8, 6u8, 76u8, 50u8, 12u8, + 133u8, 230u8, 10u8, 56u8, 231u8, 29u8, 202u8, 60u8, 50u8, + 181u8, 144u8, 238u8, 151u8, ], ) } @@ -16712,10 +16352,10 @@ pub mod api { max_weight, }, [ - 189u8, 195u8, 146u8, 249u8, 81u8, 54u8, 8u8, 234u8, 99u8, - 36u8, 239u8, 235u8, 17u8, 200u8, 94u8, 153u8, 52u8, 82u8, - 38u8, 220u8, 139u8, 180u8, 4u8, 79u8, 129u8, 230u8, 227u8, - 156u8, 242u8, 253u8, 2u8, 196u8, + 133u8, 113u8, 121u8, 66u8, 218u8, 219u8, 48u8, 64u8, 211u8, + 114u8, 163u8, 193u8, 164u8, 21u8, 140u8, 218u8, 253u8, 237u8, + 240u8, 126u8, 200u8, 213u8, 184u8, 50u8, 187u8, 182u8, 30u8, + 52u8, 142u8, 72u8, 210u8, 101u8, ], ) } @@ -16742,8 +16382,8 @@ pub mod api { #[doc = "- Storage: removes one item."] #[doc = "----------------------------------"] #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account"] + #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account"] #[doc = "# "] pub fn cancel_as_multi( &self, @@ -16869,7 +16509,7 @@ pub mod api { (), ::subxt::storage::address::Yes, > { - :: subxt :: storage :: address :: StaticStorageAddress :: new ("Multisig" , "Multisigs" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [145u8 , 78u8 , 57u8 , 171u8 , 199u8 , 158u8 , 226u8 , 250u8 , 224u8 , 133u8 , 45u8 , 251u8 , 202u8 , 22u8 , 171u8 , 132u8 , 229u8 , 110u8 , 248u8 , 233u8 , 38u8 , 2u8 , 247u8 , 140u8 , 150u8 , 103u8 , 211u8 , 209u8 , 160u8 , 158u8 , 23u8 , 215u8 ,]) + :: subxt :: storage :: address :: StaticStorageAddress :: new ("Multisig" , "Multisigs" , vec ! [:: subxt :: storage :: address :: StorageMapKey :: new (_0 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Twox64Concat) , :: subxt :: storage :: address :: StorageMapKey :: new (_1 . borrow () , :: subxt :: storage :: address :: StorageHasher :: Blake2_128Concat)] , [69u8 , 153u8 , 186u8 , 204u8 , 117u8 , 95u8 , 119u8 , 182u8 , 220u8 , 87u8 , 8u8 , 15u8 , 123u8 , 83u8 , 5u8 , 188u8 , 115u8 , 121u8 , 163u8 , 96u8 , 218u8 , 3u8 , 106u8 , 44u8 , 44u8 , 187u8 , 46u8 , 238u8 , 80u8 , 203u8 , 175u8 , 155u8 ,]) } #[doc = " The set of open multisig operations."] pub fn multisigs_root( @@ -16891,66 +16531,10 @@ pub mod api { "Multisigs", Vec::new(), [ - 145u8, 78u8, 57u8, 171u8, 199u8, 158u8, 226u8, 250u8, 224u8, - 133u8, 45u8, 251u8, 202u8, 22u8, 171u8, 132u8, 229u8, 110u8, - 248u8, 233u8, 38u8, 2u8, 247u8, 140u8, 150u8, 103u8, 211u8, - 209u8, 160u8, 158u8, 23u8, 215u8, - ], - ) - } - pub fn calls( - &self, - _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 32usize]>, - ) -> ::subxt::storage::address::StaticStorageAddress< - ::subxt::metadata::DecodeStaticType<( - ::subxt::utils::WrapperKeepOpaque< - runtime_types::polkadot_runtime::RuntimeCall, - >, - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - ::subxt::storage::address::Yes, - (), - ::subxt::storage::address::Yes, - > { - ::subxt::storage::address::StaticStorageAddress::new( - "Multisig", - "Calls", - vec![::subxt::storage::address::StorageMapKey::new( - _0.borrow(), - ::subxt::storage::address::StorageHasher::Identity, - )], - [ - 106u8, 189u8, 101u8, 253u8, 243u8, 234u8, 236u8, 252u8, 81u8, - 127u8, 108u8, 194u8, 114u8, 182u8, 122u8, 171u8, 169u8, - 174u8, 192u8, 23u8, 72u8, 148u8, 21u8, 247u8, 63u8, 65u8, - 29u8, 89u8, 30u8, 235u8, 49u8, 222u8, - ], - ) - } - pub fn calls_root( - &self, - ) -> ::subxt::storage::address::StaticStorageAddress< - ::subxt::metadata::DecodeStaticType<( - ::subxt::utils::WrapperKeepOpaque< - runtime_types::polkadot_runtime::RuntimeCall, - >, - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - )>, - (), - (), - ::subxt::storage::address::Yes, - > { - ::subxt::storage::address::StaticStorageAddress::new( - "Multisig", - "Calls", - Vec::new(), - [ - 106u8, 189u8, 101u8, 253u8, 243u8, 234u8, 236u8, 252u8, 81u8, - 127u8, 108u8, 194u8, 114u8, 182u8, 122u8, 171u8, 169u8, - 174u8, 192u8, 23u8, 72u8, 148u8, 21u8, 247u8, 63u8, 65u8, - 29u8, 89u8, 30u8, 235u8, 49u8, 222u8, + 69u8, 153u8, 186u8, 204u8, 117u8, 95u8, 119u8, 182u8, 220u8, + 87u8, 8u8, 15u8, 123u8, 83u8, 5u8, 188u8, 115u8, 121u8, + 163u8, 96u8, 218u8, 3u8, 106u8, 44u8, 44u8, 187u8, 46u8, + 238u8, 80u8, 203u8, 175u8, 155u8, ], ) } @@ -17005,16 +16589,16 @@ pub mod api { pub fn max_signatories( &self, ) -> ::subxt::constants::StaticConstantAddress< - ::subxt::metadata::DecodeStaticType<::core::primitive::u16>, + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, > { ::subxt::constants::StaticConstantAddress::new( "Multisig", "MaxSignatories", [ - 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, - 227u8, 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, - 184u8, 72u8, 169u8, 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, - 123u8, 128u8, 193u8, 29u8, 70u8, + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, ], ) } @@ -17022,16 +16606,12 @@ pub mod api { } } pub mod bounties { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -17825,16 +17405,12 @@ pub mod api { } } pub mod child_bounties { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -18570,16 +18146,12 @@ pub mod api { } } pub mod tips { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -19160,16 +18732,12 @@ pub mod api { } } pub mod election_provider_multi_phase { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -19529,16 +19097,16 @@ pub mod api { ], ) } - #[doc = " Current best solution, signed or unsigned, queued to be returned upon `elect`."] pub fn queued_solution (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > > , :: subxt :: storage :: address :: Yes , () , () >{ + #[doc = " Current best solution, signed or unsigned, queued to be returned upon `elect`."] pub fn queued_solution (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution > , :: subxt :: storage :: address :: Yes , () , () >{ ::subxt::storage::address::StaticStorageAddress::new( "ElectionProviderMultiPhase", "QueuedSolution", vec![], [ - 149u8, 246u8, 152u8, 57u8, 54u8, 217u8, 14u8, 124u8, 125u8, - 202u8, 242u8, 149u8, 147u8, 201u8, 168u8, 99u8, 249u8, 17u8, - 163u8, 184u8, 254u8, 115u8, 100u8, 108u8, 28u8, 14u8, 139u8, - 215u8, 26u8, 93u8, 215u8, 251u8, + 11u8, 152u8, 13u8, 167u8, 204u8, 209u8, 171u8, 249u8, 59u8, + 250u8, 58u8, 152u8, 164u8, 121u8, 146u8, 112u8, 241u8, 16u8, + 159u8, 251u8, 209u8, 251u8, 114u8, 29u8, 188u8, 30u8, 84u8, + 71u8, 136u8, 173u8, 145u8, 236u8, ], ) } @@ -19624,21 +19192,35 @@ pub mod api { ], ) } - #[doc = " A sorted, bounded set of `(score, index)`, where each `index` points to a value in"] - #[doc = " `SignedSubmissions`."] + #[doc = " A sorted, bounded vector of `(score, block_number, index)`, where each `index` points to a"] + #[doc = " value in `SignedSubmissions`."] #[doc = ""] #[doc = " We never need to process more than a single signed submission at a time. Signed submissions"] #[doc = " can be quite large, so we're willing to pay the cost of multiple database accesses to access"] - #[doc = " them one at a time instead of reading and decoding all of them at once."] pub fn signed_submission_indices (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: sp_core :: bounded :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , () >{ + #[doc = " them one at a time instead of reading and decoding all of them at once."] + pub fn signed_submission_indices( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_core::bounded::bounded_vec::BoundedVec<( + runtime_types::sp_npos_elections::ElectionScore, + ::core::primitive::u32, + ::core::primitive::u32, + )>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { ::subxt::storage::address::StaticStorageAddress::new( "ElectionProviderMultiPhase", "SignedSubmissionIndices", vec![], [ - 121u8, 119u8, 26u8, 183u8, 167u8, 33u8, 230u8, 159u8, 230u8, - 171u8, 8u8, 52u8, 178u8, 214u8, 245u8, 148u8, 202u8, 6u8, - 7u8, 50u8, 84u8, 174u8, 253u8, 131u8, 235u8, 136u8, 40u8, - 83u8, 2u8, 64u8, 9u8, 83u8, + 228u8, 166u8, 94u8, 248u8, 71u8, 26u8, 125u8, 81u8, 32u8, + 22u8, 46u8, 185u8, 209u8, 123u8, 46u8, 17u8, 152u8, 149u8, + 222u8, 125u8, 112u8, 230u8, 29u8, 177u8, 162u8, 214u8, 66u8, + 38u8, 170u8, 121u8, 129u8, 100u8, ], ) } @@ -19865,10 +19447,10 @@ pub mod api { "ElectionProviderMultiPhase", "SignedMaxWeight", [ - 67u8, 70u8, 203u8, 252u8, 102u8, 92u8, 175u8, 48u8, 35u8, - 141u8, 85u8, 109u8, 102u8, 228u8, 244u8, 116u8, 6u8, 210u8, - 54u8, 115u8, 86u8, 234u8, 159u8, 246u8, 251u8, 91u8, 202u8, - 141u8, 32u8, 21u8, 97u8, 85u8, + 206u8, 61u8, 253u8, 247u8, 163u8, 40u8, 161u8, 52u8, 134u8, + 140u8, 206u8, 83u8, 44u8, 166u8, 226u8, 115u8, 181u8, 14u8, + 227u8, 130u8, 210u8, 32u8, 85u8, 29u8, 230u8, 97u8, 130u8, + 165u8, 147u8, 134u8, 106u8, 76u8, ], ) } @@ -19993,6 +19575,26 @@ pub mod api { ], ) } + #[doc = " The maximum number of winners that can be elected by this `ElectionProvider`"] + #[doc = " implementation."] + #[doc = ""] + #[doc = " Note: This must always be greater or equal to `T::DataProvider::desired_targets()`."] + pub fn max_winners( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "MaxWinners", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, + 157u8, 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, + 98u8, 68u8, 9u8, 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, + 90u8, 203u8, 100u8, 41u8, 145u8, + ], + ) + } pub fn miner_max_length( &self, ) -> ::subxt::constants::StaticConstantAddress< @@ -20020,10 +19622,10 @@ pub mod api { "ElectionProviderMultiPhase", "MinerMaxWeight", [ - 67u8, 70u8, 203u8, 252u8, 102u8, 92u8, 175u8, 48u8, 35u8, - 141u8, 85u8, 109u8, 102u8, 228u8, 244u8, 116u8, 6u8, 210u8, - 54u8, 115u8, 86u8, 234u8, 159u8, 246u8, 251u8, 91u8, 202u8, - 141u8, 32u8, 21u8, 97u8, 85u8, + 206u8, 61u8, 253u8, 247u8, 163u8, 40u8, 161u8, 52u8, 134u8, + 140u8, 206u8, 83u8, 44u8, 166u8, 226u8, 115u8, 181u8, 14u8, + 227u8, 130u8, 210u8, 32u8, 85u8, 29u8, 230u8, 97u8, 130u8, + 165u8, 147u8, 134u8, 106u8, 76u8, ], ) } @@ -20047,16 +19649,12 @@ pub mod api { } } pub mod voter_list { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -20378,16 +19976,12 @@ pub mod api { } } pub mod nomination_pools { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -20475,6 +20069,28 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] + pub struct CreateWithPoolId { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub root: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub nominator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub state_toggler: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub pool_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct Nominate { pub pool_id: ::core::primitive::u32, pub validators: @@ -20788,6 +20404,47 @@ pub mod api { ], ) } + #[doc = "Create a new delegation pool with a previously used pool id"] + #[doc = ""] + #[doc = "# Arguments"] + #[doc = ""] + #[doc = "same as `create` with the inclusion of"] + #[doc = "* `pool_id` - `A valid PoolId."] + pub fn create_with_pool_id( + &self, + amount: ::core::primitive::u128, + root: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + nominator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + state_toggler: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pool_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "create_with_pool_id", + CreateWithPoolId { + amount, + root, + nominator, + state_toggler, + pool_id, + }, + [ + 234u8, 228u8, 116u8, 171u8, 77u8, 41u8, 166u8, 254u8, 20u8, + 78u8, 38u8, 28u8, 144u8, 58u8, 2u8, 64u8, 11u8, 27u8, 124u8, + 215u8, 8u8, 10u8, 172u8, 189u8, 118u8, 131u8, 102u8, 191u8, + 251u8, 208u8, 167u8, 103u8, + ], + ) + } #[doc = "Nominate on behalf of the pool."] #[doc = ""] #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] @@ -21792,23 +21449,337 @@ pub mod api { } } } + pub mod fast_unstake { + use super::root_mod; + use super::runtime_types; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct RegisterFastUnstake; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct Deregister; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct Control { + pub unchecked_eras_to_check: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Register oneself for fast-unstake."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the controller account, similar to"] + #[doc = "`staking::unbond`."] + #[doc = ""] + #[doc = "The stash associated with the origin must have no ongoing unlocking chunks. If"] + #[doc = "successful, this will fully unbond and chill the stash. Then, it will enqueue the stash"] + #[doc = "to be checked in further blocks."] + #[doc = ""] + #[doc = "If by the time this is called, the stash is actually eligible for fast-unstake, then"] + #[doc = "they are guaranteed to remain eligible, because the call will chill them as well."] + #[doc = ""] + #[doc = "If the check works, the entire staking data is removed, i.e. the stash is fully"] + #[doc = "unstaked."] + #[doc = ""] + #[doc = "If the check fails, the stash remains chilled and waiting for being unbonded as in with"] + #[doc = "the normal staking system, but they lose part of their unbonding chunks due to consuming"] + #[doc = "the chain's resources."] + pub fn register_fast_unstake( + &self, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "FastUnstake", + "register_fast_unstake", + RegisterFastUnstake {}, + [ + 254u8, 85u8, 128u8, 135u8, 172u8, 170u8, 34u8, 145u8, 79u8, + 117u8, 234u8, 90u8, 16u8, 174u8, 159u8, 197u8, 27u8, 239u8, + 180u8, 85u8, 116u8, 23u8, 254u8, 30u8, 197u8, 110u8, 48u8, + 184u8, 177u8, 129u8, 42u8, 122u8, + ], + ) + } + #[doc = "Deregister oneself from the fast-unstake."] + #[doc = ""] + #[doc = "This is useful if one is registered, they are still waiting, and they change their mind."] + #[doc = ""] + #[doc = "Note that the associated stash is still fully unbonded and chilled as a consequence of"] + #[doc = "calling `register_fast_unstake`. This should probably be followed by a call to"] + #[doc = "`Staking::rebond`."] + pub fn deregister(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "FastUnstake", + "deregister", + Deregister {}, + [ + 198u8, 180u8, 253u8, 148u8, 124u8, 145u8, 175u8, 121u8, 42u8, + 181u8, 41u8, 155u8, 229u8, 181u8, 66u8, 140u8, 103u8, 86u8, + 242u8, 155u8, 192u8, 34u8, 157u8, 107u8, 211u8, 162u8, 1u8, + 144u8, 35u8, 252u8, 88u8, 21u8, + ], + ) + } + #[doc = "Control the operation of this pallet."] + #[doc = ""] + #[doc = "Dispatch origin must be signed by the [`Config::ControlOrigin`]."] + pub fn control( + &self, + unchecked_eras_to_check: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "FastUnstake", + "control", + Control { + unchecked_eras_to_check, + }, + [ + 134u8, 85u8, 43u8, 231u8, 209u8, 34u8, 248u8, 0u8, 238u8, + 73u8, 175u8, 105u8, 40u8, 128u8, 186u8, 40u8, 211u8, 106u8, + 107u8, 206u8, 124u8, 155u8, 220u8, 125u8, 143u8, 10u8, 162u8, + 20u8, 99u8, 142u8, 243u8, 5u8, + ], + ) + } + } + } + #[doc = "The events of this pallet."] + pub type Event = runtime_types::pallet_fast_unstake::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "A staker was unstaked."] + pub struct Unstaked { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for Unstaked { + const PALLET: &'static str = "FastUnstake"; + const EVENT: &'static str = "Unstaked"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "A staker was slashed for requesting fast-unstake whilst being exposed."] + pub struct Slashed { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Slashed { + const PALLET: &'static str = "FastUnstake"; + const EVENT: &'static str = "Slashed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "Some internal error happened while migrating stash. They are removed as head as a"] + #[doc = "consequence."] + pub struct Errored { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Errored { + const PALLET: &'static str = "FastUnstake"; + const EVENT: &'static str = "Errored"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "An internal error happened. Operations will be paused now."] + pub struct InternalError; + impl ::subxt::events::StaticEvent for InternalError { + const PALLET: &'static str = "FastUnstake"; + const EVENT: &'static str = "InternalError"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "A batch was partially checked for the given eras, but the process did not finish."] + pub struct BatchChecked { + pub eras: ::std::vec::Vec<::core::primitive::u32>, + } + impl ::subxt::events::StaticEvent for BatchChecked { + const PALLET: &'static str = "FastUnstake"; + const EVENT: &'static str = "BatchChecked"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "A batch was terminated."] + #[doc = ""] + #[doc = "This is always follows by a number of `Unstaked` or `Slashed` events, marking the end"] + #[doc = "of the batch. A new batch will be created upon next block."] + pub struct BatchFinished; + impl ::subxt::events::StaticEvent for BatchFinished { + const PALLET: &'static str = "FastUnstake"; + const EVENT: &'static str = "BatchFinished"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The current \"head of the queue\" being unstaked."] + pub fn head( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_fast_unstake::types::UnstakeRequest, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "FastUnstake", + "Head", + vec![], + [ + 206u8, 19u8, 169u8, 239u8, 214u8, 136u8, 16u8, 102u8, 82u8, + 110u8, 128u8, 205u8, 102u8, 96u8, 148u8, 190u8, 67u8, 75u8, + 2u8, 213u8, 134u8, 143u8, 40u8, 57u8, 54u8, 66u8, 170u8, + 42u8, 135u8, 212u8, 108u8, 177u8, + ], + ) + } + #[doc = " The map of all accounts wishing to be unstaked."] + #[doc = ""] + #[doc = " Keeps track of `AccountId` wishing to unstake and it's corresponding deposit."] + pub fn queue( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "FastUnstake", + "Queue", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 250u8, 208u8, 88u8, 68u8, 8u8, 87u8, 27u8, 59u8, 120u8, + 242u8, 79u8, 54u8, 108u8, 15u8, 62u8, 143u8, 126u8, 66u8, + 159u8, 159u8, 55u8, 212u8, 190u8, 26u8, 171u8, 90u8, 156u8, + 205u8, 173u8, 189u8, 230u8, 71u8, + ], + ) + } + #[doc = " The map of all accounts wishing to be unstaked."] + #[doc = ""] + #[doc = " Keeps track of `AccountId` wishing to unstake and it's corresponding deposit."] + pub fn queue_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "FastUnstake", + "Queue", + Vec::new(), + [ + 250u8, 208u8, 88u8, 68u8, 8u8, 87u8, 27u8, 59u8, 120u8, + 242u8, 79u8, 54u8, 108u8, 15u8, 62u8, 143u8, 126u8, 66u8, + 159u8, 159u8, 55u8, 212u8, 190u8, 26u8, 171u8, 90u8, 156u8, + 205u8, 173u8, 189u8, 230u8, 71u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_queue( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "FastUnstake", + "CounterForQueue", + vec![], + [ + 241u8, 174u8, 224u8, 214u8, 204u8, 37u8, 117u8, 62u8, 114u8, + 63u8, 123u8, 121u8, 201u8, 128u8, 26u8, 60u8, 170u8, 24u8, + 112u8, 5u8, 248u8, 7u8, 143u8, 17u8, 150u8, 91u8, 23u8, 90u8, + 237u8, 4u8, 138u8, 210u8, + ], + ) + } + #[doc = " Number of eras to check per block."] + #[doc = ""] + #[doc = " If set to 0, this pallet does absolutely nothing."] + #[doc = ""] + #[doc = " Based on the amount of weight available at `on_idle`, up to this many eras of a single"] + #[doc = " nominator might be checked."] + pub fn eras_to_check_per_block( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "FastUnstake", + "ErasToCheckPerBlock", + vec![], + [ + 85u8, 55u8, 18u8, 11u8, 75u8, 176u8, 36u8, 253u8, 183u8, + 250u8, 203u8, 178u8, 201u8, 79u8, 101u8, 89u8, 51u8, 142u8, + 254u8, 23u8, 49u8, 140u8, 195u8, 116u8, 66u8, 124u8, 165u8, + 161u8, 151u8, 174u8, 37u8, 51u8, + ], + ) + } + } + } + } pub mod parachains_origin { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; } pub mod configuration { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: CompactAs, @@ -22680,10 +22651,10 @@ pub mod api { "set_ump_service_total_weight", SetUmpServiceTotalWeight { new }, [ - 47u8, 23u8, 3u8, 184u8, 127u8, 191u8, 25u8, 75u8, 197u8, - 12u8, 57u8, 44u8, 234u8, 97u8, 225u8, 68u8, 242u8, 126u8, - 242u8, 163u8, 228u8, 0u8, 20u8, 236u8, 35u8, 226u8, 230u8, - 22u8, 93u8, 135u8, 209u8, 192u8, + 178u8, 63u8, 233u8, 183u8, 160u8, 109u8, 10u8, 162u8, 150u8, + 110u8, 66u8, 166u8, 197u8, 207u8, 91u8, 208u8, 137u8, 106u8, + 140u8, 184u8, 35u8, 85u8, 138u8, 49u8, 32u8, 15u8, 150u8, + 136u8, 50u8, 197u8, 21u8, 99u8, ], ) } @@ -22931,10 +22902,10 @@ pub mod api { "set_ump_max_individual_weight", SetUmpMaxIndividualWeight { new }, [ - 82u8, 211u8, 117u8, 199u8, 250u8, 253u8, 242u8, 101u8, 237u8, - 7u8, 246u8, 231u8, 159u8, 201u8, 140u8, 206u8, 169u8, 230u8, - 178u8, 218u8, 34u8, 60u8, 84u8, 79u8, 208u8, 13u8, 169u8, - 144u8, 99u8, 107u8, 36u8, 234u8, + 66u8, 190u8, 15u8, 172u8, 67u8, 16u8, 117u8, 247u8, 176u8, + 25u8, 163u8, 130u8, 147u8, 224u8, 226u8, 101u8, 219u8, 173u8, + 176u8, 49u8, 90u8, 133u8, 12u8, 223u8, 220u8, 18u8, 83u8, + 232u8, 137u8, 52u8, 206u8, 71u8, ], ) } @@ -23024,10 +22995,10 @@ pub mod api { "ActiveConfig", vec![], [ - 180u8, 180u8, 21u8, 228u8, 1u8, 190u8, 55u8, 164u8, 134u8, - 33u8, 59u8, 181u8, 230u8, 140u8, 227u8, 33u8, 249u8, 103u8, - 228u8, 37u8, 179u8, 58u8, 169u8, 165u8, 179u8, 138u8, 182u8, - 24u8, 170u8, 69u8, 139u8, 222u8, + 152u8, 7u8, 210u8, 144u8, 253u8, 1u8, 141u8, 200u8, 122u8, + 214u8, 104u8, 100u8, 228u8, 235u8, 16u8, 86u8, 213u8, 212u8, + 204u8, 46u8, 74u8, 95u8, 217u8, 3u8, 40u8, 28u8, 149u8, + 175u8, 7u8, 146u8, 24u8, 3u8, ], ) } @@ -23043,10 +23014,10 @@ pub mod api { "PendingConfigs", vec![], [ - 208u8, 37u8, 226u8, 148u8, 181u8, 75u8, 194u8, 22u8, 16u8, - 81u8, 112u8, 176u8, 169u8, 232u8, 161u8, 206u8, 132u8, 145u8, - 190u8, 147u8, 7u8, 155u8, 53u8, 159u8, 156u8, 202u8, 22u8, - 33u8, 212u8, 186u8, 122u8, 75u8, + 206u8, 161u8, 39u8, 154u8, 62u8, 215u8, 33u8, 93u8, 214u8, + 37u8, 29u8, 71u8, 32u8, 176u8, 87u8, 166u8, 39u8, 11u8, 81u8, + 155u8, 174u8, 118u8, 138u8, 76u8, 22u8, 248u8, 148u8, 210u8, + 243u8, 41u8, 111u8, 216u8, ], ) } @@ -23076,16 +23047,12 @@ pub mod api { } } pub mod paras_shared { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; pub struct TransactionApi; impl TransactionApi {} @@ -23171,16 +23138,12 @@ pub mod api { } } pub mod para_inclusion { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; pub struct TransactionApi; impl TransactionApi {} @@ -23366,16 +23329,12 @@ pub mod api { } } pub mod para_inherent { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -23475,10 +23434,8 @@ pub mod api { } } pub mod para_scheduler { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; pub mod storage { use super::runtime_types; pub struct StorageApi; @@ -23641,16 +23598,12 @@ pub mod api { } } pub mod paras { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -24747,10 +24700,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Twox64Concat, )], [ - 84u8, 41u8, 210u8, 81u8, 237u8, 249u8, 162u8, 208u8, 247u8, - 223u8, 208u8, 201u8, 54u8, 43u8, 222u8, 187u8, 8u8, 116u8, - 184u8, 221u8, 107u8, 243u8, 48u8, 168u8, 108u8, 47u8, 133u8, - 236u8, 184u8, 174u8, 130u8, 145u8, + 134u8, 111u8, 59u8, 49u8, 28u8, 111u8, 6u8, 57u8, 109u8, + 75u8, 75u8, 53u8, 91u8, 150u8, 86u8, 38u8, 223u8, 50u8, + 107u8, 75u8, 200u8, 61u8, 211u8, 7u8, 105u8, 251u8, 243u8, + 18u8, 220u8, 195u8, 216u8, 167u8, ], ) } @@ -24763,10 +24716,10 @@ pub mod api { "UpcomingParasGenesis", Vec::new(), [ - 84u8, 41u8, 210u8, 81u8, 237u8, 249u8, 162u8, 208u8, 247u8, - 223u8, 208u8, 201u8, 54u8, 43u8, 222u8, 187u8, 8u8, 116u8, - 184u8, 221u8, 107u8, 243u8, 48u8, 168u8, 108u8, 47u8, 133u8, - 236u8, 184u8, 174u8, 130u8, 145u8, + 134u8, 111u8, 59u8, 49u8, 28u8, 111u8, 6u8, 57u8, 109u8, + 75u8, 75u8, 53u8, 91u8, 150u8, 86u8, 38u8, 223u8, 50u8, + 107u8, 75u8, 200u8, 61u8, 211u8, 7u8, 105u8, 251u8, 243u8, + 18u8, 220u8, 195u8, 216u8, 167u8, ], ) } @@ -24902,16 +24855,12 @@ pub mod api { } } pub mod initializer { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: CompactAs, @@ -25000,16 +24949,12 @@ pub mod api { } } pub mod dmp { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; pub struct TransactionApi; impl TransactionApi {} @@ -25111,16 +25056,12 @@ pub mod api { } } pub mod ump { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -25158,10 +25099,10 @@ pub mod api { weight_limit, }, [ - 162u8, 46u8, 217u8, 245u8, 241u8, 67u8, 14u8, 88u8, 80u8, - 138u8, 47u8, 41u8, 52u8, 109u8, 132u8, 113u8, 251u8, 112u8, - 223u8, 238u8, 135u8, 207u8, 230u8, 226u8, 24u8, 88u8, 18u8, - 191u8, 46u8, 160u8, 196u8, 50u8, + 121u8, 236u8, 235u8, 23u8, 210u8, 238u8, 238u8, 122u8, 15u8, + 86u8, 34u8, 119u8, 105u8, 100u8, 214u8, 236u8, 117u8, 39u8, + 254u8, 235u8, 189u8, 15u8, 72u8, 74u8, 225u8, 134u8, 148u8, + 126u8, 31u8, 203u8, 144u8, 106u8, ], ) } @@ -25559,16 +25500,12 @@ pub mod api { } } pub mod hrmp { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -25635,6 +25572,17 @@ pub mod api { runtime_types::polkadot_parachain::primitives::HrmpChannelId, pub open_requests: ::core::primitive::u32, } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct ForceOpenHrmpChannel { + pub sender: runtime_types::polkadot_parachain::primitives::Id, + pub recipient: runtime_types::polkadot_parachain::primitives::Id, + pub max_capacity: ::core::primitive::u32, + pub max_message_size: ::core::primitive::u32, + } pub struct TransactionApi; impl TransactionApi { #[doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] @@ -25809,6 +25757,36 @@ pub mod api { ], ) } + #[doc = "Open a channel from a `sender` to a `recipient` `ParaId` using the Root origin. Although"] + #[doc = "opened by Root, the `max_capacity` and `max_message_size` are still subject to the Relay"] + #[doc = "Chain's configured limits."] + #[doc = ""] + #[doc = "Expected use is when one of the `ParaId`s involved in the channel is governed by the"] + #[doc = "Relay Chain, e.g. a common good parachain."] + pub fn force_open_hrmp_channel( + &self, + sender: runtime_types::polkadot_parachain::primitives::Id, + recipient: runtime_types::polkadot_parachain::primitives::Id, + max_capacity: ::core::primitive::u32, + max_message_size: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Hrmp", + "force_open_hrmp_channel", + ForceOpenHrmpChannel { + sender, + recipient, + max_capacity, + max_message_size, + }, + [ + 145u8, 23u8, 215u8, 75u8, 94u8, 119u8, 205u8, 222u8, 186u8, + 149u8, 11u8, 172u8, 211u8, 158u8, 247u8, 21u8, 125u8, 144u8, + 91u8, 157u8, 94u8, 143u8, 188u8, 20u8, 98u8, 136u8, 165u8, + 70u8, 155u8, 14u8, 92u8, 58u8, + ], + ) + } } } #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] @@ -25875,6 +25853,23 @@ pub mod api { const PALLET: &'static str = "Hrmp"; const EVENT: &'static str = "ChannelClosed"; } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "An HRMP channel was opened via Root origin."] + #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] + pub struct HrmpChannelForceOpened( + pub runtime_types::polkadot_parachain::primitives::Id, + pub runtime_types::polkadot_parachain::primitives::Id, + pub ::core::primitive::u32, + pub ::core::primitive::u32, + ); + impl ::subxt::events::StaticEvent for HrmpChannelForceOpened { + const PALLET: &'static str = "Hrmp"; + const EVENT: &'static str = "HrmpChannelForceOpened"; + } } pub mod storage { use super::runtime_types; @@ -26511,10 +26506,8 @@ pub mod api { } } pub mod para_session_info { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; pub mod storage { use super::runtime_types; pub struct StorageApi; @@ -26577,10 +26570,10 @@ pub mod api { ::subxt::storage::address::StorageHasher::Identity, )], [ - 33u8, 46u8, 71u8, 15u8, 195u8, 14u8, 107u8, 223u8, 112u8, - 69u8, 249u8, 233u8, 86u8, 249u8, 79u8, 164u8, 20u8, 71u8, - 191u8, 32u8, 67u8, 195u8, 128u8, 61u8, 67u8, 84u8, 79u8, - 137u8, 248u8, 85u8, 253u8, 21u8, + 186u8, 220u8, 61u8, 52u8, 195u8, 40u8, 214u8, 113u8, 92u8, + 109u8, 221u8, 201u8, 122u8, 213u8, 124u8, 35u8, 244u8, 55u8, + 244u8, 168u8, 23u8, 0u8, 240u8, 109u8, 143u8, 90u8, 40u8, + 87u8, 127u8, 64u8, 100u8, 75u8, ], ) } @@ -26602,10 +26595,10 @@ pub mod api { "Sessions", Vec::new(), [ - 33u8, 46u8, 71u8, 15u8, 195u8, 14u8, 107u8, 223u8, 112u8, - 69u8, 249u8, 233u8, 86u8, 249u8, 79u8, 164u8, 20u8, 71u8, - 191u8, 32u8, 67u8, 195u8, 128u8, 61u8, 67u8, 84u8, 79u8, - 137u8, 248u8, 85u8, 253u8, 21u8, + 186u8, 220u8, 61u8, 52u8, 195u8, 40u8, 214u8, 113u8, 92u8, + 109u8, 221u8, 201u8, 122u8, 213u8, 124u8, 35u8, 244u8, 55u8, + 244u8, 168u8, 23u8, 0u8, 240u8, 109u8, 143u8, 90u8, 40u8, + 87u8, 127u8, 64u8, 100u8, 75u8, ], ) } @@ -26663,16 +26656,12 @@ pub mod api { } } pub mod paras_disputes { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -26959,16 +26948,12 @@ pub mod api { } } pub mod registrar { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -27016,7 +27001,7 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct ForceRemoveLock { + pub struct RemoveLock { pub para: runtime_types::polkadot_parachain::primitives::Id, } #[derive( @@ -27025,6 +27010,33 @@ pub mod api { Debug, )] pub struct Reserve; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct AddLock { + pub para: runtime_types::polkadot_parachain::primitives::Id, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct ScheduleCodeUpgrade { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_code: + runtime_types::polkadot_parachain::primitives::ValidationCode, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct SetCurrentHead { + pub para: runtime_types::polkadot_parachain::primitives::Id, + pub new_head: runtime_types::polkadot_parachain::primitives::HeadData, + } pub struct TransactionApi; impl TransactionApi { #[doc = "Register head data and validation code for a reserved Para Id."] @@ -27145,20 +27157,20 @@ pub mod api { #[doc = "Remove a manager lock from a para. This will allow the manager of a"] #[doc = "previously locked para to deregister or swap a para without using governance."] #[doc = ""] - #[doc = "Can only be called by the Root origin."] - pub fn force_remove_lock( + #[doc = "Can only be called by the Root origin or the parachain."] + pub fn remove_lock( &self, para: runtime_types::polkadot_parachain::primitives::Id, - ) -> ::subxt::tx::StaticTxPayload { + ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "Registrar", - "force_remove_lock", - ForceRemoveLock { para }, + "remove_lock", + RemoveLock { para }, [ - 161u8, 77u8, 236u8, 143u8, 243u8, 159u8, 88u8, 61u8, 217u8, - 140u8, 161u8, 61u8, 20u8, 76u8, 130u8, 59u8, 85u8, 219u8, - 105u8, 234u8, 146u8, 142u8, 121u8, 154u8, 170u8, 210u8, - 204u8, 175u8, 160u8, 86u8, 249u8, 150u8, + 93u8, 50u8, 223u8, 180u8, 185u8, 3u8, 225u8, 27u8, 233u8, + 205u8, 101u8, 86u8, 122u8, 19u8, 147u8, 8u8, 202u8, 151u8, + 80u8, 24u8, 196u8, 2u8, 88u8, 250u8, 184u8, 96u8, 158u8, + 70u8, 181u8, 201u8, 200u8, 213u8, ], ) } @@ -27189,6 +27201,66 @@ pub mod api { ], ) } + #[doc = "Add a manager lock from a para. This will prevent the manager of a"] + #[doc = "para to deregister or swap a para."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked."] + pub fn add_lock( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "add_lock", + AddLock { para }, + [ + 99u8, 199u8, 192u8, 92u8, 180u8, 52u8, 86u8, 165u8, 249u8, + 60u8, 72u8, 79u8, 233u8, 5u8, 83u8, 194u8, 48u8, 83u8, 249u8, + 218u8, 141u8, 234u8, 232u8, 59u8, 9u8, 150u8, 147u8, 173u8, + 91u8, 154u8, 81u8, 17u8, + ], + ) + } + #[doc = "Schedule a parachain upgrade."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked."] + pub fn schedule_code_upgrade( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "schedule_code_upgrade", + ScheduleCodeUpgrade { para, new_code }, + [ + 67u8, 11u8, 148u8, 83u8, 36u8, 106u8, 97u8, 77u8, 79u8, + 114u8, 249u8, 218u8, 207u8, 89u8, 209u8, 120u8, 45u8, 101u8, + 69u8, 21u8, 61u8, 158u8, 90u8, 83u8, 29u8, 143u8, 55u8, 9u8, + 178u8, 75u8, 183u8, 25u8, + ], + ) + } + #[doc = "Set the parachain's current head."] + #[doc = ""] + #[doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked."] + pub fn set_current_head( + &self, + para: runtime_types::polkadot_parachain::primitives::Id, + new_head: runtime_types::polkadot_parachain::primitives::HeadData, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Registrar", + "set_current_head", + SetCurrentHead { para, new_head }, + [ + 103u8, 240u8, 206u8, 26u8, 120u8, 189u8, 94u8, 221u8, 174u8, + 225u8, 210u8, 176u8, 217u8, 18u8, 94u8, 216u8, 77u8, 205u8, + 86u8, 196u8, 121u8, 4u8, 230u8, 147u8, 19u8, 224u8, 38u8, + 254u8, 199u8, 254u8, 245u8, 110u8, + ], + ) + } } } #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] @@ -27423,16 +27495,12 @@ pub mod api { } } pub mod slots { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -27717,16 +27785,12 @@ pub mod api { } } pub mod auctions { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -28207,16 +28271,12 @@ pub mod api { } } pub mod crowdloan { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -28896,16 +28956,12 @@ pub mod api { } } pub mod xcm_pallet { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub mod calls { - use super::{ - root_mod, - runtime_types, - }; + use super::root_mod; + use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive( :: subxt :: ext :: codec :: Decode, @@ -28947,7 +29003,7 @@ pub mod api { )] pub struct Execute { pub message: ::std::boxed::Box, - pub max_weight: runtime_types::sp_weights::weight_v2::Weight, + pub max_weight: ::core::primitive::u64, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -29127,7 +29183,7 @@ pub mod api { pub fn execute( &self, message: runtime_types::xcm::VersionedXcm, - max_weight: runtime_types::sp_weights::weight_v2::Weight, + max_weight: ::core::primitive::u64, ) -> ::subxt::tx::StaticTxPayload { ::subxt::tx::StaticTxPayload::new( "XcmPallet", @@ -29137,10 +29193,10 @@ pub mod api { max_weight, }, [ - 212u8, 76u8, 149u8, 118u8, 145u8, 199u8, 59u8, 158u8, 221u8, - 134u8, 6u8, 31u8, 212u8, 186u8, 25u8, 111u8, 124u8, 78u8, - 207u8, 101u8, 83u8, 6u8, 252u8, 19u8, 110u8, 169u8, 103u8, - 193u8, 119u8, 53u8, 164u8, 144u8, + 191u8, 177u8, 39u8, 21u8, 1u8, 110u8, 39u8, 58u8, 94u8, 27u8, + 44u8, 18u8, 253u8, 135u8, 100u8, 205u8, 0u8, 231u8, 68u8, + 247u8, 5u8, 140u8, 131u8, 184u8, 251u8, 197u8, 100u8, 113u8, + 253u8, 255u8, 120u8, 206u8, ], ) } @@ -29617,6 +29673,23 @@ pub mod api { const PALLET: &'static str = "XcmPallet"; const EVENT: &'static str = "NotifyTargetMigrationFail"; } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "Some assets have been claimed from an asset trap"] + #[doc = ""] + #[doc = "\\[ hash, origin, assets \\]"] + pub struct AssetsClaimed( + pub ::subxt::ext::sp_core::H256, + pub runtime_types::xcm::v1::multilocation::MultiLocation, + pub runtime_types::xcm::VersionedMultiAssets, + ); + impl ::subxt::events::StaticEvent for AssetsClaimed { + const PALLET: &'static str = "XcmPallet"; + const EVENT: &'static str = "AssetsClaimed"; + } } pub mod storage { use super::runtime_types; @@ -30054,43 +30127,35 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct WrapperKeepOpaque<_0>( - #[codec(compact)] pub ::core::primitive::u32, - pub _0, - ); - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] pub struct WrapperOpaque<_0>( #[codec(compact)] pub ::core::primitive::u32, pub _0, ); } - pub mod schedule { + pub mod preimages { use super::runtime_types; #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, Debug, )] - pub enum LookupError { - #[codec(index = 0)] - Unknown, - #[codec(index = 1)] - BadFormat, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub enum MaybeHashed<_0, _1> { + pub enum Bounded<_0> { #[codec(index = 0)] - Value(_0), + Legacy { + hash: ::subxt::ext::sp_core::H256, + }, #[codec(index = 1)] - Hash(_1), + Inline( + runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ), + #[codec(index = 2)] + Lookup { + hash: ::subxt::ext::sp_core::H256, + len: ::core::primitive::u32, + }, + __Ignore(::core::marker::PhantomData<_0>), } } pub mod tokens { @@ -30803,7 +30868,7 @@ pub mod api { #[doc = "Account liquidity restrictions prevent withdrawal"] LiquidityRestrictions, #[codec(index = 2)] - #[doc = "Balance too low to send value"] + #[doc = "Balance too low to send value."] InsufficientBalance, #[codec(index = 3)] #[doc = "Value too low to create account due to existential deposit"] @@ -31629,13 +31694,12 @@ pub mod api { #[doc = " - any mutations done while executing `proposal` (`P1`)"] #[doc = "- up to 3 events"] #[doc = "# "] - close { + close_old_weight { proposal_hash: ::subxt::ext::sp_core::H256, #[codec(compact)] index: ::core::primitive::u32, #[codec(compact)] - proposal_weight_bound: - runtime_types::sp_weights::weight_v2::Weight, + proposal_weight_bound: runtime_types::sp_weights::OldWeight, #[codec(compact)] length_bound: ::core::primitive::u32, }, @@ -31657,6 +31721,48 @@ pub mod api { disapprove_proposal { proposal_hash: ::subxt::ext::sp_core::H256, }, + #[codec(index = 6)] + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + close { + proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + index: ::core::primitive::u32, + proposal_weight_bound: + runtime_types::sp_weights::weight_v2::Weight, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -31830,10 +31936,11 @@ pub mod api { #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] #[doc = ""] #[doc = "Emits `Proposed`."] - #[doc = ""] - #[doc = "Weight: `O(p)`"] propose { - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, #[codec(compact)] value: ::core::primitive::u128, }, @@ -31844,15 +31951,9 @@ pub mod api { #[doc = "must have funds to cover the deposit, equal to the original deposit."] #[doc = ""] #[doc = "- `proposal`: The index of the proposal to second."] - #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] - #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] - #[doc = ""] - #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] second { #[codec(compact)] proposal: ::core::primitive::u32, - #[codec(compact)] - seconds_upper_bound: ::core::primitive::u32, }, #[codec(index = 2)] #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] @@ -31862,8 +31963,6 @@ pub mod api { #[doc = ""] #[doc = "- `ref_index`: The index of the referendum to vote for."] #[doc = "- `vote`: The vote configuration."] - #[doc = ""] - #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] vote { #[codec(compact)] ref_index: ::core::primitive::u32, @@ -31888,11 +31987,11 @@ pub mod api { #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] #[doc = ""] #[doc = "- `proposal_hash`: The preimage hash of the proposal."] - #[doc = ""] - #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] - #[doc = " Decoding vec of length V. Charged as maximum"] external_propose { - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, }, #[codec(index = 5)] #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] @@ -31907,7 +32006,10 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] external_propose_majority { - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, }, #[codec(index = 6)] #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] @@ -31922,7 +32024,10 @@ pub mod api { #[doc = ""] #[doc = "Weight: `O(1)`"] external_propose_default { - proposal_hash: ::subxt::ext::sp_core::H256, + proposal: + runtime_types::frame_support::traits::preimages::Bounded< + runtime_types::polkadot_runtime::RuntimeCall, + >, }, #[codec(index = 7)] #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] @@ -31932,7 +32037,7 @@ pub mod api { #[doc = "The dispatch of this call must be `FastTrackOrigin`."] #[doc = ""] #[doc = "- `proposal_hash`: The hash of the current external proposal."] - #[doc = "- `voting_period`: The period that is allowed for voting on this proposal."] + #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] #[doc = "\tMust be always greater than zero."] #[doc = "\tFor `FastTrackOrigin` must be equal or greater than `FastTrackVotingPeriod`."] #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] @@ -31972,15 +32077,6 @@ pub mod api { ref_index: ::core::primitive::u32, }, #[codec(index = 10)] - #[doc = "Cancel a proposal queued for enactment."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Root_."] - #[doc = ""] - #[doc = "- `which`: The index of the referendum to cancel."] - #[doc = ""] - #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] - cancel_queued { which: ::core::primitive::u32 }, - #[codec(index = 11)] #[doc = "Delegate the voting power (with some given conviction) of the sending account."] #[doc = ""] #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] @@ -32010,7 +32106,7 @@ pub mod api { runtime_types::pallet_democracy::conviction::Conviction, balance: ::core::primitive::u128, }, - #[codec(index = 12)] + #[codec(index = 11)] #[doc = "Undelegate the voting power of the sending account."] #[doc = ""] #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] @@ -32024,75 +32120,14 @@ pub mod api { #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] #[doc = " voted on. Weight is charged as if maximum votes."] undelegate, - #[codec(index = 13)] + #[codec(index = 12)] #[doc = "Clears all public proposals."] #[doc = ""] #[doc = "The dispatch origin of this call must be _Root_."] #[doc = ""] #[doc = "Weight: `O(1)`."] clear_public_proposals, - #[codec(index = 14)] - #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] - #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - note_preimage { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 15)] - #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] - note_preimage_operational { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 16)] - #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] - #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] - #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] - #[doc = "no fee is paid."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `encoded_proposal`: The preimage of a proposal."] - #[doc = ""] - #[doc = "Emits `PreimageNoted`."] - #[doc = ""] - #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] - note_imminent_preimage { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 17)] - #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] - note_imminent_preimage_operational { - encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, - }, - #[codec(index = 18)] - #[doc = "Remove an expired proposal preimage and collect the deposit."] - #[doc = ""] - #[doc = "The dispatch origin of this call must be _Signed_."] - #[doc = ""] - #[doc = "- `proposal_hash`: The preimage hash of a proposal."] - #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] - #[doc = " weighted according to this value with no refund."] - #[doc = ""] - #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] - #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] - #[doc = "work an additional `EnactmentPeriod` later."] - #[doc = ""] - #[doc = "Emits `PreimageReaped`."] - #[doc = ""] - #[doc = "Weight: `O(D)` where D is length of proposal."] - reap_preimage { - proposal_hash: ::subxt::ext::sp_core::H256, - #[codec(compact)] - proposal_len_upper_bound: ::core::primitive::u32, - }, - #[codec(index = 19)] + #[codec(index = 13)] #[doc = "Unlock tokens that have an expired lock."] #[doc = ""] #[doc = "The dispatch origin of this call must be _Signed_."] @@ -32106,7 +32141,7 @@ pub mod api { (), >, }, - #[codec(index = 20)] + #[codec(index = 14)] #[doc = "Remove a vote for a referendum."] #[doc = ""] #[doc = "If:"] @@ -32135,7 +32170,7 @@ pub mod api { #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] #[doc = " Weight is calculated for the maximum number of vote."] remove_vote { index: ::core::primitive::u32 }, - #[codec(index = 21)] + #[codec(index = 15)] #[doc = "Remove a vote for a referendum."] #[doc = ""] #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] @@ -32158,13 +32193,7 @@ pub mod api { >, index: ::core::primitive::u32, }, - #[codec(index = 22)] - #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] - enact_proposal { - proposal_hash: ::subxt::ext::sp_core::H256, - index: ::core::primitive::u32, - }, - #[codec(index = 23)] + #[codec(index = 16)] #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] #[doc = "proposed again."] #[doc = ""] @@ -32184,7 +32213,7 @@ pub mod api { proposal_hash: ::subxt::ext::sp_core::H256, maybe_ref_index: ::core::option::Option<::core::primitive::u32>, }, - #[codec(index = 24)] + #[codec(index = 17)] #[doc = "Remove a proposal."] #[doc = ""] #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] @@ -32232,64 +32261,46 @@ pub mod api { #[doc = "Identity may not veto a proposal twice"] AlreadyVetoed, #[codec(index = 9)] - #[doc = "Preimage already noted"] - DuplicatePreimage, - #[codec(index = 10)] - #[doc = "Not imminent"] - NotImminent, - #[codec(index = 11)] - #[doc = "Too early"] - TooEarly, - #[codec(index = 12)] - #[doc = "Imminent"] - Imminent, - #[codec(index = 13)] - #[doc = "Preimage not found"] - PreimageMissing, - #[codec(index = 14)] #[doc = "Vote given for invalid referendum"] ReferendumInvalid, - #[codec(index = 15)] - #[doc = "Invalid preimage"] - PreimageInvalid, - #[codec(index = 16)] + #[codec(index = 10)] #[doc = "No proposals waiting"] NoneWaiting, - #[codec(index = 17)] + #[codec(index = 11)] #[doc = "The given account did not vote on the referendum."] NotVoter, - #[codec(index = 18)] + #[codec(index = 12)] #[doc = "The actor has no permission to conduct the action."] NoPermission, - #[codec(index = 19)] + #[codec(index = 13)] #[doc = "The account is already delegating."] AlreadyDelegating, - #[codec(index = 20)] + #[codec(index = 14)] #[doc = "Too high a balance was provided that the account cannot afford."] InsufficientFunds, - #[codec(index = 21)] + #[codec(index = 15)] #[doc = "The account is not currently delegating."] NotDelegating, - #[codec(index = 22)] + #[codec(index = 16)] #[doc = "The account currently has votes attached to it and the operation cannot succeed until"] #[doc = "these are removed, either through `unvote` or `reap_vote`."] VotesExist, - #[codec(index = 23)] + #[codec(index = 17)] #[doc = "The instant referendum origin is currently disallowed."] InstantNotAllowed, - #[codec(index = 24)] + #[codec(index = 18)] #[doc = "Delegation to oneself makes no sense."] Nonsense, - #[codec(index = 25)] + #[codec(index = 19)] #[doc = "Invalid upper bound."] WrongUpperBound, - #[codec(index = 26)] + #[codec(index = 20)] #[doc = "Maximum number of votes reached."] MaxVotesReached, - #[codec(index = 27)] - #[doc = "Maximum number of proposals reached."] - TooManyProposals, - #[codec(index = 28)] + #[codec(index = 21)] + #[doc = "Maximum number of items reached."] + TooMany, + #[codec(index = 22)] #[doc = "Voting period too low"] VotingPeriodLow, } @@ -32300,7 +32311,7 @@ pub mod api { )] #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] pub enum Event { - # [codec (index = 0)] # [doc = "A motion has been proposed by a public account."] Proposed { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "A public proposal has been tabled for referendum vote."] Tabled { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , depositors : :: std :: vec :: Vec < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 2)] # [doc = "An external proposal has been tabled."] ExternalTabled , # [codec (index = 3)] # [doc = "A referendum has begun."] Started { ref_index : :: core :: primitive :: u32 , threshold : runtime_types :: pallet_democracy :: vote_threshold :: VoteThreshold , } , # [codec (index = 4)] # [doc = "A proposal has been approved by referendum."] Passed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "A proposal has been rejected by referendum."] NotPassed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "A referendum has been cancelled."] Cancelled { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "A proposal has been enacted."] Executed { ref_index : :: core :: primitive :: u32 , result : :: core :: result :: Result < () , runtime_types :: sp_runtime :: DispatchError > , } , # [codec (index = 8)] # [doc = "An account has delegated their vote to another account."] Delegated { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , target : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 9)] # [doc = "An account has cancelled a previous delegation operation."] Undelegated { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 10)] # [doc = "An external proposal has been vetoed."] Vetoed { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , proposal_hash : :: subxt :: ext :: sp_core :: H256 , until : :: core :: primitive :: u32 , } , # [codec (index = 11)] # [doc = "A proposal's preimage was noted, and the deposit taken."] PreimageNoted { proposal_hash : :: subxt :: ext :: sp_core :: H256 , who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 12)] # [doc = "A proposal preimage was removed and used (the deposit was returned)."] PreimageUsed { proposal_hash : :: subxt :: ext :: sp_core :: H256 , provider : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 13)] # [doc = "A proposal could not be executed because its preimage was invalid."] PreimageInvalid { proposal_hash : :: subxt :: ext :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 14)] # [doc = "A proposal could not be executed because its preimage was missing."] PreimageMissing { proposal_hash : :: subxt :: ext :: sp_core :: H256 , ref_index : :: core :: primitive :: u32 , } , # [codec (index = 15)] # [doc = "A registered preimage was removed and the deposit collected by the reaper."] PreimageReaped { proposal_hash : :: subxt :: ext :: sp_core :: H256 , provider : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , reaper : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 16)] # [doc = "A proposal_hash has been blacklisted permanently."] Blacklisted { proposal_hash : :: subxt :: ext :: sp_core :: H256 , } , # [codec (index = 17)] # [doc = "An account has voted in a referendum"] Voted { voter : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , ref_index : :: core :: primitive :: u32 , vote : runtime_types :: pallet_democracy :: vote :: AccountVote < :: core :: primitive :: u128 > , } , # [codec (index = 18)] # [doc = "An account has secconded a proposal"] Seconded { seconder : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , prop_index : :: core :: primitive :: u32 , } , # [codec (index = 19)] # [doc = "A proposal got canceled."] ProposalCanceled { prop_index : :: core :: primitive :: u32 , } , } + # [codec (index = 0)] # [doc = "A motion has been proposed by a public account."] Proposed { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 1)] # [doc = "A public proposal has been tabled for referendum vote."] Tabled { proposal_index : :: core :: primitive :: u32 , deposit : :: core :: primitive :: u128 , } , # [codec (index = 2)] # [doc = "An external proposal has been tabled."] ExternalTabled , # [codec (index = 3)] # [doc = "A referendum has begun."] Started { ref_index : :: core :: primitive :: u32 , threshold : runtime_types :: pallet_democracy :: vote_threshold :: VoteThreshold , } , # [codec (index = 4)] # [doc = "A proposal has been approved by referendum."] Passed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "A proposal has been rejected by referendum."] NotPassed { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "A referendum has been cancelled."] Cancelled { ref_index : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "An account has delegated their vote to another account."] Delegated { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , target : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 8)] # [doc = "An account has cancelled a previous delegation operation."] Undelegated { account : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , } , # [codec (index = 9)] # [doc = "An external proposal has been vetoed."] Vetoed { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , proposal_hash : :: subxt :: ext :: sp_core :: H256 , until : :: core :: primitive :: u32 , } , # [codec (index = 10)] # [doc = "A proposal_hash has been blacklisted permanently."] Blacklisted { proposal_hash : :: subxt :: ext :: sp_core :: H256 , } , # [codec (index = 11)] # [doc = "An account has voted in a referendum"] Voted { voter : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , ref_index : :: core :: primitive :: u32 , vote : runtime_types :: pallet_democracy :: vote :: AccountVote < :: core :: primitive :: u128 > , } , # [codec (index = 12)] # [doc = "An account has secconded a proposal"] Seconded { seconder : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , prop_index : :: core :: primitive :: u32 , } , # [codec (index = 13)] # [doc = "A proposal got canceled."] ProposalCanceled { prop_index : :: core :: primitive :: u32 , } , } } pub mod types { use super::runtime_types; @@ -32340,7 +32351,7 @@ pub mod api { )] pub struct ReferendumStatus<_0, _1, _2> { pub end: _0, - pub proposal_hash: _1, + pub proposal: _1, pub threshold: runtime_types::pallet_democracy::vote_threshold::VoteThreshold, pub delay: _0, @@ -32394,10 +32405,9 @@ pub mod api { pub enum Voting<_0, _1, _2> { #[codec(index = 0)] Direct { - votes: ::std::vec::Vec<( - _2, - runtime_types::pallet_democracy::vote::AccountVote<_0>, - )>, + votes: runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + (_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>, @@ -32430,32 +32440,6 @@ pub mod api { SimpleMajority, } } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub enum PreimageStatus<_0, _1, _2> { - #[codec(index = 0)] - Missing(_2), - #[codec(index = 1)] - Available { - data: ::std::vec::Vec<::core::primitive::u8>, - provider: _0, - deposit: _1, - since: _2, - expiry: ::core::option::Option<_2>, - }, - } - #[derive( - :: subxt :: ext :: codec :: Decode, - :: subxt :: ext :: codec :: Encode, - Debug, - )] - pub enum Releases { - #[codec(index = 0)] - V1, - } } pub mod pallet_election_provider_multi_phase { use super::runtime_types; @@ -32512,6 +32496,12 @@ pub mod api { #[codec(index = 11)] #[doc = "The fallback failed"] FallbackFailed, + #[codec(index = 12)] + #[doc = "Some bound not met"] + BoundNotMet, + #[codec(index = 13)] + #[doc = "Submitted solution has too many winners"] + TooManyWinners, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -32586,9 +32576,13 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct ReadySolution<_0> { - pub supports: - ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub struct ReadySolution { + pub supports: runtime_types::sp_core::bounded::bounded_vec::BoundedVec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, pub score: runtime_types::sp_npos_elections::ElectionScore, pub compute: runtime_types::pallet_election_provider_multi_phase::ElectionCompute, @@ -32900,6 +32894,145 @@ pub mod api { pub deposit: _1, } } + pub mod pallet_fast_unstake { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Register oneself for fast-unstake."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the controller account, similar to"] + #[doc = "`staking::unbond`."] + #[doc = ""] + #[doc = "The stash associated with the origin must have no ongoing unlocking chunks. If"] + #[doc = "successful, this will fully unbond and chill the stash. Then, it will enqueue the stash"] + #[doc = "to be checked in further blocks."] + #[doc = ""] + #[doc = "If by the time this is called, the stash is actually eligible for fast-unstake, then"] + #[doc = "they are guaranteed to remain eligible, because the call will chill them as well."] + #[doc = ""] + #[doc = "If the check works, the entire staking data is removed, i.e. the stash is fully"] + #[doc = "unstaked."] + #[doc = ""] + #[doc = "If the check fails, the stash remains chilled and waiting for being unbonded as in with"] + #[doc = "the normal staking system, but they lose part of their unbonding chunks due to consuming"] + #[doc = "the chain's resources."] + register_fast_unstake, + #[codec(index = 1)] + #[doc = "Deregister oneself from the fast-unstake."] + #[doc = ""] + #[doc = "This is useful if one is registered, they are still waiting, and they change their mind."] + #[doc = ""] + #[doc = "Note that the associated stash is still fully unbonded and chilled as a consequence of"] + #[doc = "calling `register_fast_unstake`. This should probably be followed by a call to"] + #[doc = "`Staking::rebond`."] + deregister, + #[codec(index = 2)] + #[doc = "Control the operation of this pallet."] + #[doc = ""] + #[doc = "Dispatch origin must be signed by the [`Config::ControlOrigin`]."] + control { + unchecked_eras_to_check: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The provided Controller account was not found."] + #[doc = ""] + #[doc = "This means that the given account is not bonded."] + NotController, + #[codec(index = 1)] + #[doc = "The bonded account has already been queued."] + AlreadyQueued, + #[codec(index = 2)] + #[doc = "The bonded account has active unlocking chunks."] + NotFullyBonded, + #[codec(index = 3)] + #[doc = "The provided un-staker is not in the `Queue`."] + NotQueued, + #[codec(index = 4)] + #[doc = "The provided un-staker is already in Head, and cannot deregister."] + AlreadyHead, + #[codec(index = 5)] + #[doc = "The call is not allowed at this point because the pallet is not active."] + CallNotAllowed, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + #[doc = "The events of this pallet."] + pub enum Event { + #[codec(index = 0)] + #[doc = "A staker was unstaked."] + Unstaked { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + result: ::core::result::Result< + (), + runtime_types::sp_runtime::DispatchError, + >, + }, + #[codec(index = 1)] + #[doc = "A staker was slashed for requesting fast-unstake whilst being exposed."] + Slashed { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Some internal error happened while migrating stash. They are removed as head as a"] + #[doc = "consequence."] + Errored { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + #[doc = "An internal error happened. Operations will be paused now."] + InternalError, + #[codec(index = 4)] + #[doc = "A batch was partially checked for the given eras, but the process did not finish."] + BatchChecked { + eras: ::std::vec::Vec<::core::primitive::u32>, + }, + #[codec(index = 5)] + #[doc = "A batch was terminated."] + #[doc = ""] + #[doc = "This is always follows by a number of `Unstaked` or `Slashed` events, marking the end"] + #[doc = "of the batch. A new batch will be created upon next block."] + BatchFinished, + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct UnstakeRequest { + pub stashes: + runtime_types::sp_core::bounded::bounded_vec::BoundedVec<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + pub checked: runtime_types::sp_core::bounded::bounded_vec::BoundedVec< + ::core::primitive::u32, + >, + } + } + } pub mod pallet_grandpa { use super::runtime_types; pub mod pallet { @@ -33434,6 +33567,9 @@ pub mod api { #[codec(index = 16)] #[doc = "The provided judgement was for a different identity."] JudgementForDifferentIdentity, + #[codec(index = 17)] + #[doc = "Error that occurs when there is an issue paying for judgement."] + JudgementPaymentFailed, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -34181,8 +34317,8 @@ pub mod api { #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] #[doc = "-------------------------------"] #[doc = "- DB Weight:"] - #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] - #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = " - Reads: Multisig Storage, [Caller Account]"] + #[doc = " - Writes: Multisig Storage, [Caller Account]"] #[doc = "- Plus Call Weight"] #[doc = "# "] as_multi { @@ -34194,10 +34330,9 @@ pub mod api { ::core::primitive::u32, >, >, - call: ::subxt::utils::WrapperKeepOpaque< + call: ::std::boxed::Box< runtime_types::polkadot_runtime::RuntimeCall, >, - store_call: ::core::primitive::bool, max_weight: runtime_types::sp_weights::weight_v2::Weight, }, #[codec(index = 2)] @@ -34272,8 +34407,8 @@ pub mod api { #[doc = "- Storage: removes one item."] #[doc = "----------------------------------"] #[doc = "- DB Weight:"] - #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] - #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account"] + #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account"] #[doc = "# "] cancel_as_multi { threshold: ::core::primitive::u16, @@ -34394,7 +34529,8 @@ pub mod api { pub when: runtime_types::pallet_multisig::Timepoint<_0>, pub deposit: _1, pub depositor: _2, - pub approvals: ::std::vec::Vec<_2>, + pub approvals: + runtime_types::sp_core::bounded::bounded_vec::BoundedVec<_2>, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -34563,6 +34699,30 @@ pub mod api { >, }, #[codec(index = 7)] + #[doc = "Create a new delegation pool with a previously used pool id"] + #[doc = ""] + #[doc = "# Arguments"] + #[doc = ""] + #[doc = "same as `create` with the inclusion of"] + #[doc = "* `pool_id` - `A valid PoolId."] + create_with_pool_id { + #[codec(compact)] + amount: ::core::primitive::u128, + root: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + nominator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + state_toggler: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pool_id: ::core::primitive::u32, + }, + #[codec(index = 8)] #[doc = "Nominate on behalf of the pool."] #[doc = ""] #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] @@ -34575,7 +34735,7 @@ pub mod api { validators: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, }, - #[codec(index = 8)] + #[codec(index = 9)] #[doc = "Set a new state for the pool."] #[doc = ""] #[doc = "If a pool is already in the `Destroying` state, then under no condition can its state"] @@ -34590,7 +34750,7 @@ pub mod api { pool_id: ::core::primitive::u32, state: runtime_types::pallet_nomination_pools::PoolState, }, - #[codec(index = 9)] + #[codec(index = 10)] #[doc = "Set a new metadata for the pool."] #[doc = ""] #[doc = "The dispatch origin of this call must be signed by the state toggler, or the root role"] @@ -34599,7 +34759,7 @@ pub mod api { pool_id: ::core::primitive::u32, metadata: ::std::vec::Vec<::core::primitive::u8>, }, - #[codec(index = 10)] + #[codec(index = 11)] #[doc = "Update configurations for the nomination pools. The origin for this call must be"] #[doc = "Root."] #[doc = ""] @@ -34628,7 +34788,7 @@ pub mod api { ::core::primitive::u32, >, }, - #[codec(index = 11)] + #[codec(index = 12)] #[doc = "Update the roles of the pool."] #[doc = ""] #[doc = "The root is the only entity that can change any of the roles, including itself,"] @@ -34649,7 +34809,7 @@ pub mod api { ::subxt::ext::sp_core::crypto::AccountId32, >, }, - #[codec(index = 12)] + #[codec(index = 13)] #[doc = "Chill on behalf of the pool."] #[doc = ""] #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] @@ -34756,6 +34916,12 @@ pub mod api { #[codec(index = 20)] #[doc = "Partial unbonding now allowed permissionlessly."] PartialUnbondNotAllowedPermissionlessly, + #[codec(index = 21)] + #[doc = "Pool id currently in use."] + PoolIdInUse, + #[codec(index = 22)] + #[doc = "Pool id provided is not correct/usable."] + InvalidPoolId, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -35017,6 +35183,11 @@ pub mod api { }, #[codec(index = 1)] #[doc = "Clear an unrequested preimage from the runtime storage."] + #[doc = ""] + #[doc = "If `len` is provided, then it will be a much cheaper operation."] + #[doc = ""] + #[doc = "- `hash`: The hash of the preimage to be removed from the store."] + #[doc = "- `len`: The length of the preimage of `hash`."] unnote_preimage { hash: ::subxt::ext::sp_core::H256 }, #[codec(index = 2)] #[doc = "Request a preimage be uploaded to the chain without paying any fees or deposits."] @@ -35039,7 +35210,7 @@ pub mod api { pub enum Error { #[codec(index = 0)] #[doc = "Preimage is too large to store on-chain."] - TooLarge, + TooBig, #[codec(index = 1)] #[doc = "Preimage has already been noted on-chain."] AlreadyNoted, @@ -35081,9 +35252,16 @@ pub mod api { )] pub enum RequestStatus<_0, _1> { #[codec(index = 0)] - Unrequested(::core::option::Option<(_0, _1)>), + Unrequested { + deposit: (_0, _1), + len: ::core::primitive::u32, + }, #[codec(index = 1)] - Requested(::core::primitive::u32), + Requested { + deposit: ::core::option::Option<(_0, _1)>, + count: ::core::primitive::u32, + len: ::core::option::Option<::core::primitive::u32>, + }, } } pub mod pallet_proxy { @@ -35109,10 +35287,6 @@ pub mod api { #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] proxy { real: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35135,10 +35309,6 @@ pub mod api { #[doc = "- `proxy_type`: The permissions allowed for this proxy account."] #[doc = "- `delay`: The announcement period required of the initial proxy. Will generally be"] #[doc = "zero."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] add_proxy { delegate: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35155,10 +35325,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `proxy`: The account that the `caller` would like to remove as a proxy."] #[doc = "- `proxy_type`: The permissions currently enabled for the removed proxy account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] remove_proxy { delegate: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35172,12 +35338,8 @@ pub mod api { #[doc = ""] #[doc = "The dispatch origin for this call must be _Signed_."] #[doc = ""] - #[doc = "WARNING: This may be called on accounts created by `anonymous`, however if done, then"] + #[doc = "WARNING: This may be called on accounts created by `pure`, however if done, then"] #[doc = "the unreserved fees will be inaccessible. **All access to this account will be lost.**"] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] remove_proxies, #[codec(index = 4)] #[doc = "Spawn a fresh new account that is guaranteed to be otherwise inaccessible, and"] @@ -35198,38 +35360,29 @@ pub mod api { #[doc = "same sender, with the same parameters."] #[doc = ""] #[doc = "Fails if there are insufficient funds to pay for deposit."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - #[doc = "TODO: Might be over counting 1 read"] - anonymous { + create_pure { proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, index: ::core::primitive::u16, }, #[codec(index = 5)] - #[doc = "Removes a previously spawned anonymous proxy."] + #[doc = "Removes a previously spawned pure proxy."] #[doc = ""] #[doc = "WARNING: **All access to this account will be lost.** Any funds held in it will be"] #[doc = "inaccessible."] #[doc = ""] #[doc = "Requires a `Signed` origin, and the sender account must have been created by a call to"] - #[doc = "`anonymous` with corresponding parameters."] + #[doc = "`pure` with corresponding parameters."] #[doc = ""] - #[doc = "- `spawner`: The account that originally called `anonymous` to create this account."] - #[doc = "- `index`: The disambiguation index originally passed to `anonymous`. Probably `0`."] - #[doc = "- `proxy_type`: The proxy type originally passed to `anonymous`."] - #[doc = "- `height`: The height of the chain when the call to `anonymous` was processed."] - #[doc = "- `ext_index`: The extrinsic index in which the call to `anonymous` was processed."] + #[doc = "- `spawner`: The account that originally called `pure` to create this account."] + #[doc = "- `index`: The disambiguation index originally passed to `pure`. Probably `0`."] + #[doc = "- `proxy_type`: The proxy type originally passed to `pure`."] + #[doc = "- `height`: The height of the chain when the call to `pure` was processed."] + #[doc = "- `ext_index`: The extrinsic index in which the call to `pure` was processed."] #[doc = ""] - #[doc = "Fails with `NoPermission` in case the caller is not a previously created anonymous"] - #[doc = "account whose `anonymous` call has corresponding parameters."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of the number of proxies the user has (P)."] - #[doc = "# "] - kill_anonymous { + #[doc = "Fails with `NoPermission` in case the caller is not a previously created pure"] + #[doc = "account whose `pure` call has corresponding parameters."] + kill_pure { spawner: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, (), @@ -35257,12 +35410,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] announce { real: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35281,12 +35428,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `call_hash`: The hash of the call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] remove_announcement { real: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35305,12 +35446,6 @@ pub mod api { #[doc = "Parameters:"] #[doc = "- `delegate`: The account that previously announced the call."] #[doc = "- `call_hash`: The hash of the call to be made."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] reject_announcement { delegate: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35330,12 +35465,6 @@ pub mod api { #[doc = "- `real`: The account that the proxy will make a call on behalf of."] #[doc = "- `force_proxy_type`: Specify the exact proxy type to be used and checked for this call."] #[doc = "- `call`: The call to be made by the `real` account."] - #[doc = ""] - #[doc = "# "] - #[doc = "Weight is a function of:"] - #[doc = "- A: the number of announcements made."] - #[doc = "- P: the number of proxies the user has."] - #[doc = "# "] proxy_announced { delegate: ::subxt::ext::sp_runtime::MultiAddress< ::subxt::ext::sp_core::crypto::AccountId32, @@ -35401,10 +35530,10 @@ pub mod api { >, }, #[codec(index = 1)] - #[doc = "Anonymous account has been created by new proxy with given"] + #[doc = "A pure account has been created by new proxy with given"] #[doc = "disambiguation index and proxy type."] - AnonymousCreated { - anonymous: ::subxt::ext::sp_core::crypto::AccountId32, + PureCreated { + pure: ::subxt::ext::sp_core::crypto::AccountId32, who: ::subxt::ext::sp_core::crypto::AccountId32, proxy_type: runtime_types::polkadot_runtime::ProxyType, disambiguation_index: ::core::primitive::u16, @@ -35476,10 +35605,7 @@ pub mod api { )>, priority: ::core::primitive::u8, call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + runtime_types::polkadot_runtime::RuntimeCall, >, }, #[codec(index = 1)] @@ -35491,7 +35617,7 @@ pub mod api { #[codec(index = 2)] #[doc = "Schedule a named task."] schedule_named { - id: ::std::vec::Vec<::core::primitive::u8>, + id: [::core::primitive::u8; 32usize], when: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -35499,16 +35625,13 @@ pub mod api { )>, priority: ::core::primitive::u8, call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + runtime_types::polkadot_runtime::RuntimeCall, >, }, #[codec(index = 3)] #[doc = "Cancel a named scheduled task."] cancel_named { - id: ::std::vec::Vec<::core::primitive::u8>, + id: [::core::primitive::u8; 32usize], }, #[codec(index = 4)] #[doc = "Anonymously schedule a task after a delay."] @@ -35524,10 +35647,7 @@ pub mod api { )>, priority: ::core::primitive::u8, call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + runtime_types::polkadot_runtime::RuntimeCall, >, }, #[codec(index = 5)] @@ -35537,7 +35657,7 @@ pub mod api { #[doc = "Same as [`schedule_named`](Self::schedule_named)."] #[doc = "# "] schedule_named_after { - id: ::std::vec::Vec<::core::primitive::u8>, + id: [::core::primitive::u8; 32usize], after: ::core::primitive::u32, maybe_periodic: ::core::option::Option<( ::core::primitive::u32, @@ -35545,10 +35665,7 @@ pub mod api { )>, priority: ::core::primitive::u8, call: ::std::boxed::Box< - runtime_types::frame_support::traits::schedule::MaybeHashed< - runtime_types::polkadot_runtime::RuntimeCall, - ::subxt::ext::sp_core::H256, - >, + runtime_types::polkadot_runtime::RuntimeCall, >, }, } @@ -35571,6 +35688,9 @@ pub mod api { #[codec(index = 3)] #[doc = "Reschedule failed because it does not change scheduled time."] RescheduleNoChange, + #[codec(index = 4)] + #[doc = "Attempt to use a non-named function on a named task."] + Named, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -35595,9 +35715,7 @@ pub mod api { #[doc = "Dispatched some task."] Dispatched { task: (::core::primitive::u32, ::core::primitive::u32), - id: ::core::option::Option< - ::std::vec::Vec<::core::primitive::u8>, - >, + id: ::core::option::Option<[::core::primitive::u8; 32usize]>, result: ::core::result::Result< (), runtime_types::sp_runtime::DispatchError, @@ -35605,13 +35723,21 @@ pub mod api { }, #[codec(index = 3)] #[doc = "The call for the provided hash was not found so the task has been aborted."] - CallLookupFailed { + CallUnavailable { task: (::core::primitive::u32, ::core::primitive::u32), - id: ::core::option::Option< - ::std::vec::Vec<::core::primitive::u8>, - >, - error: - runtime_types::frame_support::traits::schedule::LookupError, + id: ::core::option::Option<[::core::primitive::u8; 32usize]>, + }, + #[codec(index = 4)] + #[doc = "The given task was unable to be renewed since the agenda is full at that block."] + PeriodicFailed { + task: (::core::primitive::u32, ::core::primitive::u32), + id: ::core::option::Option<[::core::primitive::u8; 32usize]>, + }, + #[codec(index = 5)] + #[doc = "The given task can never be executed since it is overweight."] + PermanentlyOverweight { + task: (::core::primitive::u32, ::core::primitive::u32), + id: ::core::option::Option<[::core::primitive::u8; 32usize]>, }, } } @@ -35620,15 +35746,14 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] - pub struct ScheduledV3<_0, _1, _2, _3> { - pub maybe_id: - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub struct Scheduled<_0, _1, _2, _3, _4> { + pub maybe_id: ::core::option::Option<_0>, pub priority: ::core::primitive::u8, - pub call: _0, - pub maybe_periodic: ::core::option::Option<(_1, _1)>, - pub origin: _2, + pub call: _1, + pub maybe_periodic: ::core::option::Option<(_2, _2)>, + pub origin: _3, #[codec(skip)] - pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, + pub __subxt_unused_type_params: ::core::marker::PhantomData<_4>, } } pub mod pallet_session { @@ -35925,7 +36050,8 @@ pub mod api { new: ::core::primitive::u32, }, #[codec(index = 10)] - #[doc = "Increments the ideal number of validators."] + #[doc = "Increments the ideal number of validators upto maximum of"] + #[doc = "`ElectionProviderBase::MaxWinners`."] #[doc = ""] #[doc = "The dispatch origin must be Root."] #[doc = ""] @@ -35937,7 +36063,8 @@ pub mod api { additional: ::core::primitive::u32, }, #[codec(index = 11)] - #[doc = "Scale up the ideal number of validators by a factor."] + #[doc = "Scale up the ideal number of validators by a factor upto maximum of"] + #[doc = "`ElectionProviderBase::MaxWinners`."] #[doc = ""] #[doc = "The dispatch origin must be Root."] #[doc = ""] @@ -36269,8 +36396,8 @@ pub mod api { #[doc = "settings to keep things safe for the runtime."] TooManyNominators, #[codec(index = 22)] - #[doc = "There are too many validators in the system. Governance needs to adjust the staking"] - #[doc = "settings to keep things safe for the runtime."] + #[doc = "There are too many validator candidates in the system. Governance needs to adjust the"] + #[doc = "staking settings to keep things safe for the runtime."] TooManyValidators, #[codec(index = 23)] #[doc = "Commission is too low. Must be at least `MinCommission`."] @@ -36289,29 +36416,29 @@ pub mod api { #[codec(index = 0)] #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] #[doc = "the remainder from the maximum amount of reward."] - #[doc = "\\[era_index, validator_payout, remainder\\]"] - EraPaid( - ::core::primitive::u32, - ::core::primitive::u128, - ::core::primitive::u128, - ), + EraPaid { + era_index: ::core::primitive::u32, + validator_payout: ::core::primitive::u128, + remainder: ::core::primitive::u128, + }, #[codec(index = 1)] - #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] - Rewarded( - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + #[doc = "The nominator has been rewarded by this amount."] + Rewarded { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 2)] - #[doc = "One validator (and its nominators) has been slashed by the given amount."] - #[doc = "\\[validator, amount\\]"] - Slashed( - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + #[doc = "One staker (and potentially its nominators) has been slashed by the given amount."] + Slashed { + staker: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 3)] #[doc = "An old slashing report from a prior era was discarded because it could"] - #[doc = "not be processed. \\[session_index\\]"] - OldSlashingReportDiscarded(::core::primitive::u32), + #[doc = "not be processed."] + OldSlashingReportDiscarded { + session_index: ::core::primitive::u32, + }, #[codec(index = 4)] #[doc = "A new set of stakers was elected."] StakersElected, @@ -36320,48 +36447,49 @@ pub mod api { #[doc = ""] #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] #[doc = "it will not be emitted for staking rewards when they are added to stake."] - Bonded( - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + Bonded { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 6)] - #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] - Unbonded( - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + #[doc = "An account has unbonded this amount."] + Unbonded { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 7)] #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] - #[doc = "from the unlocking queue. \\[stash, amount\\]"] - Withdrawn( - ::subxt::ext::sp_core::crypto::AccountId32, - ::core::primitive::u128, - ), + #[doc = "from the unlocking queue."] + Withdrawn { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, #[codec(index = 8)] - #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] - Kicked( - ::subxt::ext::sp_core::crypto::AccountId32, - ::subxt::ext::sp_core::crypto::AccountId32, - ), + #[doc = "A nominator has been kicked from a validator."] + Kicked { + nominator: ::subxt::ext::sp_core::crypto::AccountId32, + stash: ::subxt::ext::sp_core::crypto::AccountId32, + }, #[codec(index = 9)] #[doc = "The election failed. No new era is planned."] StakingElectionFailed, #[codec(index = 10)] #[doc = "An account has stopped participating as either a validator or nominator."] - #[doc = "\\[stash\\]"] - Chilled(::subxt::ext::sp_core::crypto::AccountId32), + Chilled { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + }, #[codec(index = 11)] - #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] - PayoutStarted( - ::core::primitive::u32, - ::subxt::ext::sp_core::crypto::AccountId32, - ), + #[doc = "The stakers' rewards are getting paid."] + PayoutStarted { + era_index: ::core::primitive::u32, + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + }, #[codec(index = 12)] #[doc = "A validator has set their preferences."] - ValidatorPrefsSet( - ::subxt::ext::sp_core::crypto::AccountId32, - runtime_types::pallet_staking::ValidatorPrefs, - ), + ValidatorPrefsSet { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + prefs: runtime_types::pallet_staking::ValidatorPrefs, + }, } } } @@ -37065,13 +37193,13 @@ pub mod api { #[codec(index = 0)] #[doc = "Send a batch of dispatch calls."] #[doc = ""] - #[doc = "May be called from any origin."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "# "] #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] @@ -37110,13 +37238,13 @@ pub mod api { #[doc = "Send a batch of dispatch calls and atomically execute them."] #[doc = "The whole transaction will rollback and fail if any of the calls failed."] #[doc = ""] - #[doc = "May be called from any origin."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "If origin is root then the calls are dispatched without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "# "] #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] @@ -37148,13 +37276,13 @@ pub mod api { #[doc = "Send a batch of dispatch calls."] #[doc = "Unlike `batch`, it allows errors and won't interrupt."] #[doc = ""] - #[doc = "May be called from any origin."] + #[doc = "May be called from any origin except `None`."] #[doc = ""] #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] #[doc = ""] - #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] - #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = "If origin is root then the calls are dispatch without checking origin filter. (This"] + #[doc = "includes bypassing `frame_system::Config::BaseCallFilter`)."] #[doc = ""] #[doc = "# "] #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] @@ -37504,7 +37632,7 @@ pub mod api { #[doc = "to completion; only that *some* of it was executed."] execute { message: ::std::boxed::Box, - max_weight: runtime_types::sp_weights::weight_v2::Weight, + max_weight: ::core::primitive::u64, }, #[codec(index = 4)] #[doc = "Extoll that a particular destination can be communicated with through a particular"] @@ -37817,6 +37945,15 @@ pub mod api { runtime_types::xcm::VersionedMultiLocation, ::core::primitive::u64, ), + #[codec(index = 16)] + #[doc = "Some assets have been claimed from an asset trap"] + #[doc = ""] + #[doc = "\\[ hash, origin, assets \\]"] + AssetsClaimed( + ::subxt::ext::sp_core::H256, + runtime_types::xcm::v1::multilocation::MultiLocation, + runtime_types::xcm::VersionedMultiAssets, + ), } #[derive( :: subxt :: ext :: codec :: Decode, @@ -38163,6 +38300,15 @@ pub mod api { :: subxt :: ext :: codec :: Encode, Debug, )] + pub struct IndexedVec<_0, _1>( + pub ::std::vec::Vec<_1>, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] pub struct InherentData<_0> { pub bitfields: ::std::vec::Vec< runtime_types::polkadot_primitives::v2::signed::UncheckedSigned< @@ -38249,7 +38395,8 @@ pub mod api { >, pub random_seed: [::core::primitive::u8; 32usize], pub dispute_period: ::core::primitive::u32, - pub validators: ::std::vec::Vec< + pub validators: runtime_types::polkadot_primitives::v2::IndexedVec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, runtime_types::polkadot_primitives::v2::validator_app::Public, >, pub discovery_keys: ::std::vec::Vec< @@ -38258,11 +38405,13 @@ pub mod api { pub assignment_keys: ::std::vec::Vec< runtime_types::polkadot_primitives::v2::assignment_app::Public, >, - pub validator_groups: ::std::vec::Vec< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v2::ValidatorIndex, + pub validator_groups: + runtime_types::polkadot_primitives::v2::IndexedVec< + runtime_types::polkadot_primitives::v2::GroupIndex, + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, >, - >, pub n_cores: ::core::primitive::u32, pub zeroth_delay_tranche_width: ::core::primitive::u32, pub relay_vrf_modulo_samples: ::core::primitive::u32, @@ -38558,14 +38707,14 @@ pub mod api { Debug, )] pub enum RuntimeCall { - # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Call ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Call ,) , # [codec (index = 2)] Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , # [codec (index = 3)] Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , # [codec (index = 6)] Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Call ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Call ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Call ,) , # [codec (index = 39)] NominationPools (runtime_types :: pallet_nomination_pools :: pallet :: Call ,) , # [codec (index = 51)] Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , # [codec (index = 52)] ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , # [codec (index = 54)] ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , # [codec (index = 57)] Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , # [codec (index = 58)] Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Call ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Call ,) , } + # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Call ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Call ,) , # [codec (index = 2)] Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , # [codec (index = 3)] Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , # [codec (index = 6)] Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Call ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Call ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Call ,) , # [codec (index = 39)] NominationPools (runtime_types :: pallet_nomination_pools :: pallet :: Call ,) , # [codec (index = 40)] FastUnstake (runtime_types :: pallet_fast_unstake :: pallet :: Call ,) , # [codec (index = 51)] Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , # [codec (index = 52)] ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , # [codec (index = 54)] ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , # [codec (index = 57)] Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , # [codec (index = 58)] Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Call ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Call ,) , } #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, Debug, )] pub enum RuntimeEvent { - # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 32)] TransactionPayment (runtime_types :: pallet_transaction_payment :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 39)] NominationPools (runtime_types :: pallet_nomination_pools :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Event ,) , } + # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 32)] TransactionPayment (runtime_types :: pallet_transaction_payment :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] VoterList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 39)] NominationPools (runtime_types :: pallet_nomination_pools :: pallet :: Event ,) , # [codec (index = 40)] FastUnstake (runtime_types :: pallet_fast_unstake :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Event ,) , } #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, @@ -39116,7 +39265,7 @@ pub mod api { )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { - # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin."] force_remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , } + # [codec (index = 0)] # [doc = "Register head data and validation code for a reserved Para Id."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin."] # [doc = "- `id`: The para ID. Must be owned/managed by the `origin` signing account."] # [doc = "- `genesis_head`: The genesis head data of the parachain/thread."] # [doc = "- `validation_code`: The initial validation code of the parachain/thread."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin signed account must reserve a corresponding deposit for the registration. Anything already"] # [doc = "reserved previously for this para ID is accounted for."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Registered` event is emitted in case of success."] register { id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] # [doc = "Force the registration of a Para Id on the relay chain."] # [doc = ""] # [doc = "This function must be called by a Root origin."] # [doc = ""] # [doc = "The deposit taken can be specified for this registration. Any `ParaId`"] # [doc = "can be registered, including sub-1000 IDs which are System Parachains."] force_register { who : :: subxt :: ext :: sp_core :: crypto :: AccountId32 , deposit : :: core :: primitive :: u128 , id : runtime_types :: polkadot_parachain :: primitives :: Id , genesis_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 2)] # [doc = "Deregister a Para Id, freeing all data and returning any deposit."] # [doc = ""] # [doc = "The caller must be Root, the `para` owner, or the `para` itself. The para must be a parathread."] deregister { id : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 3)] # [doc = "Swap a parachain with another parachain or parathread."] # [doc = ""] # [doc = "The origin must be Root, the `para` owner, or the `para` itself."] # [doc = ""] # [doc = "The swap will happen only if there is already an opposite swap pending. If there is not,"] # [doc = "the swap will be stored in the pending swaps map, ready for a later confirmatory swap."] # [doc = ""] # [doc = "The `ParaId`s remain mapped to the same head data and code so external code can rely on"] # [doc = "`ParaId` to be a long-term identifier of a notional \"parachain\". However, their"] # [doc = "scheduling info (i.e. whether they're a parathread or parachain), auction information"] # [doc = "and the auction deposit are switched."] swap { id : runtime_types :: polkadot_parachain :: primitives :: Id , other : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] # [doc = "Remove a manager lock from a para. This will allow the manager of a"] # [doc = "previously locked para to deregister or swap a para without using governance."] # [doc = ""] # [doc = "Can only be called by the Root origin or the parachain."] remove_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] # [doc = "Reserve a Para Id on the relay chain."] # [doc = ""] # [doc = "This function will reserve a new Para Id to be owned/managed by the origin account."] # [doc = "The origin account is able to register head data and validation code using `register` to create"] # [doc = "a parathread. Using the Slots pallet, a parathread can then be upgraded to get a parachain slot."] # [doc = ""] # [doc = "## Arguments"] # [doc = "- `origin`: Must be called by a `Signed` origin. Becomes the manager/owner of the new para ID."] # [doc = ""] # [doc = "## Deposits/Fees"] # [doc = "The origin must reserve a deposit of `ParaDeposit` for the registration."] # [doc = ""] # [doc = "## Events"] # [doc = "The `Reserved` event is emitted in case of success, which provides the ID reserved for use."] reserve , # [codec (index = 6)] # [doc = "Add a manager lock from a para. This will prevent the manager of a"] # [doc = "para to deregister or swap a para."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked."] add_lock { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 7)] # [doc = "Schedule a parachain upgrade."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked."] schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 8)] # [doc = "Set the parachain's current head."] # [doc = ""] # [doc = "Can be called by Root, the parachain, or the parachain manager if the parachain is unlocked."] set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , } #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, @@ -39631,7 +39780,7 @@ pub mod api { )] #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] pub enum Call { - # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] # [doc = "a para may have. Normally this happens once per session, but this allows"] # [doc = "you to trigger the cleanup immediately for a specific parachain."] # [doc = ""] # [doc = "Origin must be Root."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data of weighing."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data of weighing."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , } + # [codec (index = 0)] # [doc = "Initiate opening a channel from a parachain to a given recipient with given channel"] # [doc = "parameters."] # [doc = ""] # [doc = "- `proposed_max_capacity` - specifies how many messages can be in the channel at once."] # [doc = "- `proposed_max_message_size` - specifies the maximum size of the messages."] # [doc = ""] # [doc = "These numbers are a subject to the relay-chain configuration limits."] # [doc = ""] # [doc = "The channel can be opened only after the recipient confirms it and only on a session"] # [doc = "change."] hrmp_init_open_channel { recipient : runtime_types :: polkadot_parachain :: primitives :: Id , proposed_max_capacity : :: core :: primitive :: u32 , proposed_max_message_size : :: core :: primitive :: u32 , } , # [codec (index = 1)] # [doc = "Accept a pending open channel request from the given sender."] # [doc = ""] # [doc = "The channel will be opened only on the next session boundary."] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] # [doc = "Initiate unilateral closing of a channel. The origin must be either the sender or the"] # [doc = "recipient in the channel being closed."] # [doc = ""] # [doc = "The closure can only happen on a session change."] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] # [doc = "This extrinsic triggers the cleanup of all the HRMP storage items that"] # [doc = "a para may have. Normally this happens once per session, but this allows"] # [doc = "you to trigger the cleanup immediately for a specific parachain."] # [doc = ""] # [doc = "Origin must be Root."] # [doc = ""] # [doc = "Number of inbound and outbound channels for `para` must be provided as witness data of weighing."] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] # [doc = "Force process HRMP open channel requests."] # [doc = ""] # [doc = "If there are pending HRMP open channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of opening channels must be provided as witness data of weighing."] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] # [doc = "Force process HRMP close channel requests."] # [doc = ""] # [doc = "If there are pending HRMP close channel requests, you can use this"] # [doc = "function process all of those requests immediately."] # [doc = ""] # [doc = "Total number of closing channels must be provided as witness data of weighing."] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] # [doc = "This cancels a pending open channel request. It can be canceled by either of the sender"] # [doc = "or the recipient for that request. The origin must be either of those."] # [doc = ""] # [doc = "The cancellation happens immediately. It is not possible to cancel the request if it is"] # [doc = "already accepted."] # [doc = ""] # [doc = "Total number of open requests (i.e. `HrmpOpenChannelRequestsList`) must be provided as"] # [doc = "witness data."] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , # [codec (index = 7)] # [doc = "Open a channel from a `sender` to a `recipient` `ParaId` using the Root origin. Although"] # [doc = "opened by Root, the `max_capacity` and `max_message_size` are still subject to the Relay"] # [doc = "Chain's configured limits."] # [doc = ""] # [doc = "Expected use is when one of the `ParaId`s involved in the channel is governed by the"] # [doc = "Relay Chain, e.g. a common good parachain."] force_open_hrmp_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , recipient : runtime_types :: polkadot_parachain :: primitives :: Id , max_capacity : :: core :: primitive :: u32 , max_message_size : :: core :: primitive :: u32 , } , } #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, @@ -39732,6 +39881,15 @@ pub mod api { runtime_types::polkadot_parachain::primitives::Id, runtime_types::polkadot_parachain::primitives::HrmpChannelId, ), + #[codec(index = 4)] + #[doc = "An HRMP channel was opened via Root origin."] + #[doc = "`[sender, recipient, proposed_max_capacity, proposed_max_message_size]`"] + HrmpChannelForceOpened( + runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain::primitives::Id, + ::core::primitive::u32, + ::core::primitive::u32, + ), } } #[derive( @@ -40047,6 +40205,9 @@ pub mod api { #[doc = "The PVF pre-checking statement cannot be included since the PVF pre-checking mechanism"] #[doc = "is disabled."] PvfCheckDisabled, + #[codec(index = 12)] + #[doc = "Parachain cannot currently schedule a code upgrade."] + CannotUpgradeCode, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -40067,7 +40228,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::HeadData, pub validation_code: runtime_types::polkadot_parachain::primitives::ValidationCode, - pub parachain: ::core::primitive::bool, + pub para_kind: ::core::primitive::bool, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -41388,6 +41549,12 @@ pub mod api { Arithmetic(runtime_types::sp_runtime::ArithmeticError), #[codec(index = 9)] Transactional(runtime_types::sp_runtime::TransactionalError), + #[codec(index = 10)] + Exhausted, + #[codec(index = 11)] + Corruption, + #[codec(index = 12)] + Unavailable, } #[derive( :: subxt :: ext :: codec :: Decode, @@ -41511,15 +41678,24 @@ pub mod api { pub mod weight_v2 { use super::runtime_types; #[derive( - :: subxt :: ext :: codec :: CompactAs, :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, Debug, )] pub struct Weight { + #[codec(compact)] pub ref_time: ::core::primitive::u64, + #[codec(compact)] + pub proof_size: ::core::primitive::u64, } } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Debug, + )] + pub struct OldWeight(pub ::core::primitive::u64); #[derive( :: subxt :: ext :: codec :: Decode, :: subxt :: ext :: codec :: Encode, @@ -42785,6 +42961,9 @@ pub mod api { pub fn nomination_pools(&self) -> nomination_pools::storage::StorageApi { nomination_pools::storage::StorageApi } + pub fn fast_unstake(&self) -> fast_unstake::storage::StorageApi { + fast_unstake::storage::StorageApi + } pub fn configuration(&self) -> configuration::storage::StorageApi { configuration::storage::StorageApi } @@ -42933,6 +43112,9 @@ pub mod api { pub fn nomination_pools(&self) -> nomination_pools::calls::TransactionApi { nomination_pools::calls::TransactionApi } + pub fn fast_unstake(&self) -> fast_unstake::calls::TransactionApi { + fast_unstake::calls::TransactionApi + } pub fn configuration(&self) -> configuration::calls::TransactionApi { configuration::calls::TransactionApi } @@ -42986,9 +43168,9 @@ pub mod api { let runtime_metadata_hash = client.metadata().metadata_hash(&PALLETS); if runtime_metadata_hash != [ - 7u8, 177u8, 240u8, 153u8, 155u8, 227u8, 2u8, 102u8, 128u8, 31u8, 192u8, - 31u8, 81u8, 211u8, 20u8, 87u8, 110u8, 124u8, 140u8, 231u8, 48u8, 13u8, - 53u8, 245u8, 248u8, 10u8, 183u8, 243u8, 122u8, 35u8, 103u8, 79u8, + 252u8, 179u8, 170u8, 129u8, 159u8, 95u8, 180u8, 114u8, 218u8, 56u8, 91u8, + 93u8, 175u8, 45u8, 57u8, 223u8, 178u8, 209u8, 250u8, 247u8, 243u8, 73u8, + 182u8, 137u8, 176u8, 129u8, 37u8, 196u8, 133u8, 123u8, 93u8, 186u8, ] { Err(::subxt::error::MetadataError::IncompatibleMetadata) From 68842a9019c1f4938d3e090f18c28a82096c86d6 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Fri, 11 Nov 2022 14:43:57 +0000 Subject: [PATCH 17/17] Fix comment typo Co-authored-by: Niklas Adolfsson --- examples/examples/multisig.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/examples/multisig.rs b/examples/examples/multisig.rs index a267f43a53..f5e522b70d 100644 --- a/examples/examples/multisig.rs +++ b/examples/examples/multisig.rs @@ -51,7 +51,7 @@ async fn main() -> Result<(), Box> { // Now, build an outer call which this inner call will be a part of. // This sets up the multisig arrangement. let tx = polkadot::tx().multisig().as_multi( - // threashold + // threshold 1, // other signatories vec![signer_account_id],