From e6f88180515b9d0c623a394e5949c96215974439 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 21 Mar 2022 10:51:14 +0000 Subject: [PATCH 01/13] WIP extrinsic api updates --- subxt/src/client.rs | 115 +++++++++++++++++++++++++++++++++++------- subxt/src/metadata.rs | 16 +++--- 2 files changed, 106 insertions(+), 25 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index 9d1f710438..2fdadbae2f 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -39,6 +39,7 @@ use crate::{ transaction::TransactionProgress, Call, Config, + Encoded, Metadata, }; use codec::Decode; @@ -246,16 +247,49 @@ where self.client.rpc().submit_extrinsic(extrinsic).await } + // /// Creates a signed extrinsic. + // pub async fn create_signed( + // &self, + // signer: &(dyn Signer + Send + Sync), + // additional_params: X::Parameters, + // ) -> Result, BasicError> + // where + // <>::Extra as SignedExtension>::AdditionalSigned: + // Send + Sync + 'static, + // { + // let account_nonce = if let Some(nonce) = signer.nonce() { + // nonce + // } else { + // self.client + // .rpc() + // .system_account_next_index(signer.account_id()) + // .await? + // }; + // let call = self + // .client + // .metadata() + // .pallet(C::PALLET) + // .and_then(|pallet| pallet.encode_call(&self.call))?; + + // let signed = extrinsic::create_signed( + // &self.client.runtime_version, + // self.client.genesis_hash, + // account_nonce, + // call, + // signer, + // additional_params, + // ) + // .await?; + // Ok(signed) + // } + /// Creates a signed extrinsic. pub async fn create_signed( &self, signer: &(dyn Signer + Send + Sync), additional_params: X::Parameters, - ) -> Result, BasicError> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, - { + ) -> Result { + // 1. get nonce let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { @@ -264,21 +298,64 @@ where .system_account_next_index(signer.account_id()) .await? }; - let call = self - .client - .metadata() - .pallet(C::PALLET) - .and_then(|pallet| pallet.encode_call(&self.call))?; - - let signed = extrinsic::create_signed( - &self.client.runtime_version, - self.client.genesis_hash, + + // 2. SCALE encode call data to bytes (pallet u8, call u8, call params). + let call_data: Vec = { + let mut encoded = Vec::new(); + let pallet = self + .client + .metadata() + .pallet(C::PALLET)?; + encoded.push(pallet.index()); + encoded.push(pallet.call_index::()?); + self.call.encode_to(&mut encoded); + encoded + }; + + // 3. construct our custom additional/extra params. + let additional_and_extra_params = X::new( + self.client.runtime_version.spec_version, + self.client.runtime_version.transaction_version, account_nonce, - call, - signer, + self.client.genesis_hash, additional_params, - ) - .await?; - Ok(signed) + ); + + // 4. construct payload to be signed + let payload_to_be_signed = { + let mut encoded = call_data.clone(); + additional_and_extra_params.encode_extra_to(&mut encoded); + additional_and_extra_params.encode_additional_to(&mut encoded); + encoded + }; + + // 5. Create signature from this. + let signature_bytes: Vec = signer.sign(&payload_to_be_signed); + + // 6. Encode extrinsic, now that we have the parts we need. + // (this may not be 100% correct but should be close enough for this example) + let extrinsic = { + let mut encoded_inner = Vec::new(); + // "is signed" + transaction protocol version (4) + (b10000000 + 4u8).encode_to(&mut encoded_inner); + // from address for signature + signer.account_id().encode_to(&mut encoded_inner); + // the signature bytes + signature_bytes.encode_to(&mut encoded_inner); + // attach custom extra params + additional_and_extra_params.encode_extra_to(&mut encoded_inner); + // and now, call data + encoded_inner.extend(&mut call_data); + // now, prefix byte length: + let len = Compact(encoded_inner.len()); + let mut encoded = Vec::new(); + len.encode_to(&mut encoded); + encoded.extend(&mut encoded_inner); + encoded + }; + + // Wrap in Encoded to ensure that any more "encode" calls leave it in the right state. + // maybe we can just return the raw bytes.. + Encoded(extrinsic) } } diff --git a/subxt/src/metadata.rs b/subxt/src/metadata.rs index 491112919e..e907142ccd 100644 --- a/subxt/src/metadata.rs +++ b/subxt/src/metadata.rs @@ -148,18 +148,22 @@ impl PalletMetadata { &self.name } - /// Encode a call based on this pallet metadata. - pub fn encode_call(&self, call: &C) -> Result + /// Get the index of this pallet. + pub fn index(&self) -> u8 { + self.index + } + + /// Attempt to resolve a call into an index in this pallet, failing + /// if the call is not found in this pallet. + pub fn call_index(&self) -> Result where C: Call, { - let fn_index = self + let fn_index = *self .calls .get(C::FUNCTION) .ok_or(MetadataError::CallNotFound(C::FUNCTION))?; - let mut bytes = vec![self.index, *fn_index]; - bytes.extend(call.encode()); - Ok(Encoded(bytes)) + Ok(fn_index) } /// Return [`StorageEntryMetadata`] given some storage key. From 7c6c690f47ac5bcc5a8149f8094e7dd889a14a5a Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 21 Mar 2022 15:35:07 +0000 Subject: [PATCH 02/13] First pass done; now to get things compiling again --- subxt/src/client.rs | 87 ++++++++--------------------------- subxt/src/config.rs | 3 +- subxt/src/extrinsic/extra.rs | 85 ++++++++++++++++++++++++++++++++++ subxt/src/extrinsic/mod.rs | 61 +----------------------- subxt/src/extrinsic/signer.rs | 49 ++++---------------- subxt/src/lib.rs | 5 +- 6 files changed, 120 insertions(+), 170 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index 2fdadbae2f..48b91f005c 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -23,18 +23,16 @@ use crate::{ BasicError, HasModuleError, }, - extrinsic::{ - self, - SignedExtra, - Signer, - UncheckedExtrinsic, - }, rpc::{ Rpc, RpcClient, RuntimeVersion, SystemProperties, }, + extrinsic::{ + Signer, + ExtrinsicParams, + }, storage::StorageClient, transaction::TransactionProgress, Call, @@ -42,7 +40,7 @@ use crate::{ Encoded, Metadata, }; -use codec::Decode; +use codec::{Compact, Decode, Encode}; use derivative::Derivative; use std::sync::Arc; @@ -189,7 +187,7 @@ pub struct SubmittableExtrinsic<'client, T: Config, X, C, E: Decode, Evs: Decode impl<'client, T, X, C, E, Evs> SubmittableExtrinsic<'client, T, X, C, E, Evs> where T: Config, - X: SignedExtra, + X: ExtrinsicParams, C: Call + Send + Sync, E: Decode + HasModuleError, Evs: Decode, @@ -209,12 +207,8 @@ where /// and obtain details about it, once it has made it into a block. pub async fn sign_and_submit_then_watch( self, - signer: &(dyn Signer + Send + Sync), - ) -> Result, BasicError> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, - { + signer: &(dyn Signer + Send + Sync), + ) -> Result, BasicError> { // Sign the call data to create our extrinsic. let extrinsic = self.create_signed(signer, Default::default()).await?; @@ -237,57 +231,17 @@ where /// and has been included in the transaction pool. pub async fn sign_and_submit( self, - signer: &(dyn Signer + Send + Sync), - ) -> Result - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, - { + signer: &(dyn Signer + Send + Sync), + ) -> Result { let extrinsic = self.create_signed(signer, Default::default()).await?; self.client.rpc().submit_extrinsic(extrinsic).await } - // /// Creates a signed extrinsic. - // pub async fn create_signed( - // &self, - // signer: &(dyn Signer + Send + Sync), - // additional_params: X::Parameters, - // ) -> Result, BasicError> - // where - // <>::Extra as SignedExtension>::AdditionalSigned: - // Send + Sync + 'static, - // { - // let account_nonce = if let Some(nonce) = signer.nonce() { - // nonce - // } else { - // self.client - // .rpc() - // .system_account_next_index(signer.account_id()) - // .await? - // }; - // let call = self - // .client - // .metadata() - // .pallet(C::PALLET) - // .and_then(|pallet| pallet.encode_call(&self.call))?; - - // let signed = extrinsic::create_signed( - // &self.client.runtime_version, - // self.client.genesis_hash, - // account_nonce, - // call, - // signer, - // additional_params, - // ) - // .await?; - // Ok(signed) - // } - /// Creates a signed extrinsic. pub async fn create_signed( &self, - signer: &(dyn Signer + Send + Sync), - additional_params: X::Parameters, + signer: &(dyn Signer + Send + Sync), + additional_params: X::OtherParams, ) -> Result { // 1. get nonce let account_nonce = if let Some(nonce) = signer.nonce() { @@ -329,33 +283,30 @@ where encoded }; - // 5. Create signature from this. - let signature_bytes: Vec = signer.sign(&payload_to_be_signed); - - // 6. Encode extrinsic, now that we have the parts we need. + // 5. Encode extrinsic, now that we have the parts we need. // (this may not be 100% correct but should be close enough for this example) let extrinsic = { let mut encoded_inner = Vec::new(); // "is signed" + transaction protocol version (4) - (b10000000 + 4u8).encode_to(&mut encoded_inner); + (0b10000000 + 4u8).encode_to(&mut encoded_inner); // from address for signature signer.account_id().encode_to(&mut encoded_inner); // the signature bytes - signature_bytes.encode_to(&mut encoded_inner); + signer.encode_signature_to(&payload_to_be_signed, &mut encoded_inner); // attach custom extra params additional_and_extra_params.encode_extra_to(&mut encoded_inner); // and now, call data - encoded_inner.extend(&mut call_data); + encoded_inner.extend(call_data); // now, prefix byte length: - let len = Compact(encoded_inner.len()); + let len = Compact(encoded_inner.len() as u64); let mut encoded = Vec::new(); len.encode_to(&mut encoded); - encoded.extend(&mut encoded_inner); + encoded.extend(encoded_inner); encoded }; // Wrap in Encoded to ensure that any more "encode" calls leave it in the right state. // maybe we can just return the raw bytes.. - Encoded(extrinsic) + Ok(Encoded(extrinsic)) } } diff --git a/subxt/src/config.rs b/subxt/src/config.rs index 0069a747d7..d3ab09c42d 100644 --- a/subxt/src/config.rs +++ b/subxt/src/config.rs @@ -43,7 +43,8 @@ pub trait Config: 'static { + Default + AtLeast32Bit + Copy - + scale_info::TypeInfo; + + scale_info::TypeInfo + + Into; /// The block number type used by the runtime. type BlockNumber: Parameter diff --git a/subxt/src/extrinsic/extra.rs b/subxt/src/extrinsic/extra.rs index 7a456e4a5c..c6206935e7 100644 --- a/subxt/src/extrinsic/extra.rs +++ b/subxt/src/extrinsic/extra.rs @@ -29,9 +29,93 @@ use sp_runtime::{ }, transaction_validity::TransactionValidityError, }; +use codec::Compact; use crate::Config; +pub trait ExtrinsicParams { + type OtherParams: Default; + + fn new( + spec_version: u32, + tx_version: u32, + nonce: T::Index, + genesis_hash: T::Hash, + other_params: Self::OtherParams, + ) -> Self; + + fn encode_extra_to(&self, v: &mut Vec); + fn encode_additional_to(&self, v: &mut Vec); +} + +pub struct DefaultExtra { + era: Era, + nonce: T::Index, + tip: u128, + spec_version: u32, + transaction_version: u32, + genesis_hash: T::Hash, + mortality_checkpoint: T::Hash, + marker: std::marker::PhantomData +} + +pub struct DefaultExtraBuilder { + era: Era, + mortality_checkpoint: Option, + tip: u128, +} + +impl Default for DefaultExtraBuilder { + fn default() -> Self { + Self { + era: Era::Immortal, + mortality_checkpoint: None, + tip: 0 + } + } +} + +impl ExtrinsicParams for DefaultExtra { + // This is how we can pass values at runtime: + type OtherParams = DefaultExtraBuilder; + + fn new( + // Provided from subxt client: + spec_version: u32, + transaction_version: u32, + nonce: T::Index, + genesis_hash: T::Hash, + // Provided externally: + other_params: Self::OtherParams, + ) -> Self { + DefaultExtra { + era: other_params.era, + mortality_checkpoint: other_params.mortality_checkpoint.unwrap_or(genesis_hash), + tip: other_params.tip, + nonce, + spec_version, + transaction_version, + genesis_hash, + marker: std::marker::PhantomData, + } + } + + // And this is how we turn the params into our extra/additional SCALE + // bytes as needed for extrinsic construction: + fn encode_extra_to(&self, v: &mut Vec) { + let nonce: u64 = self.nonce.into(); + (self.era, Compact(nonce), Compact(self.tip)).encode_to(v); + } + fn encode_additional_to(&self, v: &mut Vec) { + ( + self.spec_version, + self.transaction_version, + self.genesis_hash, + self.mortality_checkpoint + ).encode_to(v); + } +} +/* /// Extra type. // pub type Extra = <::Extra as SignedExtra>::Extra; @@ -479,3 +563,4 @@ where /// /// Note that this must match the `SignedExtra` type in the target runtime's extrinsic definition. pub type DefaultExtra = DefaultExtraWithTxPayment>; +*/ \ No newline at end of file diff --git a/subxt/src/extrinsic/mod.rs b/subxt/src/extrinsic/mod.rs index d87d491f2f..932d98e409 100644 --- a/subxt/src/extrinsic/mod.rs +++ b/subxt/src/extrinsic/mod.rs @@ -21,69 +21,12 @@ mod signer; pub use self::{ extra::{ - ChargeAssetTxPayment, - ChargeTransactionPayment, - CheckGenesis, - CheckMortality, - CheckNonce, - CheckSpecVersion, - CheckTxVersion, - CheckWeight, + ExtrinsicParams, DefaultExtra, - DefaultExtraWithTxPayment, - SignedExtra, + DefaultExtraBuilder, }, signer::{ PairSigner, Signer, }, }; - -use sp_runtime::traits::SignedExtension; - -use crate::{ - error::BasicError, - rpc::RuntimeVersion, - Config, - Encoded, -}; - -/// UncheckedExtrinsic type. -pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic< - ::Address, - Encoded, - ::Signature, - >::Extra, ->; - -/// SignedPayload type. -pub type SignedPayload = - sp_runtime::generic::SignedPayload>::Extra>; - -/// Creates a signed extrinsic -pub async fn create_signed( - runtime_version: &RuntimeVersion, - genesis_hash: T::Hash, - nonce: T::Index, - call: Encoded, - signer: &(dyn Signer + Send + Sync), - additional_params: X::Parameters, -) -> Result, BasicError> -where - T: Config, - X: SignedExtra, - ::AdditionalSigned: Send + Sync, -{ - let spec_version = runtime_version.spec_version; - let tx_version = runtime_version.transaction_version; - let extra = X::new( - spec_version, - tx_version, - nonce, - genesis_hash, - additional_params, - ); - let payload = SignedPayload::::new(call, extra.extra())?; - let signed = signer.sign(payload).await?; - Ok(signed) -} diff --git a/subxt/src/extrinsic/signer.rs b/subxt/src/extrinsic/signer.rs index 65f5fef0f1..c60b2a3865 100644 --- a/subxt/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -17,23 +17,15 @@ //! A library to **sub**mit e**xt**rinsics to a //! [substrate](https://github.com/paritytech/substrate) node via RPC. -use super::{ - SignedExtra, - SignedPayload, - UncheckedExtrinsic, -}; use crate::Config; use codec::Encode; use sp_core::Pair; use sp_runtime::traits::{ IdentifyAccount, - SignedExtension, Verify, }; -/// Extrinsic signer. -#[async_trait::async_trait] -pub trait Signer> { +pub trait Signer { /// Returns the account id. fn account_id(&self) -> &T::AccountId; @@ -44,29 +36,23 @@ pub trait Signer> { /// /// Some signers may fail, for instance because the hardware on which the keys are located has /// refused the operation. - async fn sign( - &self, - extrinsic: SignedPayload, - ) -> Result, String>; + fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec); } -/// Extrinsic signer using a private key. #[derive(Clone, Debug)] -pub struct PairSigner { +pub struct PairSigner { account_id: T::AccountId, nonce: Option, signer: P, - marker: std::marker::PhantomData, } -impl PairSigner +impl PairSigner where T: Config, - E: SignedExtra, T::Signature: From, ::Signer: From + IdentifyAccount, - P: Pair, + P: sp_core::Pair, { /// Creates a new `Signer` from a `Pair`. pub fn new(signer: P) -> Self { @@ -76,7 +62,6 @@ where account_id, nonce: None, signer, - marker: Default::default(), } } @@ -96,14 +81,10 @@ where } } -#[async_trait::async_trait] -impl Signer for PairSigner +impl Signer for PairSigner where T: Config, - E: SignedExtra, T::AccountId: Into + 'static, - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, P: Pair + 'static, P::Signature: Into + 'static, { @@ -115,18 +96,8 @@ where self.nonce } - async fn sign( - &self, - extrinsic: SignedPayload, - ) -> Result, String> { - let signature = extrinsic.using_encoded(|payload| self.signer.sign(payload)); - let (call, extra, _) = extrinsic.deconstruct(); - let extrinsic = UncheckedExtrinsic::::new_signed( - call, - self.account_id.clone().into(), - signature.into(), - extra, - ); - Ok(extrinsic) + fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec) { + let signature: T::Signature = self.signer.sign(signer_payload).into(); + signature.encode_to(out); } -} +} \ No newline at end of file diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index dc4e1e2723..dd2f245f8c 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -91,11 +91,10 @@ pub use crate::{ }, extrinsic::{ DefaultExtra, - DefaultExtraWithTxPayment, + DefaultExtraBuilder, + ExtrinsicParams, PairSigner, - SignedExtra, Signer, - UncheckedExtrinsic, }, metadata::{ ErrorMetadata, From 7cc2b5f5d1336c3ec64a1a24eeaf24562c8b0f7b Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 21 Mar 2022 17:43:03 +0000 Subject: [PATCH 03/13] document and tweak new structs/traits --- subxt/src/client.rs | 59 +++- subxt/src/extrinsic/extra.rs | 517 ++++------------------------------ subxt/src/extrinsic/mod.rs | 2 +- subxt/src/extrinsic/signer.rs | 17 +- subxt/src/lib.rs | 2 +- subxt/src/metadata.rs | 1 - 6 files changed, 117 insertions(+), 481 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index 48b91f005c..7e0791adc7 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -201,6 +201,20 @@ where } } + /// Creates and signs an extrinsic and submits it to the chain. Passes default parameters + /// to construct the "signed extra" and "additional" payloads needed by the extrinsic. + /// + /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction + /// and obtain details about it, once it has made it into a block. + pub async fn sign_and_submit_then_watch_default( + self, + signer: &(dyn Signer + Send + Sync), + ) -> Result, BasicError> + where X::OtherParams: Default + { + self.sign_and_submit_then_watch(signer, Default::default()).await + } + /// Creates and signs an extrinsic and submits it to the chain. /// /// Returns a [`TransactionProgress`], which can be used to track the status of the transaction @@ -208,9 +222,12 @@ where pub async fn sign_and_submit_then_watch( self, signer: &(dyn Signer + Send + Sync), - ) -> Result, BasicError> { + other_params: X::OtherParams, + ) -> Result, BasicError> + where X::OtherParams: Default + { // Sign the call data to create our extrinsic. - let extrinsic = self.create_signed(signer, Default::default()).await?; + let extrinsic = self.create_signed(signer, other_params).await?; // Get a hash of the extrinsic (we'll need this later). let ext_hash = T::Hashing::hash_of(&extrinsic); @@ -221,6 +238,25 @@ where Ok(TransactionProgress::new(sub, self.client, ext_hash)) } + /// Creates and signs an extrinsic and submits to the chain for block inclusion. Passes + /// default parameters to construct the "signed extra" and "additional" payloads needed + /// by the extrinsic. + /// + /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. + /// + /// # Note + /// + /// Success does not mean the extrinsic has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn sign_and_submit_default( + self, + signer: &(dyn Signer + Send + Sync), + ) -> Result + where X::OtherParams: Default + { + self.sign_and_submit(signer, Default::default()).await + } + /// Creates and signs an extrinsic and submits to the chain for block inclusion. /// /// Returns `Ok` with the extrinsic hash if it is valid extrinsic. @@ -232,16 +268,19 @@ where pub async fn sign_and_submit( self, signer: &(dyn Signer + Send + Sync), - ) -> Result { - let extrinsic = self.create_signed(signer, Default::default()).await?; + other_params: X::OtherParams, + ) -> Result + where X::OtherParams: Default + { + let extrinsic = self.create_signed(signer, other_params).await?; self.client.rpc().submit_extrinsic(extrinsic).await } - /// Creates a signed extrinsic. + /// Creates a returns a raw signed extrinsic, without submitting it. pub async fn create_signed( &self, signer: &(dyn Signer + Send + Sync), - additional_params: X::OtherParams, + other_params: X::OtherParams, ) -> Result { // 1. get nonce let account_nonce = if let Some(nonce) = signer.nonce() { @@ -272,7 +311,7 @@ where self.client.runtime_version.transaction_version, account_nonce, self.client.genesis_hash, - additional_params, + other_params, ); // 4. construct payload to be signed @@ -280,7 +319,11 @@ where let mut encoded = call_data.clone(); additional_and_extra_params.encode_extra_to(&mut encoded); additional_and_extra_params.encode_additional_to(&mut encoded); - encoded + if encoded.len() > 256 { + sp_core::blake2_256(&encoded).to_vec() + } else { + encoded + } }; // 5. Encode extrinsic, now that we have the parts we need. diff --git a/subxt/src/extrinsic/extra.rs b/subxt/src/extrinsic/extra.rs index c6206935e7..ce7e1d7287 100644 --- a/subxt/src/extrinsic/extra.rs +++ b/subxt/src/extrinsic/extra.rs @@ -14,28 +14,27 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -use crate::PhantomDataSendSync; use codec::{ - Decode, Encode, }; -use derivative::Derivative; -use scale_info::TypeInfo; use sp_runtime::{ generic::Era, - traits::{ - DispatchInfoOf, - SignedExtension, - }, - transaction_validity::TransactionValidityError, }; use codec::Compact; use crate::Config; +/// This trait allows you to configure the "signed extra" and +/// "additional" parameters that are signed and used in transactions. +/// see [`DefaultExtra`] for an implementation that is compatible with +/// a Polkadot node. pub trait ExtrinsicParams { - type OtherParams: Default; + /// Thexe parameters can be provided to the constructor along with + /// some default parameters that `subxt` understands, in order to + /// help construct your [`ExtrinsicParams`] object. + type OtherParams; + /// Construct a new instance of our [`ExtrinsicParams`] fn new( spec_version: u32, tx_version: u32, @@ -44,10 +43,25 @@ pub trait ExtrinsicParams { other_params: Self::OtherParams, ) -> Self; + /// This is expected to SCALE encode the "signed extra" parameters + /// to some buffer that has been provided. These are the parameters + /// which are sent along with the transaction, as well as taken into + /// account when signing the transaction. fn encode_extra_to(&self, v: &mut Vec); + + /// This is expected to SCALE encode the "additional" parameters + /// to some buffer that has been provided. These parameters are _not_ + /// sent along with the transaction, but are taken into account when + /// signing it, meaning the client and node must agree on their values. fn encode_additional_to(&self, v: &mut Vec); } +/// An implementation of [`ExtrinsicParams`] that is suitable for constructing +/// extrinsics that can be sent to a node with the same signed extra and additional +/// parameters as a Polkadot node. If your node differs in the "signed extra" and +/// "additional" parameters expected to be sent/signed with a transaction, then you'll +/// need to define your own struct which implements [`ExtrinsicParams`] and provides +/// back the custom extra and additional parameters you require. pub struct DefaultExtra { era: Era, nonce: T::Index, @@ -59,13 +73,37 @@ pub struct DefaultExtra { marker: std::marker::PhantomData } -pub struct DefaultExtraBuilder { +/// The set of parameters which can be provided in order to customise our [`DefaultExtra`] +/// values. These implement [`Default`] so that [`DefaultExtra`] can be used with +/// convenience methods like [`crate::Client::sign_and_submit_default`]. +pub struct DefaultExtraParams { era: Era, mortality_checkpoint: Option, tip: u128, } -impl Default for DefaultExtraBuilder { +impl DefaultExtraParams { + /// Instantiate the default set of [`DefaultExtraParams`] + pub fn new() -> Self { + Self::default() + } + + /// Set the [`Era`] and era checkpoint. + pub fn era(mut self, era: Era, checkpoint: T::Hash) -> Self { + self.era = era; + self.mortality_checkpoint = Some(checkpoint); + self + } + + /// Set the tip you'd like to give to the block author + /// for this transaction. + pub fn tip>(mut self, tip: Tip) -> Self { + self.tip = tip.into(); + self + } +} + +impl Default for DefaultExtraParams { fn default() -> Self { Self { era: Era::Immortal, @@ -76,8 +114,7 @@ impl Default for DefaultExtraBuilder { } impl ExtrinsicParams for DefaultExtra { - // This is how we can pass values at runtime: - type OtherParams = DefaultExtraBuilder; + type OtherParams = DefaultExtraParams; fn new( // Provided from subxt client: @@ -100,12 +137,11 @@ impl ExtrinsicParams for DefaultExtra { } } - // And this is how we turn the params into our extra/additional SCALE - // bytes as needed for extrinsic construction: fn encode_extra_to(&self, v: &mut Vec) { let nonce: u64 = self.nonce.into(); (self.era, Compact(nonce), Compact(self.tip)).encode_to(v); } + fn encode_additional_to(&self, v: &mut Vec) { ( self.spec_version, @@ -115,452 +151,3 @@ impl ExtrinsicParams for DefaultExtra { ).encode_to(v); } } -/* -/// Extra type. -// pub type Extra = <::Extra as SignedExtra>::Extra; - -/// SignedExtra checks copied from substrate, in order to remove requirement to implement -/// substrate's `frame_system::Trait` - -/// Ensure the runtime version registered in the transaction is the same as at present. -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the version, which is -/// returned via `additional_signed()`. - -/// Ensure the runtime version registered in the transaction is the same as at present. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct CheckSpecVersion( - pub PhantomDataSendSync, - /// Local version to be used for `AdditionalSigned` - #[codec(skip)] - pub u32, -); - -impl SignedExtension for CheckSpecVersion { - const IDENTIFIER: &'static str = "CheckSpecVersion"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = u32; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Ensure the transaction version registered in the transaction is the same as at present. -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the version, which is -/// returned via `additional_signed()`. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct CheckTxVersion( - pub PhantomDataSendSync, - /// Local version to be used for `AdditionalSigned` - #[codec(skip)] - pub u32, -); - -impl SignedExtension for CheckTxVersion { - const IDENTIFIER: &'static str = "CheckTxVersion"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = u32; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Check genesis hash -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the genesis hash, which is -/// returned via `additional_signed()`. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct CheckGenesis( - pub PhantomDataSendSync, - /// Local genesis hash to be used for `AdditionalSigned` - #[codec(skip)] - pub T::Hash, -); - -impl SignedExtension for CheckGenesis { - const IDENTIFIER: &'static str = "CheckGenesis"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = T::Hash; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Check for transaction mortality. -/// -/// # Note -/// -/// This is modified from the substrate version to allow passing in of the genesis hash, which is -/// returned via `additional_signed()`. It assumes therefore `Era::Immortal` (The transaction is -/// valid forever) -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct CheckMortality( - /// The default structure for the Extra encoding - pub (Era, PhantomDataSendSync), - /// Local genesis hash to be used for `AdditionalSigned` - #[codec(skip)] - pub T::Hash, -); - -impl SignedExtension for CheckMortality { - const IDENTIFIER: &'static str = "CheckMortality"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = T::Hash; - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(self.1) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Nonce check and increment to give replay protection for transactions. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct CheckNonce(#[codec(compact)] pub T::Index); - -impl SignedExtension for CheckNonce { - const IDENTIFIER: &'static str = "CheckNonce"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Resource limit check. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct CheckWeight(pub PhantomDataSendSync); - -impl SignedExtension for CheckWeight { - const IDENTIFIER: &'static str = "CheckWeight"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Require the transactor pay for themselves and maybe include a tip to gain additional priority -/// in the queue. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = ""), - Default(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct ChargeTransactionPayment( - #[codec(compact)] u128, - pub PhantomDataSendSync, -); - -impl SignedExtension for ChargeTransactionPayment { - const IDENTIFIER: &'static str = "ChargeTransactionPayment"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Require the transactor pay for themselves and maybe include a tip to gain additional priority -/// in the queue. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = ""), - Default(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct ChargeAssetTxPayment { - /// The tip for the block author. - #[codec(compact)] - pub tip: u128, - /// The asset with which to pay the tip. - pub asset_id: Option, - /// Marker for unused type parameter. - pub marker: PhantomDataSendSync, -} - -impl SignedExtension for ChargeAssetTxPayment { - const IDENTIFIER: &'static str = "ChargeAssetTxPayment"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = (); - type Pre = (); - fn additional_signed( - &self, - ) -> Result { - Ok(()) - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// Trait for implementing transaction extras for a runtime. -pub trait SignedExtra: SignedExtension { - /// The type the extras. - type Extra: SignedExtension + Send + Sync; - /// The additional config parameters. - type Parameters: Default + Send + Sync; - - /// Creates a new `SignedExtra`. - fn new( - spec_version: u32, - tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, - additional_params: Self::Parameters, - ) -> Self; - - /// Returns the transaction extra. - fn extra(&self) -> Self::Extra; -} - -/// Default `SignedExtra` for substrate runtimes. -#[derive(Derivative, Encode, Decode, TypeInfo)] -#[derivative( - Clone(bound = ""), - PartialEq(bound = ""), - Debug(bound = ""), - Eq(bound = "") -)] -#[scale_info(skip_type_params(T))] -pub struct DefaultExtraWithTxPayment { - spec_version: u32, - tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, - marker: PhantomDataSendSync, -} - -impl SignedExtra for DefaultExtraWithTxPayment -where - T: Config, - X: SignedExtension + Default, -{ - type Extra = ( - CheckSpecVersion, - CheckTxVersion, - CheckGenesis, - CheckMortality, - CheckNonce, - CheckWeight, - X, - ); - type Parameters = (); - - fn new( - spec_version: u32, - tx_version: u32, - nonce: T::Index, - genesis_hash: T::Hash, - _params: Self::Parameters, - ) -> Self { - DefaultExtraWithTxPayment { - spec_version, - tx_version, - nonce, - genesis_hash, - marker: PhantomDataSendSync::new(), - } - } - - fn extra(&self) -> Self::Extra { - ( - CheckSpecVersion(PhantomDataSendSync::new(), self.spec_version), - CheckTxVersion(PhantomDataSendSync::new(), self.tx_version), - CheckGenesis(PhantomDataSendSync::new(), self.genesis_hash), - CheckMortality( - (Era::Immortal, PhantomDataSendSync::new()), - self.genesis_hash, - ), - CheckNonce(self.nonce), - CheckWeight(PhantomDataSendSync::new()), - X::default(), - ) - } -} - -impl + Default> SignedExtension - for DefaultExtraWithTxPayment -where - T: Config, - X: SignedExtension, -{ - const IDENTIFIER: &'static str = "DefaultExtra"; - type AccountId = T::AccountId; - type Call = (); - type AdditionalSigned = - <>::Extra as SignedExtension>::AdditionalSigned; - type Pre = (); - - fn additional_signed( - &self, - ) -> Result { - self.extra().additional_signed() - } - fn pre_dispatch( - self, - _who: &Self::AccountId, - _call: &Self::Call, - _info: &DispatchInfoOf, - _len: usize, - ) -> Result { - Ok(()) - } -} - -/// A default `SignedExtra` configuration, with [`ChargeTransactionPayment`] for tipping. -/// -/// Note that this must match the `SignedExtra` type in the target runtime's extrinsic definition. -pub type DefaultExtra = DefaultExtraWithTxPayment>; -*/ \ No newline at end of file diff --git a/subxt/src/extrinsic/mod.rs b/subxt/src/extrinsic/mod.rs index 932d98e409..5f169664bf 100644 --- a/subxt/src/extrinsic/mod.rs +++ b/subxt/src/extrinsic/mod.rs @@ -23,7 +23,7 @@ pub use self::{ extra::{ ExtrinsicParams, DefaultExtra, - DefaultExtraBuilder, + DefaultExtraParams, }, signer::{ PairSigner, diff --git a/subxt/src/extrinsic/signer.rs b/subxt/src/extrinsic/signer.rs index c60b2a3865..5b30a39491 100644 --- a/subxt/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -25,6 +25,10 @@ use sp_runtime::traits::{ Verify, }; +/// Signing transactions requires a [`Signer`]. This is responsible for +/// providing the "from" account that the transaction is being signed by, +/// as well as actually signing a SCALE encoded payload. Optionally, a +/// signer can also provide the nonce for the transaction to use. pub trait Signer { /// Returns the account id. fn account_id(&self) -> &T::AccountId; @@ -39,8 +43,10 @@ pub trait Signer { fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec); } + +/// A [`Signer`] implementation that can be constructed from an [`Pair`]. #[derive(Clone, Debug)] -pub struct PairSigner { +pub struct PairSigner { account_id: T::AccountId, nonce: Option, signer: P, @@ -52,9 +58,9 @@ where T::Signature: From, ::Signer: From + IdentifyAccount, - P: sp_core::Pair, + P: Pair, { - /// Creates a new `Signer` from a `Pair`. + /// Creates a new [`Signer`] from a [`Pair`]. pub fn new(signer: P) -> Self { let account_id = ::Signer::from(signer.public()).into_account(); @@ -65,7 +71,8 @@ where } } - /// Sets the nonce to a new value. + /// Sets the nonce to a new value. By default, the nonce will + /// be retrieved from the node. Setting one here will override that. pub fn set_nonce(&mut self, nonce: T::Index) { self.nonce = Some(nonce); } @@ -75,7 +82,7 @@ where self.nonce = self.nonce.map(|nonce| nonce + 1u32.into()); } - /// Returns the signer. + /// Returns the [`Pair`] implementation used to construct this. pub fn signer(&self) -> &P { &self.signer } diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index dd2f245f8c..b1fb56c2de 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -91,7 +91,7 @@ pub use crate::{ }, extrinsic::{ DefaultExtra, - DefaultExtraBuilder, + DefaultExtraParams, ExtrinsicParams, PairSigner, Signer, diff --git a/subxt/src/metadata.rs b/subxt/src/metadata.rs index e907142ccd..700d3e5bff 100644 --- a/subxt/src/metadata.rs +++ b/subxt/src/metadata.rs @@ -32,7 +32,6 @@ use frame_metadata::{ use crate::{ Call, - Encoded, }; use scale_info::{ form::PortableForm, From 0c13fb97937c62ce0df69fdd109574cc8dbb227d Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 22 Mar 2022 14:15:04 +0000 Subject: [PATCH 04/13] cargo check --all-targets now compiles without issue --- codegen/src/api/calls.rs | 2 +- codegen/src/api/mod.rs | 6 +- examples/examples/balance_transfer.rs | 2 +- examples/examples/custom_config.rs | 2 +- examples/examples/submit_and_watch.rs | 6 +- examples/examples/subscribe_all_events.rs | 2 +- examples/examples/subscribe_one_event.rs | 2 +- examples/examples/subscribe_some_events.rs | 2 +- subxt/tests/integration/codegen/polkadot.rs | 90 ++++++++++----------- subxt/tests/integration/events.rs | 2 +- subxt/tests/integration/frame/balances.rs | 12 +-- subxt/tests/integration/frame/contracts.rs | 12 +-- subxt/tests/integration/frame/staking.rs | 18 ++--- subxt/tests/integration/frame/sudo.rs | 4 +- subxt/tests/integration/frame/system.rs | 2 +- subxt/tests/integration/storage.rs | 6 +- subxt/tests/integration/utils/context.rs | 10 +-- 17 files changed, 89 insertions(+), 91 deletions(-) diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index 4fc531f499..a4515b4c80 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -116,7 +116,7 @@ pub fn generate_calls( impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client, marker: ::core::marker::PhantomData } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index 277983b6cd..f844438800 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -288,7 +288,7 @@ impl RuntimeGenerator { impl ::core::convert::From<::subxt::Client> for RuntimeApi where T: ::subxt::Config, - X: ::subxt::SignedExtra + X: ::subxt::ExtrinsicParams { fn from(client: ::subxt::Client) -> Self { Self { client, marker: ::core::marker::PhantomData } @@ -298,7 +298,7 @@ impl RuntimeGenerator { impl<'a, T, X> RuntimeApi where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn constants(&'a self) -> ConstantsApi { ConstantsApi @@ -368,7 +368,7 @@ impl RuntimeGenerator { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { #( pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T, X> { diff --git a/examples/examples/balance_transfer.rs b/examples/examples/balance_transfer.rs index 50e24dbd5c..bdac8385f9 100644 --- a/examples/examples/balance_transfer.rs +++ b/examples/examples/balance_transfer.rs @@ -48,7 +48,7 @@ async fn main() -> Result<(), Box> { .tx() .balances() .transfer(dest, 10_000) - .sign_and_submit(&signer) + .sign_and_submit_default(&signer) .await?; println!("Balance transfer extrinsic submitted: {}", hash); diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index ad2b9d0a30..472db4e736 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -69,7 +69,7 @@ async fn main() -> Result<(), Box> { .tx() .balances() .transfer(dest, 10_000) - .sign_and_submit(&signer) + .sign_and_submit_default(&signer) .await?; println!("Balance transfer extrinsic submitted: {}", hash); diff --git a/examples/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs index 6ca86a57ad..d8cbf49711 100644 --- a/examples/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -61,7 +61,7 @@ async fn simple_transfer() -> Result<(), Box> { .tx() .balances() .transfer(dest, 10_000) - .sign_and_submit_then_watch(&signer) + .sign_and_submit_then_watch_default(&signer) .await? .wait_for_finalized_success() .await?; @@ -93,7 +93,7 @@ async fn simple_transfer_separate_events() -> Result<(), Box Result<(), Box> { .tx() .balances() .transfer(dest, 10_000) - .sign_and_submit_then_watch(&signer) + .sign_and_submit_then_watch_default(&signer) .await?; while let Some(ev) = balance_transfer_progress.next().await { diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index 6c23cd95aa..c523b80159 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -65,7 +65,7 @@ async fn main() -> Result<(), Box> { api.tx() .balances() .transfer(AccountKeyring::Bob.to_account_id().into(), transfer_amount) - .sign_and_submit(&signer) + .sign_and_submit_default(&signer) .await .unwrap(); diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index b6e6c65519..8ceb24924d 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -69,7 +69,7 @@ async fn main() -> Result<(), Box> { api.tx() .balances() .transfer(AccountKeyring::Bob.to_account_id().into(), 1_000_000_000) - .sign_and_submit(&signer) + .sign_and_submit_default(&signer) .await .unwrap(); async_std::task::sleep(Duration::from_secs(10)).await; diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index f57a67f01f..7161b8f8de 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -70,7 +70,7 @@ async fn main() -> Result<(), Box> { api.tx() .balances() .transfer(AccountKeyring::Bob.to_account_id().into(), 1_000_000_000) - .sign_and_submit(&signer) + .sign_and_submit_default(&signer) .await .unwrap(); async_std::task::sleep(Duration::from_secs(10)).await; diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs index eca60c0583..39a966de28 100644 --- a/subxt/tests/integration/codegen/polkadot.rs +++ b/subxt/tests/integration/codegen/polkadot.rs @@ -170,7 +170,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -951,7 +951,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -1319,7 +1319,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -1561,7 +1561,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -1997,7 +1997,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -2153,7 +2153,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -2436,7 +2436,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -2967,7 +2967,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -3342,7 +3342,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -5162,7 +5162,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -5445,7 +5445,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -5722,7 +5722,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -6177,7 +6177,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -7354,7 +7354,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -7793,7 +7793,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -8221,7 +8221,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -8679,7 +8679,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -8922,7 +8922,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -9306,7 +9306,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -9704,7 +9704,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -9983,7 +9983,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -10280,7 +10280,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -10975,7 +10975,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -11468,7 +11468,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -11881,7 +11881,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -12382,7 +12382,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -12727,7 +12727,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -13224,7 +13224,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14140,7 +14140,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14871,7 +14871,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14970,7 +14970,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -15154,7 +15154,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -15458,7 +15458,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16321,7 +16321,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16400,7 +16400,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16519,7 +16519,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16858,7 +16858,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -17575,7 +17575,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -17896,7 +17896,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -18112,7 +18112,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -18540,7 +18540,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -19066,7 +19066,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -27270,7 +27270,7 @@ pub mod api { impl ::core::convert::From<::subxt::Client> for RuntimeApi where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { fn from(client: ::subxt::Client) -> Self { Self { @@ -27282,7 +27282,7 @@ pub mod api { impl<'a, T, X> RuntimeApi where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn constants(&'a self) -> ConstantsApi { ConstantsApi @@ -27593,7 +27593,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::SignedExtra, + X: ::subxt::ExtrinsicParams, { pub fn system(&self) -> system::calls::TransactionApi<'a, T, X> { system::calls::TransactionApi::new(self.client) diff --git a/subxt/tests/integration/events.rs b/subxt/tests/integration/events.rs index 44f00845e6..8fa6ae5bdb 100644 --- a/subxt/tests/integration/events.rs +++ b/subxt/tests/integration/events.rs @@ -118,7 +118,7 @@ async fn balance_transfer_subscription() -> Result<(), subxt::BasicError> { .tx() .balances() .transfer(bob.clone().into(), 10_000) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await?; // Wait for the next balance transfer event in our subscription stream diff --git a/subxt/tests/integration/frame/balances.rs b/subxt/tests/integration/frame/balances.rs index 01e4fdd1a4..b67333d6bc 100644 --- a/subxt/tests/integration/frame/balances.rs +++ b/subxt/tests/integration/frame/balances.rs @@ -62,7 +62,7 @@ async fn tx_basic_transfer() -> Result<(), subxt::Error> { .tx() .balances() .transfer(bob_address, 10_000) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await?; @@ -118,7 +118,7 @@ async fn multiple_transfers_work_nonce_incremented( .tx() .balances() .transfer(bob_address.clone(), 10_000) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_in_block() // Don't need to wait for finalization; this is quicker. .await? @@ -163,7 +163,7 @@ async fn storage_balance_lock() -> Result<(), subxt::Error> { 100_000_000_000_000, runtime_types::pallet_staking::RewardDestination::Stash, ) - .sign_and_submit_then_watch(&bob) + .sign_and_submit_then_watch_default(&bob) .await? .wait_for_finalized_success() .await? @@ -203,7 +203,7 @@ async fn transfer_error() { .tx() .balances() .transfer(hans_address, 100_000_000_000_000_000) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await .unwrap() .wait_for_finalized_success() @@ -215,7 +215,7 @@ async fn transfer_error() { .tx() .balances() .transfer(alice_addr, 100_000_000_000_000_000) - .sign_and_submit_then_watch(&hans) + .sign_and_submit_then_watch_default(&hans) .await .unwrap() .wait_for_finalized_success() @@ -242,7 +242,7 @@ async fn transfer_implicit_subscription() { .tx() .balances() .transfer(bob_addr, 10_000) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await .unwrap() .wait_for_finalized_success() diff --git a/subxt/tests/integration/frame/contracts.rs b/subxt/tests/integration/frame/contracts.rs index a62aec0bcd..93b26f240e 100644 --- a/subxt/tests/integration/frame/contracts.rs +++ b/subxt/tests/integration/frame/contracts.rs @@ -28,7 +28,7 @@ use crate::{ DispatchError, }, test_context, - NodeRuntimeSignedExtra, + NodeRuntimeDefaultExtra, TestContext, }; use sp_core::sr25519::Pair; @@ -44,7 +44,7 @@ use subxt::{ struct ContractsTestContext { cxt: TestContext, - signer: PairSigner, + signer: PairSigner, } type Hash = ::Hash; @@ -62,7 +62,7 @@ impl ContractsTestContext { self.cxt.client() } - fn contracts_tx(&self) -> TransactionApi { + fn contracts_tx(&self) -> TransactionApi { self.cxt.api.tx().contracts() } @@ -91,7 +91,7 @@ impl ContractsTestContext { vec![], // data vec![], // salt ) - .sign_and_submit_then_watch(&self.signer) + .sign_and_submit_then_watch_default(&self.signer) .await? .wait_for_finalized_success() .await?; @@ -131,7 +131,7 @@ impl ContractsTestContext { data, salt, ) - .sign_and_submit_then_watch(&self.signer) + .sign_and_submit_then_watch_default(&self.signer) .await? .wait_for_finalized_success() .await?; @@ -162,7 +162,7 @@ impl ContractsTestContext { None, // storage_deposit_limit input_data, ) - .sign_and_submit_then_watch(&self.signer) + .sign_and_submit_then_watch_default(&self.signer) .await?; log::info!("Call result: {:?}", result); diff --git a/subxt/tests/integration/frame/staking.rs b/subxt/tests/integration/frame/staking.rs index ef25b44096..7042a9b7a1 100644 --- a/subxt/tests/integration/frame/staking.rs +++ b/subxt/tests/integration/frame/staking.rs @@ -58,7 +58,7 @@ async fn validate_with_controller_account() { .tx() .staking() .validate(default_validator_prefs()) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await .unwrap() .wait_for_finalized_success() @@ -75,7 +75,7 @@ async fn validate_not_possible_for_stash_account() -> Result<(), Error Result<(), Error Result<(), Error> { .tx() .staking() .nominate(vec![bob_stash.account_id().clone().into()]) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await?; @@ -158,7 +158,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { .tx() .staking() .chill() - .sign_and_submit_then_watch(&alice_stash) + .sign_and_submit_then_watch_default(&alice_stash) .await? .wait_for_finalized_success() .await; @@ -173,7 +173,7 @@ async fn chill_works_for_controller_only() -> Result<(), Error> { .tx() .staking() .chill() - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await? @@ -197,7 +197,7 @@ async fn tx_bond() -> Result<(), Error> { 100_000_000_000_000, RewardDestination::Stash, ) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await; @@ -213,7 +213,7 @@ async fn tx_bond() -> Result<(), Error> { 100_000_000_000_000, RewardDestination::Stash, ) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await; diff --git a/subxt/tests/integration/frame/sudo.rs b/subxt/tests/integration/frame/sudo.rs index 10e85ff649..d9954c0a99 100644 --- a/subxt/tests/integration/frame/sudo.rs +++ b/subxt/tests/integration/frame/sudo.rs @@ -44,7 +44,7 @@ async fn test_sudo() -> Result<(), subxt::Error> { .tx() .sudo() .sudo(call) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await? @@ -70,7 +70,7 @@ async fn test_sudo_unchecked_weight() -> Result<(), subxt::Error> .tx() .sudo() .sudo_unchecked_weight(call, 0) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await? diff --git a/subxt/tests/integration/frame/system.rs b/subxt/tests/integration/frame/system.rs index 7252906d83..a6e8c50c72 100644 --- a/subxt/tests/integration/frame/system.rs +++ b/subxt/tests/integration/frame/system.rs @@ -52,7 +52,7 @@ async fn tx_remark_with_event() -> Result<(), subxt::Error> { .tx() .system() .remark_with_event(b"remarkable".to_vec()) - .sign_and_submit_then_watch(&alice) + .sign_and_submit_then_watch_default(&alice) .await? .wait_for_finalized_success() .await? diff --git a/subxt/tests/integration/storage.rs b/subxt/tests/integration/storage.rs index 38fe9052ac..94776fea20 100644 --- a/subxt/tests/integration/storage.rs +++ b/subxt/tests/integration/storage.rs @@ -49,7 +49,7 @@ async fn storage_map_lookup() -> Result<(), subxt::Error> { .tx() .system() .remark(vec![1, 2, 3, 4, 5]) - .sign_and_submit_then_watch(&signer) + .sign_and_submit_then_watch_default(&signer) .await? .wait_for_finalized_success() .await?; @@ -114,7 +114,7 @@ async fn storage_n_map_storage_lookup() -> Result<(), subxt::Error Result<(), subxt::Error>; +pub type NodeRuntimeDefaultExtra = DefaultExtra; pub async fn test_node_process_with( key: AccountKeyring, @@ -60,7 +58,7 @@ pub async fn test_node_process() -> TestNodeProcess { pub struct TestContext { pub node_proc: TestNodeProcess, - pub api: node_runtime::RuntimeApi, + pub api: node_runtime::RuntimeApi, } impl TestContext { @@ -78,6 +76,6 @@ pub async fn test_context() -> TestContext { pub fn pair_signer( pair: Pair, -) -> PairSigner { +) -> PairSigner { PairSigner::new(pair) } From 5a72227b575228ab3ccf3d1c5c1e82a286414a3d Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 22 Mar 2022 16:47:34 +0000 Subject: [PATCH 05/13] Polkadot and Substrate take different extra params; support both --- README.md | 6 +- examples/examples/balance_transfer.rs | 4 +- examples/examples/custom_config.rs | 4 +- examples/examples/fetch_all_accounts.rs | 4 +- examples/examples/fetch_staking_details.rs | 4 +- examples/examples/rpc_call.rs | 4 +- examples/examples/submit_and_watch.rs | 8 +- examples/examples/subscribe_all_events.rs | 6 +- examples/examples/subscribe_one_event.rs | 6 +- examples/examples/subscribe_some_events.rs | 6 +- subxt/src/client.rs | 27 ++--- subxt/src/extrinsic/mod.rs | 10 +- subxt/src/extrinsic/{extra.rs => params.rs} | 121 ++++++++++++++++---- subxt/src/lib.rs | 6 +- subxt/tests/integration/frame/contracts.rs | 4 +- subxt/tests/integration/utils/context.rs | 6 +- 16 files changed, 156 insertions(+), 70 deletions(-) rename subxt/src/extrinsic/{extra.rs => params.rs} (55%) diff --git a/README.md b/README.md index 4a14617d39..0fe488839e 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,13 @@ resides ([`CARGO_MANIFEST_DIR`](https://doc.rust-lang.org/cargo/reference/enviro ### Initializing the API client ```rust -use subxt::{ClientBuilder, DefaultConfig, DefaultExtra}; +use subxt::{ClientBuilder, DefaultConfig, SubstrateExtrinsicParams}; let api = ClientBuilder::new() .set_url("wss://rpc.polkadot.io:443") .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); ``` The `RuntimeApi` type is generated by the `subxt` macro from the supplied metadata. This can be parameterized with user @@ -53,7 +53,7 @@ chain. ### Querying Storage -Call the generated `RuntimeApi::storage()` method, followed by the `pallet_name()` and then the `storage_item_name()`. +Call the generated `RuntimeApi::storage()` method, followed by the `pallet_name()` and then the `storage_item_name()`. So in order to query `Balances::TotalIssuance`: diff --git a/examples/examples/balance_transfer.rs b/examples/examples/balance_transfer.rs index bdac8385f9..447c47b6ba 100644 --- a/examples/examples/balance_transfer.rs +++ b/examples/examples/balance_transfer.rs @@ -26,7 +26,7 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; @@ -43,7 +43,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let hash = api .tx() .balances() diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index 472db4e736..19036b13c7 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -27,7 +27,7 @@ use subxt::{ ClientBuilder, Config, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; @@ -60,7 +60,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); diff --git a/examples/examples/fetch_all_accounts.rs b/examples/examples/fetch_all_accounts.rs index 46bac8eb5a..ed25b098bf 100644 --- a/examples/examples/fetch_all_accounts.rs +++ b/examples/examples/fetch_all_accounts.rs @@ -25,7 +25,7 @@ use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -38,7 +38,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let mut iter = api.storage().system().account_iter(None).await?; diff --git a/examples/examples/fetch_staking_details.rs b/examples/examples/fetch_staking_details.rs index 017e306548..b487f62247 100644 --- a/examples/examples/fetch_staking_details.rs +++ b/examples/examples/fetch_staking_details.rs @@ -31,7 +31,7 @@ use subxt::{ sp_runtime::AccountId32, ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -44,7 +44,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let era = api.storage().staking().active_era(None).await?.unwrap(); println!( diff --git a/examples/examples/rpc_call.rs b/examples/examples/rpc_call.rs index 71eafd1f34..c168eb5629 100644 --- a/examples/examples/rpc_call.rs +++ b/examples/examples/rpc_call.rs @@ -25,7 +25,7 @@ use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -39,7 +39,7 @@ async fn main() -> Result<(), Box> { .set_url("wss://rpc.polkadot.io:443") .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let block_number = 1u32; diff --git a/examples/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs index d8cbf49711..71d6d6456e 100644 --- a/examples/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -27,7 +27,7 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; @@ -55,7 +55,7 @@ async fn simple_transfer() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() @@ -87,7 +87,7 @@ async fn simple_transfer_separate_events() -> Result<(), Box>>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() @@ -138,7 +138,7 @@ async fn handle_transfer_events() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let mut balance_transfer_progress = api .tx() diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index c523b80159..fe820fdd34 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -28,7 +28,7 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; @@ -44,7 +44,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); // Subscribe to any events that occur: let mut event_sub = api.events().subscribe().await?; @@ -56,7 +56,7 @@ async fn main() -> Result<(), Box> { .build() .await .unwrap() - .to_runtime_api::>>(); + .to_runtime_api::>>(); let mut transfer_amount = 1_000_000_000; diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index 8ceb24924d..5478d03718 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -28,7 +28,7 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; @@ -45,7 +45,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); // 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. @@ -62,7 +62,7 @@ async fn main() -> Result<(), Box> { .build() .await .unwrap() - .to_runtime_api::>>(); + .to_runtime_api::>>(); // Make small balance transfers from Alice to Bob in a loop: loop { diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index 7161b8f8de..2bbd5f8bbd 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -28,7 +28,7 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; @@ -45,7 +45,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); // 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 @@ -63,7 +63,7 @@ async fn main() -> Result<(), Box> { .build() .await .unwrap() - .to_runtime_api::>>(); + .to_runtime_api::>>(); // Make small balance transfers from Alice to Bob in a loop: loop { diff --git a/subxt/src/client.rs b/subxt/src/client.rs index 7e0791adc7..7b5c3a5776 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -293,16 +293,16 @@ where }; // 2. SCALE encode call data to bytes (pallet u8, call u8, call params). - let call_data: Vec = { - let mut encoded = Vec::new(); + let call_data = { + let mut bytes = Vec::new(); let pallet = self .client .metadata() .pallet(C::PALLET)?; - encoded.push(pallet.index()); - encoded.push(pallet.call_index::()?); - self.call.encode_to(&mut encoded); - encoded + bytes.push(pallet.index()); + bytes.push(pallet.call_index::()?); + self.call.encode_to(&mut bytes); + Encoded(bytes) }; // 3. construct our custom additional/extra params. @@ -316,13 +316,14 @@ where // 4. construct payload to be signed let payload_to_be_signed = { - let mut encoded = call_data.clone(); - additional_and_extra_params.encode_extra_to(&mut encoded); - additional_and_extra_params.encode_additional_to(&mut encoded); - if encoded.len() > 256 { - sp_core::blake2_256(&encoded).to_vec() + let mut bytes = Vec::new(); + call_data.encode_to(&mut bytes); + additional_and_extra_params.encode_extra_to(&mut bytes); + additional_and_extra_params.encode_additional_to(&mut bytes); + if bytes.len() > 256 { + sp_core::blake2_256(&bytes).to_vec() } else { - encoded + bytes } }; @@ -339,7 +340,7 @@ where // attach custom extra params additional_and_extra_params.encode_extra_to(&mut encoded_inner); // and now, call data - encoded_inner.extend(call_data); + call_data.encode_to(&mut encoded_inner); // now, prefix byte length: let len = Compact(encoded_inner.len() as u64); let mut encoded = Vec::new(); diff --git a/subxt/src/extrinsic/mod.rs b/subxt/src/extrinsic/mod.rs index 5f169664bf..231a5e250a 100644 --- a/subxt/src/extrinsic/mod.rs +++ b/subxt/src/extrinsic/mod.rs @@ -16,14 +16,16 @@ //! Create signed or unsigned extrinsics. -mod extra; +mod params; mod signer; pub use self::{ - extra::{ + params::{ ExtrinsicParams, - DefaultExtra, - DefaultExtraParams, + PolkadotExtrinsicParams, + PolkadotExtrinsicParamsBuilder, + SubstrateExtrinsicParams, + SubstrateExtrinsicParamsBuilder, }, signer::{ PairSigner, diff --git a/subxt/src/extrinsic/extra.rs b/subxt/src/extrinsic/params.rs similarity index 55% rename from subxt/src/extrinsic/extra.rs rename to subxt/src/extrinsic/params.rs index ce7e1d7287..9fb1c3c848 100644 --- a/subxt/src/extrinsic/extra.rs +++ b/subxt/src/extrinsic/params.rs @@ -22,11 +22,14 @@ use sp_runtime::{ }; use codec::Compact; -use crate::Config; +use crate::{ + Config, + Encoded, +}; /// This trait allows you to configure the "signed extra" and /// "additional" parameters that are signed and used in transactions. -/// see [`DefaultExtra`] for an implementation that is compatible with +/// see [`BaseExtrinsicParams`] for an implementation that is compatible with /// a Polkadot node. pub trait ExtrinsicParams { /// Thexe parameters can be provided to the constructor along with @@ -56,16 +59,91 @@ pub trait ExtrinsicParams { fn encode_additional_to(&self, v: &mut Vec); } +/// A struct representing the signed extra and additional parameters required +/// to construct a transaction for the default substrate node. +pub type SubstrateExtrinsicParams = BaseExtrinsicParams; + +/// A builder which leads to [`SubstrateExtrinsicParams`] being constructed. +/// This is what you provide to methods like [`crate::Client::sign_and_submit`]. +pub type SubstrateExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder; + +/// A struct representing the signed extra and additional parameters required +/// to construct a transaction for a polkadot node. +pub type PolkadotExtrinsicParams = BaseExtrinsicParams; + +/// A builder which leads to [`PolkadotExtrinsicParams`] being constructed. +/// This is what you provide to methods like [`crate::Client::sign_and_submit`]. +pub type PolkadotExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder; + +/// A plain tip payment. +#[derive(Copy, Clone, Encode)] +pub struct PlainTip { + tip: Compact +} + +impl PlainTip { + /// Create a new tip of the amount provided. + pub fn new(amount: u128) -> Self { + PlainTip { + tip: Compact(amount) + } + } +} + +impl Default for PlainTip { + fn default() -> Self { + PlainTip { + tip: Compact(0), + } + } +} + +/// A tip payment made in the form of a specific asset. +#[derive(Copy, Clone, Encode)] +pub struct AssetTip { + tip: Compact, + asset: Option +} + +impl AssetTip { + /// Create a new tip of the amount provided. + pub fn new(amount: u128) -> Self { + AssetTip { + tip: Compact(amount), + asset: None + } + } + + /// Designate the tip as being of a particular asset class. + pub fn of_asset(mut self, asset: u32) -> Self { + self.asset = Some(asset); + self + } +} + +impl Default for AssetTip { + fn default() -> Self { + Self { + tip: Compact(0), + asset: None + } + } +} + /// An implementation of [`ExtrinsicParams`] that is suitable for constructing /// extrinsics that can be sent to a node with the same signed extra and additional -/// parameters as a Polkadot node. If your node differs in the "signed extra" and +/// parameters as a Polkadot/Substrate node. Prefer to use [`SubstrateExtrinsicParams`] +/// for a version of this tailored towards Substrate, or [`PolkadotExtrinsicParams`] +/// for a version tailored to Polkadot. +/// +/// If your node differs in the "signed extra" and /// "additional" parameters expected to be sent/signed with a transaction, then you'll /// need to define your own struct which implements [`ExtrinsicParams`] and provides /// back the custom extra and additional parameters you require. -pub struct DefaultExtra { +pub struct BaseExtrinsicParams { era: Era, nonce: T::Index, - tip: u128, + tip: Tip, spec_version: u32, transaction_version: u32, genesis_hash: T::Hash, @@ -73,17 +151,19 @@ pub struct DefaultExtra { marker: std::marker::PhantomData } -/// The set of parameters which can be provided in order to customise our [`DefaultExtra`] -/// values. These implement [`Default`] so that [`DefaultExtra`] can be used with -/// convenience methods like [`crate::Client::sign_and_submit_default`]. -pub struct DefaultExtraParams { +/// The set of parameters which can be provided in order to customise our [`BaseExtrinsicParams`] +/// values. These implement [`Default`] so that [`BaseExtrinsicParams`] can be used with +/// convenience methods like [`crate::Client::sign_and_submit_default`]. Prefer to use +/// [`SubstrateExtrinsicParamsBuilder`] for a version of this tailored towards Substrate, or +/// [`PolkadotExtrinsicParamsBuilder`] for a version tailored to Polkadot. +pub struct BaseExtrinsicParamsBuilder { era: Era, mortality_checkpoint: Option, - tip: u128, + tip: Tip, } -impl DefaultExtraParams { - /// Instantiate the default set of [`DefaultExtraParams`] +impl BaseExtrinsicParamsBuilder { + /// Instantiate the default set of [`BaseExtrinsicParamsBuilder`] pub fn new() -> Self { Self::default() } @@ -97,24 +177,24 @@ impl DefaultExtraParams { /// Set the tip you'd like to give to the block author /// for this transaction. - pub fn tip>(mut self, tip: Tip) -> Self { - self.tip = tip.into(); + pub fn tip(mut self, tip: Tip) -> Self { + self.tip = tip; self } } -impl Default for DefaultExtraParams { +impl Default for BaseExtrinsicParamsBuilder { fn default() -> Self { Self { era: Era::Immortal, mortality_checkpoint: None, - tip: 0 + tip: Tip::default() } } } -impl ExtrinsicParams for DefaultExtra { - type OtherParams = DefaultExtraParams; +impl ExtrinsicParams for BaseExtrinsicParams { + type OtherParams = BaseExtrinsicParamsBuilder; fn new( // Provided from subxt client: @@ -125,7 +205,7 @@ impl ExtrinsicParams for DefaultExtra { // Provided externally: other_params: Self::OtherParams, ) -> Self { - DefaultExtra { + BaseExtrinsicParams { era: other_params.era, mortality_checkpoint: other_params.mortality_checkpoint.unwrap_or(genesis_hash), tip: other_params.tip, @@ -139,7 +219,8 @@ impl ExtrinsicParams for DefaultExtra { fn encode_extra_to(&self, v: &mut Vec) { let nonce: u64 = self.nonce.into(); - (self.era, Compact(nonce), Compact(self.tip)).encode_to(v); + let tip = Encoded(self.tip.encode()); + (self.era, Compact(nonce), tip).encode_to(v); } fn encode_additional_to(&self, v: &mut Vec) { diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index b1fb56c2de..5179cdd28a 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -90,9 +90,11 @@ pub use crate::{ RawEventDetails, }, extrinsic::{ - DefaultExtra, - DefaultExtraParams, ExtrinsicParams, + SubstrateExtrinsicParams, + SubstrateExtrinsicParamsBuilder, + PolkadotExtrinsicParams, + PolkadotExtrinsicParamsBuilder, PairSigner, Signer, }, diff --git a/subxt/tests/integration/frame/contracts.rs b/subxt/tests/integration/frame/contracts.rs index 93b26f240e..5ec7e6e341 100644 --- a/subxt/tests/integration/frame/contracts.rs +++ b/subxt/tests/integration/frame/contracts.rs @@ -28,7 +28,7 @@ use crate::{ DispatchError, }, test_context, - NodeRuntimeDefaultExtra, + NodeRuntimeParams, TestContext, }; use sp_core::sr25519::Pair; @@ -62,7 +62,7 @@ impl ContractsTestContext { self.cxt.client() } - fn contracts_tx(&self) -> TransactionApi { + fn contracts_tx(&self) -> TransactionApi { self.cxt.api.tx().contracts() } diff --git a/subxt/tests/integration/utils/context.rs b/subxt/tests/integration/utils/context.rs index 2a208aafd2..704a2d1a2c 100644 --- a/subxt/tests/integration/utils/context.rs +++ b/subxt/tests/integration/utils/context.rs @@ -24,14 +24,14 @@ use sp_keyring::AccountKeyring; use subxt::{ Client, DefaultConfig, - DefaultExtra, + SubstrateExtrinsicParams, PairSigner, }; /// substrate node should be installed on the $PATH const SUBSTRATE_NODE_PATH: &str = "substrate"; -pub type NodeRuntimeDefaultExtra = DefaultExtra; +pub type NodeRuntimeParams = SubstrateExtrinsicParams; pub async fn test_node_process_with( key: AccountKeyring, @@ -58,7 +58,7 @@ pub async fn test_node_process() -> TestNodeProcess { pub struct TestContext { pub node_proc: TestNodeProcess, - pub api: node_runtime::RuntimeApi, + pub api: node_runtime::RuntimeApi, } impl TestContext { From 75db75ffdde66c0be2be6d2d85c0727d53158cb4 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Wed, 23 Mar 2022 16:50:42 +0000 Subject: [PATCH 06/13] Fix transaction format (missing byte from AccountId -> Address) and fmt --- examples/examples/balance_transfer.rs | 6 +-- examples/examples/custom_config.rs | 4 +- examples/examples/fetch_all_accounts.rs | 4 +- examples/examples/fetch_staking_details.rs | 4 +- examples/examples/rpc_call.rs | 4 +- examples/examples/submit_and_watch.rs | 8 ++-- examples/examples/subscribe_all_events.rs | 18 +++++---- examples/examples/subscribe_one_event.rs | 18 +++++---- examples/examples/subscribe_some_events.rs | 18 +++++---- subxt/src/client.rs | 36 ++++++++++------- subxt/src/extrinsic/params.rs | 46 +++++++++++----------- subxt/src/extrinsic/signer.rs | 25 +++++++----- subxt/src/lib.rs | 6 +-- subxt/src/metadata.rs | 4 +- subxt/tests/integration/utils/context.rs | 6 +-- 15 files changed, 114 insertions(+), 93 deletions(-) diff --git a/examples/examples/balance_transfer.rs b/examples/examples/balance_transfer.rs index 447c47b6ba..2878c86ff7 100644 --- a/examples/examples/balance_transfer.rs +++ b/examples/examples/balance_transfer.rs @@ -26,8 +26,8 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -43,11 +43,11 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let hash = api .tx() .balances() - .transfer(dest, 10_000) + .transfer(dest, 123_456_789_012_345) .sign_and_submit_default(&signer) .await?; diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index 19036b13c7..fcd81e02a5 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -27,8 +27,8 @@ use subxt::{ ClientBuilder, Config, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -60,7 +60,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let signer = PairSigner::new(AccountKeyring::Alice.pair()); let dest = AccountKeyring::Bob.to_account_id().into(); diff --git a/examples/examples/fetch_all_accounts.rs b/examples/examples/fetch_all_accounts.rs index ed25b098bf..9455244449 100644 --- a/examples/examples/fetch_all_accounts.rs +++ b/examples/examples/fetch_all_accounts.rs @@ -25,7 +25,7 @@ use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -38,7 +38,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let mut iter = api.storage().system().account_iter(None).await?; diff --git a/examples/examples/fetch_staking_details.rs b/examples/examples/fetch_staking_details.rs index b487f62247..02479dc325 100644 --- a/examples/examples/fetch_staking_details.rs +++ b/examples/examples/fetch_staking_details.rs @@ -31,7 +31,7 @@ use subxt::{ sp_runtime::AccountId32, ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -44,7 +44,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let era = api.storage().staking().active_era(None).await?.unwrap(); println!( diff --git a/examples/examples/rpc_call.rs b/examples/examples/rpc_call.rs index c168eb5629..f0fe0eee70 100644 --- a/examples/examples/rpc_call.rs +++ b/examples/examples/rpc_call.rs @@ -25,7 +25,7 @@ use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -39,7 +39,7 @@ async fn main() -> Result<(), Box> { .set_url("wss://rpc.polkadot.io:443") .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let block_number = 1u32; diff --git a/examples/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs index 71d6d6456e..f2539a6cef 100644 --- a/examples/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -27,8 +27,8 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -55,7 +55,7 @@ async fn simple_transfer() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() @@ -87,7 +87,7 @@ async fn simple_transfer_separate_events() -> Result<(), Box>>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() @@ -138,7 +138,7 @@ async fn handle_transfer_events() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let mut balance_transfer_progress = api .tx() diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index fe820fdd34..b6077bd7ea 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -28,8 +28,8 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -44,7 +44,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); // Subscribe to any events that occur: let mut event_sub = api.events().subscribe().await?; @@ -52,11 +52,15 @@ async fn main() -> Result<(), Box> { // While this subscription is active, balance transfers are made somewhere: async_std::task::spawn(async { let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let api = ClientBuilder::new() - .build() - .await - .unwrap() - .to_runtime_api::>>(); + let api = + ClientBuilder::new() + .build() + .await + .unwrap() + .to_runtime_api::, + >>(); let mut transfer_amount = 1_000_000_000; diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index 5478d03718..d3dc3bd162 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -28,8 +28,8 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -45,7 +45,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); // 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. @@ -58,11 +58,15 @@ async fn main() -> Result<(), Box> { // While this subscription is active, we imagine some balance transfers are made somewhere else: async_std::task::spawn(async { let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let api = ClientBuilder::new() - .build() - .await - .unwrap() - .to_runtime_api::>>(); + let api = + ClientBuilder::new() + .build() + .await + .unwrap() + .to_runtime_api::, + >>(); // Make small balance transfers from Alice to Bob in a loop: loop { diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index 2bbd5f8bbd..59e91903c1 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -28,8 +28,8 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -45,7 +45,7 @@ async fn main() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); // 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 @@ -59,11 +59,15 @@ async fn main() -> Result<(), Box> { // While this subscription is active, we imagine some balance transfers are made somewhere else: async_std::task::spawn(async { let signer = PairSigner::new(AccountKeyring::Alice.pair()); - let api = ClientBuilder::new() - .build() - .await - .unwrap() - .to_runtime_api::>>(); + let api = + ClientBuilder::new() + .build() + .await + .unwrap() + .to_runtime_api::, + >>(); // Make small balance transfers from Alice to Bob in a loop: loop { diff --git a/subxt/src/client.rs b/subxt/src/client.rs index 7b5c3a5776..bcaa0920f1 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -23,16 +23,16 @@ use crate::{ BasicError, HasModuleError, }, + extrinsic::{ + ExtrinsicParams, + Signer, + }, rpc::{ Rpc, RpcClient, RuntimeVersion, SystemProperties, }, - extrinsic::{ - Signer, - ExtrinsicParams, - }, storage::StorageClient, transaction::TransactionProgress, Call, @@ -40,7 +40,11 @@ use crate::{ Encoded, Metadata, }; -use codec::{Compact, Decode, Encode}; +use codec::{ + Compact, + Decode, + Encode, +}; use derivative::Derivative; use std::sync::Arc; @@ -210,9 +214,11 @@ where self, signer: &(dyn Signer + Send + Sync), ) -> Result, BasicError> - where X::OtherParams: Default + where + X::OtherParams: Default, { - self.sign_and_submit_then_watch(signer, Default::default()).await + self.sign_and_submit_then_watch(signer, Default::default()) + .await } /// Creates and signs an extrinsic and submits it to the chain. @@ -224,7 +230,8 @@ where signer: &(dyn Signer + Send + Sync), other_params: X::OtherParams, ) -> Result, BasicError> - where X::OtherParams: Default + where + X::OtherParams: Default, { // Sign the call data to create our extrinsic. let extrinsic = self.create_signed(signer, other_params).await?; @@ -252,7 +259,8 @@ where self, signer: &(dyn Signer + Send + Sync), ) -> Result - where X::OtherParams: Default + where + X::OtherParams: Default, { self.sign_and_submit(signer, Default::default()).await } @@ -270,7 +278,8 @@ where signer: &(dyn Signer + Send + Sync), other_params: X::OtherParams, ) -> Result - where X::OtherParams: Default + where + X::OtherParams: Default, { let extrinsic = self.create_signed(signer, other_params).await?; self.client.rpc().submit_extrinsic(extrinsic).await @@ -295,10 +304,7 @@ where // 2. SCALE encode call data to bytes (pallet u8, call u8, call params). let call_data = { let mut bytes = Vec::new(); - let pallet = self - .client - .metadata() - .pallet(C::PALLET)?; + let pallet = self.client.metadata().pallet(C::PALLET)?; bytes.push(pallet.index()); bytes.push(pallet.call_index::()?); self.call.encode_to(&mut bytes); @@ -334,7 +340,7 @@ where // "is signed" + transaction protocol version (4) (0b10000000 + 4u8).encode_to(&mut encoded_inner); // from address for signature - signer.account_id().encode_to(&mut encoded_inner); + signer.encode_address_to(&mut encoded_inner); // the signature bytes signer.encode_signature_to(&payload_to_be_signed, &mut encoded_inner); // attach custom extra params diff --git a/subxt/src/extrinsic/params.rs b/subxt/src/extrinsic/params.rs index 9fb1c3c848..fd3ff82a9a 100644 --- a/subxt/src/extrinsic/params.rs +++ b/subxt/src/extrinsic/params.rs @@ -15,12 +15,10 @@ // along with subxt. If not, see . use codec::{ + Compact, Encode, }; -use sp_runtime::{ - generic::Era, -}; -use codec::Compact; +use sp_runtime::generic::Era; use crate::{ Config, @@ -78,39 +76,38 @@ pub type PolkadotExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder + tip: Compact, } impl PlainTip { /// Create a new tip of the amount provided. pub fn new(amount: u128) -> Self { PlainTip { - tip: Compact(amount) + tip: Compact(amount), } } } impl Default for PlainTip { fn default() -> Self { - PlainTip { - tip: Compact(0), - } + PlainTip { tip: Compact(0) } } } /// A tip payment made in the form of a specific asset. #[derive(Copy, Clone, Encode)] pub struct AssetTip { - tip: Compact, - asset: Option + #[codec(compact)] + tip: u128, + asset: Option, } impl AssetTip { /// Create a new tip of the amount provided. pub fn new(amount: u128) -> Self { AssetTip { - tip: Compact(amount), - asset: None + tip: amount, + asset: None, } } @@ -124,8 +121,8 @@ impl AssetTip { impl Default for AssetTip { fn default() -> Self { Self { - tip: Compact(0), - asset: None + tip: 0, + asset: None, } } } @@ -148,7 +145,7 @@ pub struct BaseExtrinsicParams { transaction_version: u32, genesis_hash: T::Hash, mortality_checkpoint: T::Hash, - marker: std::marker::PhantomData + marker: std::marker::PhantomData, } /// The set of parameters which can be provided in order to customise our [`BaseExtrinsicParams`] @@ -162,7 +159,7 @@ pub struct BaseExtrinsicParamsBuilder { tip: Tip, } -impl BaseExtrinsicParamsBuilder { +impl BaseExtrinsicParamsBuilder { /// Instantiate the default set of [`BaseExtrinsicParamsBuilder`] pub fn new() -> Self { Self::default() @@ -183,17 +180,17 @@ impl BaseExtrinsicParamsBuilder { } } -impl Default for BaseExtrinsicParamsBuilder { +impl Default for BaseExtrinsicParamsBuilder { fn default() -> Self { Self { era: Era::Immortal, mortality_checkpoint: None, - tip: Tip::default() + tip: Tip::default(), } } } -impl ExtrinsicParams for BaseExtrinsicParams { +impl ExtrinsicParams for BaseExtrinsicParams { type OtherParams = BaseExtrinsicParamsBuilder; fn new( @@ -207,7 +204,9 @@ impl ExtrinsicParams for BaseExtrinsicParams ) -> Self { BaseExtrinsicParams { era: other_params.era, - mortality_checkpoint: other_params.mortality_checkpoint.unwrap_or(genesis_hash), + mortality_checkpoint: other_params + .mortality_checkpoint + .unwrap_or(genesis_hash), tip: other_params.tip, nonce, spec_version, @@ -228,7 +227,8 @@ impl ExtrinsicParams for BaseExtrinsicParams self.spec_version, self.transaction_version, self.genesis_hash, - self.mortality_checkpoint - ).encode_to(v); + self.mortality_checkpoint, + ) + .encode_to(v); } } diff --git a/subxt/src/extrinsic/signer.rs b/subxt/src/extrinsic/signer.rs index 5b30a39491..73250b8dbf 100644 --- a/subxt/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -30,20 +30,22 @@ use sp_runtime::traits::{ /// as well as actually signing a SCALE encoded payload. Optionally, a /// signer can also provide the nonce for the transaction to use. pub trait Signer { - /// Returns the account id. - fn account_id(&self) -> &T::AccountId; - /// Optionally returns a nonce. fn nonce(&self) -> Option; - /// Takes an unsigned extrinsic and returns a signed extrinsic. + /// Return the "from" account ID. + fn account_id(&self) -> &T::AccountId; + + /// SCALE encodes the address to some output. + fn encode_address_to(&self, out: &mut Vec); + + /// Takes a signer payload for an extrinsic, and returns a signature based on it. /// /// Some signers may fail, for instance because the hardware on which the keys are located has /// refused the operation. fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec); } - /// A [`Signer`] implementation that can be constructed from an [`Pair`]. #[derive(Clone, Debug)] pub struct PairSigner { @@ -91,20 +93,25 @@ where impl Signer for PairSigner where T: Config, - T::AccountId: Into + 'static, + T::AccountId: Into + Clone + 'static, P: Pair + 'static, P::Signature: Into + 'static, { + fn nonce(&self) -> Option { + self.nonce + } + fn account_id(&self) -> &T::AccountId { &self.account_id } - fn nonce(&self) -> Option { - self.nonce + fn encode_address_to(&self, out: &mut Vec) { + let address: T::Address = self.account_id.clone().into(); + address.encode_to(out); } fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec) { let signature: T::Signature = self.signer.sign(signer_payload).into(); signature.encode_to(out); } -} \ No newline at end of file +} diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index 5179cdd28a..e79c54a8e5 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -91,12 +91,12 @@ pub use crate::{ }, extrinsic::{ ExtrinsicParams, - SubstrateExtrinsicParams, - SubstrateExtrinsicParamsBuilder, + PairSigner, PolkadotExtrinsicParams, PolkadotExtrinsicParamsBuilder, - PairSigner, Signer, + SubstrateExtrinsicParams, + SubstrateExtrinsicParamsBuilder, }, metadata::{ ErrorMetadata, diff --git a/subxt/src/metadata.rs b/subxt/src/metadata.rs index 700d3e5bff..4529c8cff7 100644 --- a/subxt/src/metadata.rs +++ b/subxt/src/metadata.rs @@ -30,9 +30,7 @@ use frame_metadata::{ META_RESERVED, }; -use crate::{ - Call, -}; +use crate::Call; use scale_info::{ form::PortableForm, Type, diff --git a/subxt/tests/integration/utils/context.rs b/subxt/tests/integration/utils/context.rs index 704a2d1a2c..ec261d9523 100644 --- a/subxt/tests/integration/utils/context.rs +++ b/subxt/tests/integration/utils/context.rs @@ -24,8 +24,8 @@ use sp_keyring::AccountKeyring; use subxt::{ Client, DefaultConfig, - SubstrateExtrinsicParams, PairSigner, + SubstrateExtrinsicParams, }; /// substrate node should be installed on the $PATH @@ -74,8 +74,6 @@ pub async fn test_context() -> TestContext { TestContext { node_proc, api } } -pub fn pair_signer( - pair: Pair, -) -> PairSigner { +pub fn pair_signer(pair: Pair) -> PairSigner { PairSigner::new(pair) } From 8c88c41d0a42a42422c3f4c4ff46b46b940b39f3 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 24 Mar 2022 09:40:40 +0000 Subject: [PATCH 07/13] Tweak Signer trait --- subxt/src/client.rs | 6 ++++-- subxt/src/extrinsic/signer.rs | 17 +++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index bcaa0920f1..fb5bd37cdd 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -340,9 +340,11 @@ where // "is signed" + transaction protocol version (4) (0b10000000 + 4u8).encode_to(&mut encoded_inner); // from address for signature - signer.encode_address_to(&mut encoded_inner); + signer.address().encode_to(&mut encoded_inner); // the signature bytes - signer.encode_signature_to(&payload_to_be_signed, &mut encoded_inner); + signer + .sign(&payload_to_be_signed) + .encode_to(&mut encoded_inner); // attach custom extra params additional_and_extra_params.encode_extra_to(&mut encoded_inner); // and now, call data diff --git a/subxt/src/extrinsic/signer.rs b/subxt/src/extrinsic/signer.rs index 73250b8dbf..1119f56037 100644 --- a/subxt/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -18,7 +18,6 @@ //! [substrate](https://github.com/paritytech/substrate) node via RPC. use crate::Config; -use codec::Encode; use sp_core::Pair; use sp_runtime::traits::{ IdentifyAccount, @@ -36,14 +35,14 @@ pub trait Signer { /// Return the "from" account ID. fn account_id(&self) -> &T::AccountId; - /// SCALE encodes the address to some output. - fn encode_address_to(&self, out: &mut Vec); + /// Return the "from" address. + fn address(&self) -> T::Address; /// Takes a signer payload for an extrinsic, and returns a signature based on it. /// /// Some signers may fail, for instance because the hardware on which the keys are located has /// refused the operation. - fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec); + fn sign(&self, signer_payload: &[u8]) -> T::Signature; } /// A [`Signer`] implementation that can be constructed from an [`Pair`]. @@ -105,13 +104,11 @@ where &self.account_id } - fn encode_address_to(&self, out: &mut Vec) { - let address: T::Address = self.account_id.clone().into(); - address.encode_to(out); + fn address(&self) -> T::Address { + self.account_id.clone().into() } - fn encode_signature_to(&self, signer_payload: &[u8], out: &mut Vec) { - let signature: T::Signature = self.signer.sign(signer_payload).into(); - signature.encode_to(out); + fn sign(&self, signer_payload: &[u8]) -> T::Signature { + self.signer.sign(signer_payload).into() } } From 49ef09e37a6b8cc2b68f056078290bc2463561b5 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 24 Mar 2022 11:51:09 +0000 Subject: [PATCH 08/13] Tweak comments and such in extrinsic params --- subxt/src/extrinsic/params.rs | 133 ++++++++++++++++------------------ 1 file changed, 64 insertions(+), 69 deletions(-) diff --git a/subxt/src/extrinsic/params.rs b/subxt/src/extrinsic/params.rs index fd3ff82a9a..8f26a0c88f 100644 --- a/subxt/src/extrinsic/params.rs +++ b/subxt/src/extrinsic/params.rs @@ -62,7 +62,7 @@ pub trait ExtrinsicParams { pub type SubstrateExtrinsicParams = BaseExtrinsicParams; /// A builder which leads to [`SubstrateExtrinsicParams`] being constructed. -/// This is what you provide to methods like [`crate::Client::sign_and_submit`]. +/// This is what you provide to methods like `sign_and_submit()`. pub type SubstrateExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder; /// A struct representing the signed extra and additional parameters required @@ -70,73 +70,18 @@ pub type SubstrateExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder = BaseExtrinsicParams; /// A builder which leads to [`PolkadotExtrinsicParams`] being constructed. -/// This is what you provide to methods like [`crate::Client::sign_and_submit`]. +/// This is what you provide to methods like `sign_and_submit()`. pub type PolkadotExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder; -/// A plain tip payment. -#[derive(Copy, Clone, Encode)] -pub struct PlainTip { - tip: Compact, -} - -impl PlainTip { - /// Create a new tip of the amount provided. - pub fn new(amount: u128) -> Self { - PlainTip { - tip: Compact(amount), - } - } -} - -impl Default for PlainTip { - fn default() -> Self { - PlainTip { tip: Compact(0) } - } -} - -/// A tip payment made in the form of a specific asset. -#[derive(Copy, Clone, Encode)] -pub struct AssetTip { - #[codec(compact)] - tip: u128, - asset: Option, -} - -impl AssetTip { - /// Create a new tip of the amount provided. - pub fn new(amount: u128) -> Self { - AssetTip { - tip: amount, - asset: None, - } - } - - /// Designate the tip as being of a particular asset class. - pub fn of_asset(mut self, asset: u32) -> Self { - self.asset = Some(asset); - self - } -} - -impl Default for AssetTip { - fn default() -> Self { - Self { - tip: 0, - asset: None, - } - } -} - /// An implementation of [`ExtrinsicParams`] that is suitable for constructing /// extrinsics that can be sent to a node with the same signed extra and additional -/// parameters as a Polkadot/Substrate node. Prefer to use [`SubstrateExtrinsicParams`] -/// for a version of this tailored towards Substrate, or [`PolkadotExtrinsicParams`] -/// for a version tailored to Polkadot. +/// parameters as a Polkadot/Substrate node. The way that tip payments are specified +/// differs between Substrate and Polkadot nodes, and so we are generic over that in +/// order to support both here with relative ease. /// -/// If your node differs in the "signed extra" and -/// "additional" parameters expected to be sent/signed with a transaction, then you'll -/// need to define your own struct which implements [`ExtrinsicParams`] and provides -/// back the custom extra and additional parameters you require. +/// If your node differs in the "signed extra" and "additional" parameters expected +/// to be sent/signed with a transaction, then you can define your own type which +/// implements the [`ExtrinsicParams`] trait. pub struct BaseExtrinsicParams { era: Era, nonce: T::Index, @@ -148,11 +93,12 @@ pub struct BaseExtrinsicParams { marker: std::marker::PhantomData, } -/// The set of parameters which can be provided in order to customise our [`BaseExtrinsicParams`] -/// values. These implement [`Default`] so that [`BaseExtrinsicParams`] can be used with -/// convenience methods like [`crate::Client::sign_and_submit_default`]. Prefer to use -/// [`SubstrateExtrinsicParamsBuilder`] for a version of this tailored towards Substrate, or -/// [`PolkadotExtrinsicParamsBuilder`] for a version tailored to Polkadot. +/// This builder allows you to provide the parameters that can be configured in order to +/// construct a [`BaseExtrinsicParams`] value. This implements [`Default`], which allows +/// [`BaseExtrinsicParams`] to be used with convenience methods like `sign_and_submit_default()`. +/// +/// Prefer to use [`SubstrateExtrinsicParamsBuilder`] for a version of this tailored towards +/// Substrate, or [`PolkadotExtrinsicParamsBuilder`] for a version tailored to Polkadot. pub struct BaseExtrinsicParamsBuilder { era: Era, mortality_checkpoint: Option, @@ -165,7 +111,11 @@ impl BaseExtrinsicParamsBuilder { Self::default() } - /// Set the [`Era`] and era checkpoint. + /// Set the [`Era`], which defines how long the transaction will be valid for + /// (it can be either immortal, or it can be mortal and expire after a certain amount + /// of time). The second argument is the block hash after which the transaction + /// becomes valid, and must align with the era phase (see the [`Era::Mortal`] docs + /// for more detail on that). pub fn era(mut self, era: Era, checkpoint: T::Hash) -> Self { self.era = era; self.mortality_checkpoint = Some(checkpoint); @@ -232,3 +182,48 @@ impl ExtrinsicParams for BaseExtrinsicParams .encode_to(v); } } + +/// A tip payment. +#[derive(Copy, Clone, Encode)] +pub struct PlainTip { + tip: Compact, +} + +impl PlainTip { + /// Create a new tip of the amount provided. + pub fn new(amount: u128) -> Self { + PlainTip { + tip: Compact(amount), + } + } +} + +impl Default for PlainTip { + fn default() -> Self { + PlainTip { tip: Compact(0) } + } +} + +/// A tip payment made in the form of a specific asset. +#[derive(Copy, Clone, Default, Encode)] +pub struct AssetTip { + #[codec(compact)] + tip: u128, + asset: Option, +} + +impl AssetTip { + /// Create a new tip of the amount provided. + pub fn new(amount: u128) -> Self { + AssetTip { + tip: amount, + asset: None, + } + } + + /// Designate the tip as being of a particular asset class. + pub fn of_asset(mut self, asset: u32) -> Self { + self.asset = Some(asset); + self + } +} From 47ab585d14267747ca558e8d5216294d741de85b Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 24 Mar 2022 12:27:09 +0000 Subject: [PATCH 09/13] check all examples against newer polkadot, add new one with params, import path tweaks --- codegen/src/api/calls.rs | 2 +- codegen/src/api/mod.rs | 6 +- examples/examples/balance_transfer.rs | 2 +- .../examples/balance_transfer_with_params.rs | 69 + examples/examples/custom_config.rs | 2 +- examples/examples/custom_type_derives.rs | 2 +- examples/examples/fetch_all_accounts.rs | 2 +- examples/examples/polkadot_metadata.scale | Bin 315440 -> 330268 bytes examples/examples/rpc_call.rs | 2 +- examples/examples/submit_and_watch.rs | 2 +- examples/examples/subscribe_all_events.rs | 2 +- examples/examples/subscribe_one_event.rs | 2 +- examples/examples/subscribe_some_events.rs | 2 +- subxt/src/extrinsic/mod.rs | 3 + subxt/src/extrinsic/params.rs | 30 +- subxt/src/extrinsic/signer.rs | 5 + subxt/src/lib.rs | 2 - subxt/tests/integration/codegen/polkadot.rs | 3159 +++++++++++------ subxt/tests/integration/events.rs | 1 - subxt/tests/integration/frame/balances.rs | 5 +- subxt/tests/integration/frame/staking.rs | 5 +- subxt/tests/integration/frame/system.rs | 1 - 22 files changed, 2249 insertions(+), 1057 deletions(-) create mode 100644 examples/examples/balance_transfer_with_params.rs diff --git a/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index a4515b4c80..40ed646ecc 100644 --- a/codegen/src/api/calls.rs +++ b/codegen/src/api/calls.rs @@ -116,7 +116,7 @@ pub fn generate_calls( impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client, marker: ::core::marker::PhantomData } diff --git a/codegen/src/api/mod.rs b/codegen/src/api/mod.rs index f844438800..a2adaf7a7e 100644 --- a/codegen/src/api/mod.rs +++ b/codegen/src/api/mod.rs @@ -288,7 +288,7 @@ impl RuntimeGenerator { impl ::core::convert::From<::subxt::Client> for RuntimeApi where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams + X: ::subxt::extrinsic::ExtrinsicParams { fn from(client: ::subxt::Client) -> Self { Self { client, marker: ::core::marker::PhantomData } @@ -298,7 +298,7 @@ impl RuntimeGenerator { impl<'a, T, X> RuntimeApi where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn constants(&'a self) -> ConstantsApi { ConstantsApi @@ -368,7 +368,7 @@ impl RuntimeGenerator { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { #( pub fn #pallets_with_calls(&self) -> #pallets_with_calls::calls::TransactionApi<'a, T, X> { diff --git a/examples/examples/balance_transfer.rs b/examples/examples/balance_transfer.rs index 2878c86ff7..bc6bb9803a 100644 --- a/examples/examples/balance_transfer.rs +++ b/examples/examples/balance_transfer.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/balance_transfer_with_params.rs b/examples/examples/balance_transfer_with_params.rs new file mode 100644 index 0000000000..d68bf84e51 --- /dev/null +++ b/examples/examples/balance_transfer_with_params.rs @@ -0,0 +1,69 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. +//! +//! E.g. +//! ```bash +//! curl "https://github.com/paritytech/polkadot/releases/download/v0.9.13/polkadot" --output /usr/local/bin/polkadot --location +//! polkadot --dev --tmp +//! ``` + +use sp_keyring::AccountKeyring; +use subxt::{ + extrinsic::{ + Era, + PlainTip, + }, + ClientBuilder, + DefaultConfig, + PairSigner, + PolkadotExtrinsicParams, + PolkadotExtrinsicParamsBuilder as Params, +}; + +#[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] +pub mod polkadot {} + +#[async_std::main] +async fn main() -> Result<(), Box> { + env_logger::init(); + + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let dest = AccountKeyring::Bob.to_account_id().into(); + + let api = ClientBuilder::new() + .build() + .await? + .to_runtime_api::>>(); + + // Configure the transaction tip and era: + let tx_params = Params::new() + .tip(PlainTip::new(20_000_000_000)) + .era(Era::Immortal, *api.client.genesis()); + + // Send the transaction: + let hash = api + .tx() + .balances() + .transfer(dest, 123_456_789_012_345) + .sign_and_submit(&signer, tx_params) + .await?; + + println!("Balance transfer extrinsic submitted: {}", hash); + + Ok(()) +} diff --git a/examples/examples/custom_config.rs b/examples/examples/custom_config.rs index fcd81e02a5..bca607f81d 100644 --- a/examples/examples/custom_config.rs +++ b/examples/examples/custom_config.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/custom_type_derives.rs b/examples/examples/custom_type_derives.rs index 12527de5d8..c216008648 100644 --- a/examples/examples/custom_type_derives.rs +++ b/examples/examples/custom_type_derives.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. #![allow(clippy::redundant_clone)] diff --git a/examples/examples/fetch_all_accounts.rs b/examples/examples/fetch_all_accounts.rs index 9455244449..846e60be2e 100644 --- a/examples/examples/fetch_all_accounts.rs +++ b/examples/examples/fetch_all_accounts.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/polkadot_metadata.scale b/examples/examples/polkadot_metadata.scale index 73177314a1b758e8a665fb18b1ee4abf11603f8f..a9bb72cf6a9d389b89d870b821f35cefc93ec902 100644 GIT binary patch delta 38885 zcmeFa4R}=5wKsnD$0Rc$fr%uLgd|KbfdrF~gaktbBtVoX-w*^PCPOlikt7plGC)ua zRB5G31rNAIMU6;>R@5}o5fwF6+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O$9WLYhUq z0~iWGjA$0WSInweBy~M4k+f4(_XL?OR>R_#oaAqJiitK?IsP1iuhjSg5e_v%#&cqV z(_fY=-33~lf!kQXSr>zRd@FB%PW0)h_=)GlCs>=e8{$e4<_N(NVDLTpogw~?HTcQ% zVk1Qx%XW#eO1ISdg1E!FR{7D#%d1|5V3H`Gdl6kpk>huZN3pg(+by#Bc1xNZ*d~_q zA`qOWHc^PcUU{ZXOtP=HP#&mKrp$c_GDn@^dkIttMCZ|$#T;v+DmYKFJrI2Ijm$kL zkqV9X_X?0Qukq1;i_Zz3ny>y|{FPCI@#L!@P`m=`S{x8N!4r)GqS#XJ03DPuuZd}q zSxR{_#S2fkh7w%;qt;XrcxKycVk{a|BY%8N*6G&v+9G8FW~&V^-W_#p#k5Q6%D|?f(sLCj&q;MHOey|E&iPEt zM{8O?6C=sih(COx#Wc!qJ{JpuT+mYBI1uC=Irq5uD*7?M;>=*FXRsV`0t|b-{OE)zbh(PVc-8xg$GBWB zvr)OJuIVYogV)J|lVav27edKhC&jG;{N-y?x|A^iH)Db1_|)#9k&Zd!qAx`g8gdd1 ziTPFre`- zm(Xo#-Dru%UxJX&kflFLNRe-oWe^tBPh@ex1`Ls-?%2+JaHuuCkKKjP0j$d9Z@o+wA!EQ|QWAoye3EDvENXWK2flU@#WSkhKc z#3gz_!GfR?caTV!G@;Cc1IJaBb3L_H1*R$48&o&WOf3N24D8S1N7R{*w^(K?#0{JQ$&IkfyGoAt)iaqx2HbnxMK=6&t(MPc7F5)fG=DQCpE3&u4jZa5(~K>iVF%#-RTN-e+I4 diff --git a/examples/examples/rpc_call.rs b/examples/examples/rpc_call.rs index f0fe0eee70..9e75571bb2 100644 --- a/examples/examples/rpc_call.rs +++ b/examples/examples/rpc_call.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/submit_and_watch.rs b/examples/examples/submit_and_watch.rs index f2539a6cef..0378e6777d 100644 --- a/examples/examples/submit_and_watch.rs +++ b/examples/examples/submit_and_watch.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/subscribe_all_events.rs b/examples/examples/subscribe_all_events.rs index b6077bd7ea..7766e7f6bd 100644 --- a/examples/examples/subscribe_all_events.rs +++ b/examples/examples/subscribe_all_events.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/subscribe_one_event.rs b/examples/examples/subscribe_one_event.rs index d3dc3bd162..8e3374da1a 100644 --- a/examples/examples/subscribe_one_event.rs +++ b/examples/examples/subscribe_one_event.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/examples/examples/subscribe_some_events.rs b/examples/examples/subscribe_some_events.rs index 59e91903c1..8183f8b598 100644 --- a/examples/examples/subscribe_some_events.rs +++ b/examples/examples/subscribe_some_events.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with subxt. If not, see . -//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.13-82616422d0-aarch64-macos. +//! To run this example, a local polkadot node should be running. Example verified against polkadot 0.9.18-f6d6ab005d-aarch64-macos. //! //! E.g. //! ```bash diff --git a/subxt/src/extrinsic/mod.rs b/subxt/src/extrinsic/mod.rs index 231a5e250a..60b256dfaf 100644 --- a/subxt/src/extrinsic/mod.rs +++ b/subxt/src/extrinsic/mod.rs @@ -21,7 +21,10 @@ mod signer; pub use self::{ params::{ + AssetTip, + Era, ExtrinsicParams, + PlainTip, PolkadotExtrinsicParams, PolkadotExtrinsicParamsBuilder, SubstrateExtrinsicParams, diff --git a/subxt/src/extrinsic/params.rs b/subxt/src/extrinsic/params.rs index 8f26a0c88f..6f06a573fd 100644 --- a/subxt/src/extrinsic/params.rs +++ b/subxt/src/extrinsic/params.rs @@ -18,13 +18,15 @@ use codec::{ Compact, Encode, }; -use sp_runtime::generic::Era; use crate::{ Config, Encoded, }; +// We require Era as a param below, so make it available from here. +pub use sp_runtime::generic::Era; + /// This trait allows you to configure the "signed extra" and /// "additional" parameters that are signed and used in transactions. /// see [`BaseExtrinsicParams`] for an implementation that is compatible with @@ -124,8 +126,8 @@ impl BaseExtrinsicParamsBuilder { /// Set the tip you'd like to give to the block author /// for this transaction. - pub fn tip(mut self, tip: Tip) -> Self { - self.tip = tip; + pub fn tip(mut self, tip: impl Into) -> Self { + self.tip = tip.into(); self } } @@ -186,21 +188,26 @@ impl ExtrinsicParams for BaseExtrinsicParams /// A tip payment. #[derive(Copy, Clone, Encode)] pub struct PlainTip { - tip: Compact, + #[codec(compact)] + tip: u128, } impl PlainTip { /// Create a new tip of the amount provided. pub fn new(amount: u128) -> Self { - PlainTip { - tip: Compact(amount), - } + PlainTip { tip: amount } } } impl Default for PlainTip { fn default() -> Self { - PlainTip { tip: Compact(0) } + PlainTip { tip: 0 } + } +} + +impl From for PlainTip { + fn from(n: u128) -> Self { + PlainTip::new(n) } } @@ -222,8 +229,15 @@ impl AssetTip { } /// Designate the tip as being of a particular asset class. + /// If this is not set, then the native currency is used. pub fn of_asset(mut self, asset: u32) -> Self { self.asset = Some(asset); self } } + +impl From for AssetTip { + fn from(n: u128) -> Self { + AssetTip::new(n) + } +} diff --git a/subxt/src/extrinsic/signer.rs b/subxt/src/extrinsic/signer.rs index 1119f56037..694c567a60 100644 --- a/subxt/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -87,6 +87,11 @@ where pub fn signer(&self) -> &P { &self.signer } + + /// Return the account ID. + pub fn account_id(&self) -> &T::AccountId { + &self.account_id + } } impl Signer for PairSigner diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index e79c54a8e5..0e808387b8 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -90,11 +90,9 @@ pub use crate::{ RawEventDetails, }, extrinsic::{ - ExtrinsicParams, PairSigner, PolkadotExtrinsicParams, PolkadotExtrinsicParamsBuilder, - Signer, SubstrateExtrinsicParams, SubstrateExtrinsicParamsBuilder, }, diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs index 39a966de28..2cf0c7c8ea 100644 --- a/subxt/tests/integration/codegen/polkadot.rs +++ b/subxt/tests/integration/codegen/polkadot.rs @@ -1,4 +1,4 @@ -// Note [jsdw]: generated from polkadot 0.9.13-82616422d0-aarch64-macos +// NOTE [jsdw]: generated from polkadot 0.9.18-f6d6ab005d-aarch64-macos #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod api { use super::api as root_mod; @@ -50,6 +50,8 @@ pub mod api { Multisig(multisig::Event), #[codec(index = 34)] Bounties(bounties::Event), + #[codec(index = 38)] + ChildBounties(child_bounties::Event), #[codec(index = 35)] Tips(tips::Event), #[codec(index = 36)] @@ -64,6 +66,8 @@ pub mod api { Ump(ump::Event), #[codec(index = 60)] Hrmp(hrmp::Event), + #[codec(index = 62)] + ParasDisputes(paras_disputes::Event), #[codec(index = 70)] Registrar(registrar::Event), #[codec(index = 71)] @@ -170,7 +174,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -811,7 +815,7 @@ pub mod api { 32u8, 112u8, 111u8, 108u8, 107u8, 97u8, 100u8, 111u8, 116u8, 60u8, 112u8, 97u8, 114u8, 105u8, 116u8, 121u8, 45u8, 112u8, 111u8, 108u8, 107u8, 97u8, 100u8, 111u8, 116u8, 0u8, 0u8, - 0u8, 0u8, 180u8, 35u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 56u8, + 0u8, 0u8, 220u8, 35u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 56u8, 223u8, 106u8, 203u8, 104u8, 153u8, 7u8, 96u8, 155u8, 4u8, 0u8, 0u8, 0u8, 55u8, 227u8, 151u8, 252u8, 124u8, 145u8, 245u8, 228u8, 1u8, 0u8, 0u8, 0u8, 64u8, 254u8, 58u8, 212u8, @@ -829,7 +833,7 @@ pub mod api { 31u8, 235u8, 139u8, 1u8, 0u8, 0u8, 0u8, 188u8, 157u8, 137u8, 144u8, 79u8, 91u8, 146u8, 63u8, 1u8, 0u8, 0u8, 0u8, 55u8, 200u8, 187u8, 19u8, 80u8, 169u8, 162u8, 168u8, 1u8, 0u8, 0u8, - 0u8, 9u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 12u8, 0u8, 0u8, 0u8, 0u8, ][..], )?) } @@ -951,7 +955,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -1187,15 +1191,6 @@ pub mod api { )]) } } - pub struct StorageVersion; - impl ::subxt::StorageEntry for StorageVersion { - const PALLET: &'static str = "Scheduler"; - const STORAGE: &'static str = "StorageVersion"; - type Value = runtime_types::pallet_scheduler::Releases; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } pub struct StorageApi<'a, T: ::subxt::Config> { client: &'a ::subxt::Client, } @@ -1238,16 +1233,6 @@ pub mod api { > { self.client.storage().iter(hash).await } - pub async fn storage_version( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - runtime_types::pallet_scheduler::Releases, - ::subxt::BasicError, - > { - let entry = StorageVersion; - self.client.storage().fetch_or_default(&entry, hash).await - } } } pub mod constants { @@ -1319,7 +1304,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -1561,7 +1546,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -1997,7 +1982,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -2153,7 +2138,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -2436,7 +2421,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -2967,7 +2952,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -3314,14 +3299,30 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SetStakingConfigs { - pub min_nominator_bond: ::core::primitive::u128, - pub min_validator_bond: ::core::primitive::u128, - pub max_nominator_count: ::core::option::Option<::core::primitive::u32>, - pub max_validator_count: ::core::option::Option<::core::primitive::u32>, - pub chill_threshold: ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - pub min_commission: runtime_types::sp_arithmetic::per_things::Perbill, + pub min_nominator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + pub min_validator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + pub max_nominator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + pub max_validator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + pub chill_threshold: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, + pub min_commission: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, } impl ::subxt::Call for SetStakingConfigs { const PALLET: &'static str = "Staking"; @@ -3335,6 +3336,14 @@ pub mod api { const PALLET: &'static str = "Staking"; const FUNCTION: &'static str = "chill_other"; } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceApplyMinCommission { + pub validator_stash: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ForceApplyMinCommission { + const PALLET: &'static str = "Staking"; + const FUNCTION: &'static str = "force_apply_min_commission"; + } pub struct TransactionApi<'a, T: ::subxt::Config, X> { client: &'a ::subxt::Client, marker: ::core::marker::PhantomData, @@ -3342,7 +3351,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -3713,14 +3722,12 @@ pub mod api { } pub fn set_staking_configs( &self, - min_nominator_bond: ::core::primitive::u128, - min_validator_bond: ::core::primitive::u128, - max_nominator_count: ::core::option::Option<::core::primitive::u32>, - max_validator_count: ::core::option::Option<::core::primitive::u32>, - chill_threshold: ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, - min_commission: runtime_types::sp_arithmetic::per_things::Perbill, + min_nominator_bond : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u128 >, + min_validator_bond : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u128 >, + max_nominator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, + max_validator_count : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < :: core :: primitive :: u32 >, + chill_threshold : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Percent >, + min_commission : runtime_types :: pallet_staking :: pallet :: pallet :: ConfigOp < runtime_types :: sp_arithmetic :: per_things :: Perbill >, ) -> ::subxt::SubmittableExtrinsic< 'a, T, @@ -3753,6 +3760,20 @@ pub mod api { let call = ChillOther { controller }; ::subxt::SubmittableExtrinsic::new(self.client, call) } + pub fn force_apply_min_commission( + &self, + validator_stash: ::subxt::sp_core::crypto::AccountId32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceApplyMinCommission, + DispatchError, + root_mod::Event, + > { + let call = ForceApplyMinCommission { validator_stash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } } } pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; @@ -4001,9 +4022,7 @@ pub mod api { impl ::subxt::StorageEntry for Nominators<'_> { const PALLET: &'static str = "Staking"; const STORAGE: &'static str = "Nominators"; - type Value = runtime_types::pallet_staking::Nominations< - ::subxt::sp_core::crypto::AccountId32, - >; + type Value = runtime_types::pallet_staking::Nominations; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -4517,11 +4536,7 @@ pub mod api { _0: &::subxt::sp_core::crypto::AccountId32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::pallet_staking::Nominations< - ::subxt::sp_core::crypto::AccountId32, - >, - >, + ::core::option::Option, ::subxt::BasicError, > { let entry = Nominators(_0); @@ -4932,6 +4947,14 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { + pub fn max_nominations( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[16u8, 0u8, 0u8, 0u8][..], + )?) + } pub fn sessions_per_era( &self, ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> @@ -4964,12 +4987,12 @@ pub mod api { &mut &[0u8, 1u8, 0u8, 0u8][..], )?) } - pub fn max_nominations( + pub fn max_unlocking_chunks( &self, ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( - &mut &[16u8, 0u8, 0u8, 0u8][..], + &mut &[32u8, 0u8, 0u8, 0u8][..], )?) } } @@ -5162,7 +5185,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -5445,7 +5468,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -5722,7 +5745,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -6177,7 +6200,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -6869,18 +6892,6 @@ pub mod api { )]) } } - pub struct Locks<'a>(pub &'a ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks<'_> { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Locks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } pub struct LastTabledWasExternal; impl ::subxt::StorageEntry for LastTabledWasExternal { const PALLET: &'static str = "Democracy"; @@ -7082,26 +7093,6 @@ pub mod api { > { self.client.storage().iter(hash).await } - pub async fn locks( - &self, - _0: &::subxt::sp_core::crypto::AccountId32, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, - ::subxt::BasicError, - > { - let entry = Locks(_0); - self.client.storage().fetch(&entry, hash).await - } - pub async fn locks_iter( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Locks<'a>>, - ::subxt::BasicError, - > { - self.client.storage().iter(hash).await - } pub async fn last_tabled_was_external( &self, hash: ::core::option::Option, @@ -7354,7 +7345,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -7793,7 +7784,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -8221,7 +8212,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -8679,7 +8670,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -8922,7 +8913,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -9306,7 +9297,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -9704,7 +9695,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -9983,7 +9974,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -10280,7 +10271,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -10975,7 +10966,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -11220,6 +11211,17 @@ pub mod api { const PALLET: &'static str = "Proxy"; const EVENT: &'static str = "ProxyAdded"; } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ProxyRemoved { + pub delegator: ::subxt::sp_core::crypto::AccountId32, + pub delegatee: ::subxt::sp_core::crypto::AccountId32, + pub proxy_type: runtime_types::polkadot_runtime::ProxyType, + pub delay: ::core::primitive::u32, + } + impl ::subxt::Event for ProxyRemoved { + const PALLET: &'static str = "Proxy"; + const EVENT: &'static str = "ProxyRemoved"; + } } pub mod storage { use super::runtime_types; @@ -11468,7 +11470,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -11881,7 +11883,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -12150,7 +12152,10 @@ pub mod api { impl ::subxt::StorageEntry for BountyDescriptions<'_> { const PALLET: &'static str = "Bounties"; const STORAGE: &'static str = "BountyDescriptions"; - type Value = ::std::vec::Vec<::core::primitive::u8>; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -12162,7 +12167,10 @@ pub mod api { impl ::subxt::StorageEntry for BountyApprovals { const PALLET: &'static str = "Bounties"; const STORAGE: &'static str = "BountyApprovals"; - type Value = ::std::vec::Vec<::core::primitive::u32>; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -12213,7 +12221,11 @@ pub mod api { _0: &::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::core::option::Option< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, ::subxt::BasicError, > { let entry = BountyDescriptions(_0); @@ -12232,7 +12244,9 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::std::vec::Vec<::core::primitive::u32>, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u32, + >, ::subxt::BasicError, > { let entry = BountyApprovals; @@ -12314,7 +12328,7 @@ pub mod api { } } } - pub mod tips { + pub mod child_bounties { use super::root_mod; use super::runtime_types; pub mod calls { @@ -12322,58 +12336,92 @@ pub mod api { use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ReportAwesome { - pub reason: ::std::vec::Vec<::core::primitive::u8>, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub struct AddChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub value: ::core::primitive::u128, + pub description: ::std::vec::Vec<::core::primitive::u8>, } - impl ::subxt::Call for ReportAwesome { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "report_awesome"; + impl ::subxt::Call for AddChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "add_child_bounty"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RetractTip { - pub hash: ::subxt::sp_core::H256, + pub struct ProposeCurator { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + pub curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub fee: ::core::primitive::u128, } - impl ::subxt::Call for RetractTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "retract_tip"; + impl ::subxt::Call for ProposeCurator { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "propose_curator"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TipNew { - pub reason: ::std::vec::Vec<::core::primitive::u8>, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub struct AcceptCurator { #[codec(compact)] - pub tip_value: ::core::primitive::u128, + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for TipNew { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip_new"; + impl ::subxt::Call for AcceptCurator { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "accept_curator"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Tip { - pub hash: ::subxt::sp_core::H256, + pub struct UnassignCurator { #[codec(compact)] - pub tip_value: ::core::primitive::u128, + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for Tip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "tip"; + impl ::subxt::Call for UnassignCurator { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "unassign_curator"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct CloseTip { - pub hash: ::subxt::sp_core::H256, + pub struct AwardChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, } - impl ::subxt::Call for CloseTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "close_tip"; + impl ::subxt::Call for AwardChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "award_child_bounty"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SlashTip { - pub hash: ::subxt::sp_core::H256, + pub struct ClaimChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, } - impl ::subxt::Call for SlashTip { - const PALLET: &'static str = "Tips"; - const FUNCTION: &'static str = "slash_tip"; + impl ::subxt::Call for ClaimChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "claim_child_bounty"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseChildBounty { + #[codec(compact)] + pub parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + pub child_bounty_id: ::core::primitive::u32, + } + impl ::subxt::Call for CloseChildBounty { + const PALLET: &'static str = "ChildBounties"; + const FUNCTION: &'static str = "close_child_bounty"; } pub struct TransactionApi<'a, T: ::subxt::Config, X> { client: &'a ::subxt::Client, @@ -12382,7 +12430,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -12390,160 +12438,247 @@ pub mod api { marker: ::core::marker::PhantomData, } } - pub fn report_awesome( + pub fn add_child_bounty( &self, - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, + parent_bounty_id: ::core::primitive::u32, + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - ReportAwesome, + AddChildBounty, DispatchError, root_mod::Event, > { - let call = ReportAwesome { reason, who }; + let call = AddChildBounty { + parent_bounty_id, + value, + description, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn retract_tip( + pub fn propose_curator( &self, - hash: ::subxt::sp_core::H256, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + fee: ::core::primitive::u128, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - RetractTip, + ProposeCurator, DispatchError, root_mod::Event, > { - let call = RetractTip { hash }; + let call = ProposeCurator { + parent_bounty_id, + child_bounty_id, + curator, + fee, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn tip_new( + pub fn accept_curator( &self, - reason: ::std::vec::Vec<::core::primitive::u8>, - who: ::subxt::sp_core::crypto::AccountId32, - tip_value: ::core::primitive::u128, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - TipNew, + AcceptCurator, DispatchError, root_mod::Event, > { - let call = TipNew { - reason, - who, - tip_value, + let call = AcceptCurator { + parent_bounty_id, + child_bounty_id, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn tip( + pub fn unassign_curator( &self, - hash: ::subxt::sp_core::H256, - tip_value: ::core::primitive::u128, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - Tip, + UnassignCurator, DispatchError, root_mod::Event, > { - let call = Tip { hash, tip_value }; + let call = UnassignCurator { + parent_bounty_id, + child_bounty_id, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn close_tip( + pub fn award_child_bounty( &self, - hash: ::subxt::sp_core::H256, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - CloseTip, + AwardChildBounty, DispatchError, root_mod::Event, > { - let call = CloseTip { hash }; + let call = AwardChildBounty { + parent_bounty_id, + child_bounty_id, + beneficiary, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn slash_tip( + pub fn claim_child_bounty( &self, - hash: ::subxt::sp_core::H256, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - SlashTip, + ClaimChildBounty, DispatchError, root_mod::Event, > { - let call = SlashTip { hash }; + let call = ClaimChildBounty { + parent_bounty_id, + child_bounty_id, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - } - } - pub type Event = runtime_types::pallet_tips::pallet::Event; + pub fn close_child_bounty( + &self, + parent_bounty_id: ::core::primitive::u32, + child_bounty_id: ::core::primitive::u32, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + CloseChildBounty, + DispatchError, + root_mod::Event, + > { + let call = CloseChildBounty { + parent_bounty_id, + child_bounty_id, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = runtime_types::pallet_child_bounties::pallet::Event; pub mod events { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct NewTip { - pub tip_hash: ::subxt::sp_core::H256, + pub struct Added { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, } - impl ::subxt::Event for NewTip { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "NewTip"; + impl ::subxt::Event for Added { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Added"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TipClosing { - pub tip_hash: ::subxt::sp_core::H256, + pub struct Awarded { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, } - impl ::subxt::Event for TipClosing { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosing"; + impl ::subxt::Event for Awarded { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Awarded"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TipClosed { - pub tip_hash: ::subxt::sp_core::H256, - pub who: ::subxt::sp_core::crypto::AccountId32, + pub struct Claimed { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, pub payout: ::core::primitive::u128, + pub beneficiary: ::subxt::sp_core::crypto::AccountId32, } - impl ::subxt::Event for TipClosed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipClosed"; - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TipRetracted { - pub tip_hash: ::subxt::sp_core::H256, - } - impl ::subxt::Event for TipRetracted { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipRetracted"; + impl ::subxt::Event for Claimed { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Claimed"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct TipSlashed { - pub tip_hash: ::subxt::sp_core::H256, - pub finder: ::subxt::sp_core::crypto::AccountId32, - pub deposit: ::core::primitive::u128, + pub struct Canceled { + pub index: ::core::primitive::u32, + pub child_index: ::core::primitive::u32, } - impl ::subxt::Event for TipSlashed { - const PALLET: &'static str = "Tips"; - const EVENT: &'static str = "TipSlashed"; + impl ::subxt::Event for Canceled { + const PALLET: &'static str = "ChildBounties"; + const EVENT: &'static str = "Canceled"; } } pub mod storage { use super::runtime_types; - pub struct Tips<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Tips<'_> { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Tips"; - type Value = runtime_types::pallet_tips::OpenTip< + pub struct ChildBountyCount; + impl ::subxt::StorageEntry for ChildBountyCount { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildBountyCount"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct ParentChildBounties<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ParentChildBounties<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ParentChildBounties"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct ChildBounties<'a>( + pub &'a ::core::primitive::u32, + pub &'a ::core::primitive::u32, + ); + impl ::subxt::StorageEntry for ChildBounties<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildBounties"; + type Value = runtime_types::pallet_child_bounties::ChildBounty< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, ::core::primitive::u32, - ::subxt::sp_core::H256, >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Twox64Concat, + ), + ]) + } + } + pub struct ChildBountyDescriptions<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ChildBountyDescriptions<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildBountyDescriptions"; + type Value = + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -12551,15 +12686,15 @@ pub mod api { )]) } } - pub struct Reasons<'a>(pub &'a ::subxt::sp_core::H256); - impl ::subxt::StorageEntry for Reasons<'_> { - const PALLET: &'static str = "Tips"; - const STORAGE: &'static str = "Reasons"; - type Value = ::std::vec::Vec<::core::primitive::u8>; + pub struct ChildrenCuratorFees<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for ChildrenCuratorFees<'_> { + const PALLET: &'static str = "ChildBounties"; + const STORAGE: &'static str = "ChildrenCuratorFees"; + type Value = ::core::primitive::u128; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, - ::subxt::StorageHasher::Identity, + ::subxt::StorageHasher::Twox64Concat, )]) } } @@ -12570,49 +12705,97 @@ pub mod api { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } } - pub async fn tips( + pub async fn child_bounty_count( &self, - _0: &::subxt::sp_core::H256, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ChildBountyCount; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn parent_child_bounties( + &self, + _0: &::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = ParentChildBounties(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn parent_child_bounties_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ParentChildBounties<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn child_bounties( + &self, + _0: &::core::primitive::u32, + _1: &::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::pallet_tips::OpenTip< + runtime_types::pallet_child_bounties::ChildBounty< ::subxt::sp_core::crypto::AccountId32, ::core::primitive::u128, ::core::primitive::u32, - ::subxt::sp_core::H256, >, >, ::subxt::BasicError, > { - let entry = Tips(_0); + let entry = ChildBounties(_0, _1); self.client.storage().fetch(&entry, hash).await } - pub async fn tips_iter( + pub async fn child_bounties_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Tips<'a>>, + ::subxt::KeyIter<'a, T, ChildBounties<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - pub async fn reasons( + pub async fn child_bounty_descriptions( &self, - _0: &::subxt::sp_core::H256, + _0: &::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::core::option::Option< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, ::subxt::BasicError, > { - let entry = Reasons(_0); + let entry = ChildBountyDescriptions(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn reasons_iter( + pub async fn child_bounty_descriptions_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Reasons<'a>>, + ::subxt::KeyIter<'a, T, ChildBountyDescriptions<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn children_curator_fees( + &self, + _0: &::core::primitive::u32, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + let entry = ChildrenCuratorFees(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn children_curator_fees_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, ChildrenCuratorFees<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await @@ -12623,56 +12806,39 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - pub fn maximum_reason_length( + pub fn max_active_child_bounty_count( &self, ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( - &mut &[0u8, 64u8, 0u8, 0u8][..], + &mut &[100u8, 0u8, 0u8, 0u8][..], )?) } - pub fn data_deposit_per_byte( + pub fn child_bounty_value_minimum( &self, ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( &mut &[ - 0u8, 225u8, 245u8, 5u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 228u8, 11u8, 84u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, ][..], )?) } - pub fn tip_countdown( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[64u8, 56u8, 0u8, 0u8][..], - )?) - } - pub fn tip_finders_fee( + pub fn child_bounty_curator_deposit_base( &self, ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Percent, + runtime_types::sp_arithmetic::per_things::Permill, ::subxt::BasicError, > { - Ok(::subxt::codec::Decode::decode(&mut &[20u8][..])?) - } - pub fn tip_report_deposit_base( - &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { Ok(::subxt::codec::Decode::decode( - &mut &[ - 0u8, 228u8, 11u8, 84u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, - 0u8, 0u8, 0u8, 0u8, 0u8, - ][..], + &mut &[16u8, 39u8, 0u8, 0u8][..], )?) } } } } - pub mod election_provider_multi_phase { + pub mod tips { use super::root_mod; use super::runtime_types; pub mod calls { @@ -12680,384 +12846,300 @@ pub mod api { use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SubmitUnsigned { pub raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , pub witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } - impl ::subxt::Call for SubmitUnsigned { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit_unsigned"; + pub struct ReportAwesome { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for ReportAwesome { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "report_awesome"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetMinimumUntrustedScore { - pub maybe_next_score: - ::core::option::Option<[::core::primitive::u128; 3usize]>, + pub struct RetractTip { + pub hash: ::subxt::sp_core::H256, } - impl ::subxt::Call for SetMinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_minimum_untrusted_score"; + impl ::subxt::Call for RetractTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "retract_tip"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SetEmergencyElectionResult { - pub supports: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, + pub struct TipNew { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::sp_core::crypto::AccountId32, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, } - impl ::subxt::Call for SetEmergencyElectionResult { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "set_emergency_election_result"; + impl ::subxt::Call for TipNew { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip_new"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Submit { - pub raw_solution: ::std::boxed::Box< - runtime_types::pallet_election_provider_multi_phase::RawSolution< - runtime_types::polkadot_runtime::NposCompactSolution16, - >, - >, - pub num_signed_submissions: ::core::primitive::u32, + pub struct Tip { + pub hash: ::subxt::sp_core::H256, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, } - impl ::subxt::Call for Submit { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const FUNCTION: &'static str = "submit"; + impl ::subxt::Call for Tip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "tip"; } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct CloseTip { + pub hash: ::subxt::sp_core::H256, } - impl<'a, T, X> TransactionApi<'a, T, X> - where - T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, - { - pub fn new(client: &'a ::subxt::Client) -> Self { + impl ::subxt::Call for CloseTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "close_tip"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SlashTip { + pub hash: ::subxt::sp_core::H256, + } + impl ::subxt::Call for SlashTip { + const PALLET: &'static str = "Tips"; + const FUNCTION: &'static str = "slash_tip"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { Self { client, marker: ::core::marker::PhantomData, } } - pub fn submit_unsigned( + pub fn report_awesome( &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, - witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - SubmitUnsigned, + ReportAwesome, DispatchError, root_mod::Event, > { - let call = SubmitUnsigned { - raw_solution: ::std::boxed::Box::new(raw_solution), - witness, + let call = ReportAwesome { reason, who }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn retract_tip( + &self, + hash: ::subxt::sp_core::H256, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + RetractTip, + DispatchError, + root_mod::Event, + > { + let call = RetractTip { hash }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn tip_new( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::sp_core::crypto::AccountId32, + tip_value: ::core::primitive::u128, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + TipNew, + DispatchError, + root_mod::Event, + > { + let call = TipNew { + reason, + who, + tip_value, }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_minimum_untrusted_score( + pub fn tip( &self, - maybe_next_score: ::core::option::Option< - [::core::primitive::u128; 3usize], - >, + hash: ::subxt::sp_core::H256, + tip_value: ::core::primitive::u128, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - SetMinimumUntrustedScore, + Tip, DispatchError, root_mod::Event, > { - let call = SetMinimumUntrustedScore { maybe_next_score }; + let call = Tip { hash, tip_value }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn set_emergency_election_result( + pub fn close_tip( &self, - supports: ::std::vec::Vec<( - ::subxt::sp_core::crypto::AccountId32, - runtime_types::sp_npos_elections::Support< - ::subxt::sp_core::crypto::AccountId32, - >, - )>, + hash: ::subxt::sp_core::H256, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - SetEmergencyElectionResult, + CloseTip, DispatchError, root_mod::Event, > { - let call = SetEmergencyElectionResult { supports }; + let call = CloseTip { hash }; ::subxt::SubmittableExtrinsic::new(self.client, call) } - pub fn submit( + pub fn slash_tip( &self, - raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, - num_signed_submissions: ::core::primitive::u32, + hash: ::subxt::sp_core::H256, ) -> ::subxt::SubmittableExtrinsic< 'a, T, X, - Submit, + SlashTip, DispatchError, root_mod::Event, > { - let call = Submit { - raw_solution: ::std::boxed::Box::new(raw_solution), - num_signed_submissions, - }; + let call = SlashTip { hash }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } } - pub type Event = - runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub type Event = runtime_types::pallet_tips::pallet::Event; pub mod events { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct SolutionStored { - pub election_compute: - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - pub prev_ejected: ::core::primitive::bool, + pub struct NewTip { + pub tip_hash: ::subxt::sp_core::H256, } - impl ::subxt::Event for SolutionStored { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SolutionStored"; + impl ::subxt::Event for NewTip { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "NewTip"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ElectionFinalized { - pub election_compute: ::core::option::Option< - runtime_types::pallet_election_provider_multi_phase::ElectionCompute, - >, + pub struct TipClosing { + pub tip_hash: ::subxt::sp_core::H256, } - impl ::subxt::Event for ElectionFinalized { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "ElectionFinalized"; + impl ::subxt::Event for TipClosing { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosing"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Rewarded { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub value: ::core::primitive::u128, + pub struct TipClosed { + pub tip_hash: ::subxt::sp_core::H256, + pub who: ::subxt::sp_core::crypto::AccountId32, + pub payout: ::core::primitive::u128, } - impl ::subxt::Event for Rewarded { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Rewarded"; + impl ::subxt::Event for TipClosed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipClosed"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Slashed { - pub account: ::subxt::sp_core::crypto::AccountId32, - pub value: ::core::primitive::u128, - } - impl ::subxt::Event for Slashed { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "Slashed"; - } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct SignedPhaseStarted { - pub round: ::core::primitive::u32, + pub struct TipRetracted { + pub tip_hash: ::subxt::sp_core::H256, } - impl ::subxt::Event for SignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "SignedPhaseStarted"; + impl ::subxt::Event for TipRetracted { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipRetracted"; } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct UnsignedPhaseStarted { - pub round: ::core::primitive::u32, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct TipSlashed { + pub tip_hash: ::subxt::sp_core::H256, + pub finder: ::subxt::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, } - impl ::subxt::Event for UnsignedPhaseStarted { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const EVENT: &'static str = "UnsignedPhaseStarted"; + impl ::subxt::Event for TipSlashed { + const PALLET: &'static str = "Tips"; + const EVENT: &'static str = "TipSlashed"; } } pub mod storage { use super::runtime_types; - pub struct Round; - impl ::subxt::StorageEntry for Round { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "Round"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct CurrentPhase; - impl ::subxt::StorageEntry for CurrentPhase { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "CurrentPhase"; - type Value = runtime_types::pallet_election_provider_multi_phase::Phase< + pub struct Tips<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Tips<'_> { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Tips"; + type Value = runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, ::core::primitive::u32, + ::subxt::sp_core::H256, >; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) } } - pub struct QueuedSolution; - impl ::subxt::StorageEntry for QueuedSolution { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "QueuedSolution"; - type Value = - runtime_types::pallet_election_provider_multi_phase::ReadySolution< - ::subxt::sp_core::crypto::AccountId32, - >; + pub struct Reasons<'a>(pub &'a ::subxt::sp_core::H256); + impl ::subxt::StorageEntry for Reasons<'_> { + const PALLET: &'static str = "Tips"; + const STORAGE: &'static str = "Reasons"; + type Value = ::std::vec::Vec<::core::primitive::u8>; fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) } } - pub struct Snapshot; - impl ::subxt::StorageEntry for Snapshot { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "Snapshot"; - type Value = - runtime_types::pallet_election_provider_multi_phase::RoundSnapshot< - ::subxt::sp_core::crypto::AccountId32, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, } - pub struct DesiredTargets; - impl ::subxt::StorageEntry for DesiredTargets { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "DesiredTargets"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } } - } - pub struct SnapshotMetadata; - impl ::subxt::StorageEntry for SnapshotMetadata { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SnapshotMetadata"; - type Value = runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionNextIndex; - impl ::subxt::StorageEntry for SignedSubmissionNextIndex { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionNextIndex"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionIndices; - impl ::subxt::StorageEntry for SignedSubmissionIndices { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionIndices"; - type Value = runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct SignedSubmissionsMap<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for SignedSubmissionsMap<'_> { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "SignedSubmissionsMap"; - type Value = runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > ; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } - pub struct MinimumUntrustedScore; - impl ::subxt::StorageEntry for MinimumUntrustedScore { - const PALLET: &'static str = "ElectionProviderMultiPhase"; - const STORAGE: &'static str = "MinimumUntrustedScore"; - type Value = [::core::primitive::u128; 3usize]; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn round( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let entry = Round; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn current_phase( + pub async fn tips( &self, + _0: &::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - runtime_types::pallet_election_provider_multi_phase::Phase< - ::core::primitive::u32, + ::core::option::Option< + runtime_types::pallet_tips::OpenTip< + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::sp_core::H256, + >, >, ::subxt::BasicError, > { - let entry = CurrentPhase; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn queued_solution (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError >{ - let entry = QueuedSolution; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError >{ - let entry = Snapshot; + let entry = Tips(_0); self.client.storage().fetch(&entry, hash).await } - pub async fn desired_targets( + pub async fn tips_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, + ::subxt::KeyIter<'a, T, Tips<'a>>, ::subxt::BasicError, > { - let entry = DesiredTargets; - self.client.storage().fetch(&entry, hash).await - } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: BasicError >{ - let entry = SnapshotMetadata; - self.client.storage().fetch(&entry, hash).await - } - pub async fn signed_submission_next_index( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let entry = SignedSubmissionNextIndex; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < [:: core :: primitive :: u128 ; 3usize] , :: core :: primitive :: u32 > , :: subxt :: BasicError >{ - let entry = SignedSubmissionIndices; - self.client.storage().fetch_or_default(&entry, hash).await - } pub async fn signed_submissions_map (& self , _0 : & :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , :: subxt :: BasicError >{ - let entry = SignedSubmissionsMap(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn signed_submissions_map_iter( + pub async fn reasons( &self, + _0: &::subxt::sp_core::H256, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, SignedSubmissionsMap<'a>>, + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, ::subxt::BasicError, > { - self.client.storage().iter(hash).await + let entry = Reasons(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn minimum_untrusted_score( + pub async fn reasons_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<[::core::primitive::u128; 3usize]>, + ::subxt::KeyIter<'a, T, Reasons<'a>>, ::subxt::BasicError, > { - let entry = MinimumUntrustedScore; - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } } } @@ -13065,136 +13147,56 @@ pub mod api { use super::runtime_types; pub struct ConstantsApi; impl ConstantsApi { - pub fn unsigned_phase( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[88u8, 2u8, 0u8, 0u8][..], - )?) - } - pub fn signed_phase( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[88u8, 2u8, 0u8, 0u8][..], - )?) - } - pub fn solution_improvement_threshold( - &self, - ) -> ::core::result::Result< - runtime_types::sp_arithmetic::per_things::Perbill, - ::subxt::BasicError, - > { - Ok(::subxt::codec::Decode::decode( - &mut &[32u8, 161u8, 7u8, 0u8][..], - )?) - } - pub fn offchain_repeat( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[18u8, 0u8, 0u8, 0u8][..], - )?) - } - pub fn miner_tx_priority( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[101u8, 102u8, 102u8, 102u8, 102u8, 102u8, 102u8, 230u8][..], - )?) - } - pub fn miner_max_weight( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[192u8, 132u8, 102u8, 101u8, 87u8, 1u8, 0u8, 0u8][..], - )?) - } - pub fn signed_max_submissions( + pub fn maximum_reason_length( &self, ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( - &mut &[16u8, 0u8, 0u8, 0u8][..], - )?) - } - pub fn signed_max_weight( - &self, - ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[192u8, 132u8, 102u8, 101u8, 87u8, 1u8, 0u8, 0u8][..], + &mut &[0u8, 64u8, 0u8, 0u8][..], )?) } - pub fn signed_reward_base( + pub fn data_deposit_per_byte( &self, ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( &mut &[ - 0u8, 228u8, 11u8, 84u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 225u8, 245u8, 5u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, ][..], )?) } - pub fn signed_deposit_base( + pub fn tip_countdown( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( - &mut &[ - 0u8, 160u8, 219u8, 33u8, 93u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, - 0u8, 0u8, 0u8, 0u8, 0u8, - ][..], + &mut &[64u8, 56u8, 0u8, 0u8][..], )?) } - pub fn signed_deposit_byte( + pub fn tip_finders_fee( &self, - ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[ - 120u8, 125u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, - 0u8, 0u8, 0u8, 0u8, 0u8, - ][..], - )?) + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Percent, + ::subxt::BasicError, + > { + Ok(::subxt::codec::Decode::decode(&mut &[20u8][..])?) } - pub fn signed_deposit_weight( + pub fn tip_report_deposit_base( &self, ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> { Ok(::subxt::codec::Decode::decode( &mut &[ - 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, - 0u8, 0u8, 0u8, 0u8, + 0u8, 228u8, 11u8, 84u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, ][..], )?) } - pub fn voter_snapshot_per_block( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[228u8, 87u8, 0u8, 0u8][..], - )?) - } - pub fn miner_max_length( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[0u8, 0u8, 54u8, 0u8][..], - )?) - } } } } - pub mod bags_list { + pub mod election_provider_multi_phase { use super::root_mod; use super::runtime_types; pub mod calls { @@ -13202,29 +13204,582 @@ pub mod api { use super::runtime_types; type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Rebag { - pub dislocated: ::subxt::sp_core::crypto::AccountId32, - } - impl ::subxt::Call for Rebag { - const PALLET: &'static str = "BagsList"; - const FUNCTION: &'static str = "rebag"; + pub struct SubmitUnsigned { pub raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , pub witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } + impl ::subxt::Call for SubmitUnsigned { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit_unsigned"; } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct PutInFrontOf { - pub lighter: ::subxt::sp_core::crypto::AccountId32, + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: ::core::option::Option< + runtime_types::sp_npos_elections::ElectionScore, + >, } - impl ::subxt::Call for PutInFrontOf { - const PALLET: &'static str = "BagsList"; - const FUNCTION: &'static str = "put_in_front_of"; + impl ::subxt::Call for SetMinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_minimum_untrusted_score"; } - pub struct TransactionApi<'a, T: ::subxt::Config, X> { - client: &'a ::subxt::Client, - marker: ::core::marker::PhantomData, + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SetEmergencyElectionResult { + pub supports: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, } - impl<'a, T, X> TransactionApi<'a, T, X> + impl ::subxt::Call for SetEmergencyElectionResult { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "set_emergency_election_result"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Submit { + pub raw_solution: ::std::boxed::Box< + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::polkadot_runtime::NposCompactSolution16, + >, + >, + } + impl ::subxt::Call for Submit { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "submit"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct GovernanceFallback { + pub maybe_max_voters: ::core::option::Option<::core::primitive::u32>, + pub maybe_max_targets: ::core::option::Option<::core::primitive::u32>, + } + impl ::subxt::Call for GovernanceFallback { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const FUNCTION: &'static str = "governance_fallback"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn submit_unsigned( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SubmitUnsigned, + DispatchError, + root_mod::Event, + > { + let call = SubmitUnsigned { + raw_solution: ::std::boxed::Box::new(raw_solution), + witness, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: ::core::option::Option< + runtime_types::sp_npos_elections::ElectionScore, + >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetMinimumUntrustedScore, + DispatchError, + root_mod::Event, + > { + let call = SetMinimumUntrustedScore { maybe_next_score }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn set_emergency_election_result( + &self, + supports: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + SetEmergencyElectionResult, + DispatchError, + root_mod::Event, + > { + let call = SetEmergencyElectionResult { supports }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn submit( + &self, + raw_solution : runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 >, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + Submit, + DispatchError, + root_mod::Event, + > { + let call = Submit { + raw_solution: ::std::boxed::Box::new(raw_solution), + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + pub fn governance_fallback( + &self, + maybe_max_voters: ::core::option::Option<::core::primitive::u32>, + maybe_max_targets: ::core::option::Option<::core::primitive::u32>, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + GovernanceFallback, + DispatchError, + root_mod::Event, + > { + let call = GovernanceFallback { + maybe_max_voters, + maybe_max_targets, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = + runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct SolutionStored { + pub election_compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub prev_ejected: ::core::primitive::bool, + } + impl ::subxt::Event for SolutionStored { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SolutionStored"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ElectionFinalized { + pub election_compute: ::core::option::Option< + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + >, + } + impl ::subxt::Event for ElectionFinalized { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "ElectionFinalized"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rewarded { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + } + impl ::subxt::Event for Rewarded { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Rewarded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Slashed { + pub account: ::subxt::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + } + impl ::subxt::Event for Slashed { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "Slashed"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct SignedPhaseStarted { + pub round: ::core::primitive::u32, + } + impl ::subxt::Event for SignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "SignedPhaseStarted"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct UnsignedPhaseStarted { + pub round: ::core::primitive::u32, + } + impl ::subxt::Event for UnsignedPhaseStarted { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const EVENT: &'static str = "UnsignedPhaseStarted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct Round; + impl ::subxt::StorageEntry for Round { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Round"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct CurrentPhase; + impl ::subxt::StorageEntry for CurrentPhase { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "CurrentPhase"; + type Value = runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct QueuedSolution; + impl ::subxt::StorageEntry for QueuedSolution { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "QueuedSolution"; + type Value = + runtime_types::pallet_election_provider_multi_phase::ReadySolution< + ::subxt::sp_core::crypto::AccountId32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Snapshot; + impl ::subxt::StorageEntry for Snapshot { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "Snapshot"; + type Value = + runtime_types::pallet_election_provider_multi_phase::RoundSnapshot; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct DesiredTargets; + impl ::subxt::StorageEntry for DesiredTargets { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "DesiredTargets"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SnapshotMetadata; + impl ::subxt::StorageEntry for SnapshotMetadata { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SnapshotMetadata"; + type Value = runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionNextIndex; + impl ::subxt::StorageEntry for SignedSubmissionNextIndex { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionNextIndex"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionIndices; + impl ::subxt::StorageEntry for SignedSubmissionIndices { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionIndices"; + type Value = runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct SignedSubmissionsMap<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for SignedSubmissionsMap<'_> { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "SignedSubmissionsMap"; + type Value = runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > ; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct MinimumUntrustedScore; + impl ::subxt::StorageEntry for MinimumUntrustedScore { + const PALLET: &'static str = "ElectionProviderMultiPhase"; + const STORAGE: &'static str = "MinimumUntrustedScore"; + type Value = runtime_types::sp_npos_elections::ElectionScore; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn round( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = Round; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn current_phase( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >, + ::subxt::BasicError, + > { + let entry = CurrentPhase; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn queued_solution (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: ReadySolution < :: subxt :: sp_core :: crypto :: AccountId32 > > , :: subxt :: BasicError >{ + let entry = QueuedSolution; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: RoundSnapshot > , :: subxt :: BasicError >{ + let entry = Snapshot; + self.client.storage().fetch(&entry, hash).await + } + pub async fn desired_targets( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = DesiredTargets; + self.client.storage().fetch(&entry, hash).await + } pub async fn snapshot_metadata (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize > , :: subxt :: BasicError >{ + let entry = SnapshotMetadata; + self.client.storage().fetch(&entry, hash).await + } + pub async fn signed_submission_next_index( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = SignedSubmissionNextIndex; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submission_indices (& self , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < runtime_types :: frame_support :: storage :: bounded_btree_map :: BoundedBTreeMap < runtime_types :: sp_npos_elections :: ElectionScore , :: core :: primitive :: u32 > , :: subxt :: BasicError >{ + let entry = SignedSubmissionIndices; + self.client.storage().fetch_or_default(&entry, hash).await + } pub async fn signed_submissions_map (& self , _0 : & :: core :: primitive :: u32 , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , :: subxt :: BasicError >{ + let entry = SignedSubmissionsMap(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn signed_submissions_map_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, SignedSubmissionsMap<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn minimum_untrusted_score( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::sp_npos_elections::ElectionScore, + >, + ::subxt::BasicError, + > { + let entry = MinimumUntrustedScore; + self.client.storage().fetch(&entry, hash).await + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + pub fn unsigned_phase( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[88u8, 2u8, 0u8, 0u8][..], + )?) + } + pub fn signed_phase( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[88u8, 2u8, 0u8, 0u8][..], + )?) + } + pub fn solution_improvement_threshold( + &self, + ) -> ::core::result::Result< + runtime_types::sp_arithmetic::per_things::Perbill, + ::subxt::BasicError, + > { + Ok(::subxt::codec::Decode::decode( + &mut &[32u8, 161u8, 7u8, 0u8][..], + )?) + } + pub fn offchain_repeat( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[18u8, 0u8, 0u8, 0u8][..], + )?) + } + pub fn miner_tx_priority( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[101u8, 102u8, 102u8, 102u8, 102u8, 102u8, 102u8, 230u8][..], + )?) + } + pub fn miner_max_weight( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[192u8, 132u8, 102u8, 101u8, 87u8, 1u8, 0u8, 0u8][..], + )?) + } + pub fn signed_max_submissions( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[16u8, 0u8, 0u8, 0u8][..], + )?) + } + pub fn signed_max_weight( + &self, + ) -> ::core::result::Result<::core::primitive::u64, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[192u8, 132u8, 102u8, 101u8, 87u8, 1u8, 0u8, 0u8][..], + )?) + } + pub fn signed_reward_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[ + 0u8, 228u8, 11u8, 84u8, 2u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, + ][..], + )?) + } + pub fn signed_deposit_base( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[ + 0u8, 160u8, 219u8, 33u8, 93u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, + ][..], + )?) + } + pub fn signed_deposit_byte( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[ + 120u8, 125u8, 1u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, 0u8, + ][..], + )?) + } + pub fn signed_deposit_weight( + &self, + ) -> ::core::result::Result<::core::primitive::u128, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[ + 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, 0u8, + 0u8, 0u8, 0u8, 0u8, + ][..], + )?) + } + pub fn max_electing_voters( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[228u8, 87u8, 0u8, 0u8][..], + )?) + } + pub fn max_electable_targets( + &self, + ) -> ::core::result::Result<::core::primitive::u16, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode(&mut &[255u8, 255u8][..])?) + } + pub fn miner_max_length( + &self, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + Ok(::subxt::codec::Decode::decode( + &mut &[0u8, 0u8, 54u8, 0u8][..], + )?) + } + } + } + } + pub mod bags_list { + use super::root_mod; + use super::runtime_types; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Rebag { + pub dislocated: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for Rebag { + const PALLET: &'static str = "BagsList"; + const FUNCTION: &'static str = "rebag"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct PutInFrontOf { + pub lighter: ::subxt::sp_core::crypto::AccountId32, + } + impl ::subxt::Call for PutInFrontOf { + const PALLET: &'static str = "BagsList"; + const FUNCTION: &'static str = "put_in_front_of"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14140,7 +14695,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14871,7 +15426,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14897,7 +15452,7 @@ pub mod api { const PALLET: &'static str = "ParasShared"; const STORAGE: &'static str = "ActiveValidatorIndices"; type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidatorIndex, + runtime_types::polkadot_primitives::v2::ValidatorIndex, >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain @@ -14908,7 +15463,7 @@ pub mod api { const PALLET: &'static str = "ParasShared"; const STORAGE: &'static str = "ActiveValidatorKeys"; type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, + runtime_types::polkadot_primitives::v2::validator_app::Public, >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain @@ -14934,7 +15489,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidatorIndex, + runtime_types::polkadot_primitives::v2::ValidatorIndex, >, ::subxt::BasicError, > { @@ -14946,7 +15501,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, + runtime_types::polkadot_primitives::v2::validator_app::Public, >, ::subxt::BasicError, > { @@ -14970,7 +15525,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -14986,12 +15541,12 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateBacked( - pub runtime_types::polkadot_primitives::v1::CandidateReceipt< + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< ::subxt::sp_core::H256, >, pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v1::CoreIndex, - pub runtime_types::polkadot_primitives::v1::GroupIndex, + pub runtime_types::polkadot_primitives::v2::CoreIndex, + pub runtime_types::polkadot_primitives::v2::GroupIndex, ); impl ::subxt::Event for CandidateBacked { const PALLET: &'static str = "ParaInclusion"; @@ -14999,12 +15554,12 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateIncluded( - pub runtime_types::polkadot_primitives::v1::CandidateReceipt< + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< ::subxt::sp_core::H256, >, pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v1::CoreIndex, - pub runtime_types::polkadot_primitives::v1::GroupIndex, + pub runtime_types::polkadot_primitives::v2::CoreIndex, + pub runtime_types::polkadot_primitives::v2::GroupIndex, ); impl ::subxt::Event for CandidateIncluded { const PALLET: &'static str = "ParaInclusion"; @@ -15012,11 +15567,11 @@ pub mod api { } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct CandidateTimedOut( - pub runtime_types::polkadot_primitives::v1::CandidateReceipt< + pub runtime_types::polkadot_primitives::v2::CandidateReceipt< ::subxt::sp_core::H256, >, pub runtime_types::polkadot_parachain::primitives::HeadData, - pub runtime_types::polkadot_primitives::v1::CoreIndex, + pub runtime_types::polkadot_primitives::v2::CoreIndex, ); impl ::subxt::Event for CandidateTimedOut { const PALLET: &'static str = "ParaInclusion"; @@ -15026,7 +15581,7 @@ pub mod api { pub mod storage { use super::runtime_types; pub struct AvailabilityBitfields<'a>( - pub &'a runtime_types::polkadot_primitives::v0::ValidatorIndex, + pub &'a runtime_types::polkadot_primitives::v2::ValidatorIndex, ); impl ::subxt::StorageEntry for AvailabilityBitfields<'_> { const PALLET: &'static str = "ParaInclusion"; @@ -15059,7 +15614,7 @@ pub mod api { impl ::subxt::StorageEntry for PendingAvailabilityCommitments<'_> { const PALLET: &'static str = "ParaInclusion"; const STORAGE: &'static str = "PendingAvailabilityCommitments"; - type Value = runtime_types::polkadot_primitives::v1::CandidateCommitments< + type Value = runtime_types::polkadot_primitives::v2::CandidateCommitments< ::core::primitive::u32, >; fn key(&self) -> ::subxt::StorageEntryKey { @@ -15075,7 +15630,7 @@ pub mod api { impl<'a, T: ::subxt::Config> StorageApi<'a, T> { pub fn new(client: &'a ::subxt::Client) -> Self { Self { client } - } pub async fn availability_bitfields (& self , _0 : & runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ + } pub async fn availability_bitfields (& self , _0 : & runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , hash : :: core :: option :: Option < T :: Hash > ,) -> :: core :: result :: Result < :: core :: option :: Option < runtime_types :: polkadot_runtime_parachains :: inclusion :: AvailabilityBitfieldRecord < :: core :: primitive :: u32 > > , :: subxt :: BasicError >{ let entry = AvailabilityBitfields(_0); self.client.storage().fetch(&entry, hash).await } @@ -15106,7 +15661,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_primitives::v1::CandidateCommitments< + runtime_types::polkadot_primitives::v2::CandidateCommitments< ::core::primitive::u32, >, >, @@ -15136,7 +15691,7 @@ pub mod api { type DispatchError = runtime_types::sp_runtime::DispatchError; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Enter { - pub data: runtime_types::polkadot_primitives::v1::InherentData< + pub data: runtime_types::polkadot_primitives::v2::InherentData< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -15154,7 +15709,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -15164,7 +15719,7 @@ pub mod api { } pub fn enter( &self, - data: runtime_types::polkadot_primitives::v1::InherentData< + data: runtime_types::polkadot_primitives::v2::InherentData< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -15198,7 +15753,7 @@ pub mod api { impl ::subxt::StorageEntry for OnChainVotes { const PALLET: &'static str = "ParaInherent"; const STORAGE: &'static str = "OnChainVotes"; - type Value = runtime_types::polkadot_primitives::v1::ScrapedOnChainVotes< + type Value = runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< ::subxt::sp_core::H256, >; fn key(&self) -> ::subxt::StorageEntryKey { @@ -15225,7 +15780,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_primitives::v1::ScrapedOnChainVotes< + runtime_types::polkadot_primitives::v2::ScrapedOnChainVotes< ::subxt::sp_core::H256, >, >, @@ -15248,7 +15803,7 @@ pub mod api { const STORAGE: &'static str = "ValidatorGroups"; type Value = ::std::vec::Vec< ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidatorIndex, + runtime_types::polkadot_primitives::v2::ValidatorIndex, >, >; fn key(&self) -> ::subxt::StorageEntryKey { @@ -15270,7 +15825,7 @@ pub mod api { const STORAGE: &'static str = "AvailabilityCores"; type Value = ::std::vec::Vec< ::core::option::Option< - runtime_types::polkadot_primitives::v1::CoreOccupied, + runtime_types::polkadot_primitives::v2::CoreOccupied, >, >; fn key(&self) -> ::subxt::StorageEntryKey { @@ -15320,7 +15875,7 @@ pub mod api { ) -> ::core::result::Result< ::std::vec::Vec< ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidatorIndex, + runtime_types::polkadot_primitives::v2::ValidatorIndex, >, >, ::subxt::BasicError, @@ -15337,7 +15892,7 @@ pub mod api { ) -> ::core::result::Result< ::std::vec::Vec< ::core::option::Option< - runtime_types::polkadot_primitives::v1::CoreOccupied, + runtime_types::polkadot_primitives::v2::CoreOccupied, >, >, ::subxt::BasicError, @@ -15445,7 +16000,7 @@ pub mod api { pub struct IncludePvfCheckStatement { pub stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, pub signature: - runtime_types::polkadot_primitives::v0::validator_app::Signature, + runtime_types::polkadot_primitives::v2::validator_app::Signature, } impl ::subxt::Call for IncludePvfCheckStatement { const PALLET: &'static str = "Paras"; @@ -15458,7 +16013,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -15578,7 +16133,7 @@ pub mod api { pub fn include_pvf_check_statement( &self, stmt: runtime_types::polkadot_primitives::v2::PvfCheckStatement, - signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature, + signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature, ) -> ::subxt::SubmittableExtrinsic< 'a, T, @@ -15825,7 +16380,7 @@ pub mod api { impl ::subxt::StorageEntry for UpgradeGoAheadSignal<'_> { const PALLET: &'static str = "Paras"; const STORAGE: &'static str = "UpgradeGoAheadSignal"; - type Value = runtime_types::polkadot_primitives::v1::UpgradeGoAhead; + type Value = runtime_types::polkadot_primitives::v2::UpgradeGoAhead; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -15839,7 +16394,7 @@ pub mod api { impl ::subxt::StorageEntry for UpgradeRestrictionSignal<'_> { const PALLET: &'static str = "Paras"; const STORAGE: &'static str = "UpgradeRestrictionSignal"; - type Value = runtime_types::polkadot_primitives::v1::UpgradeRestriction; + type Value = runtime_types::polkadot_primitives::v2::UpgradeRestriction; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( &self.0, @@ -16141,7 +16696,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_primitives::v1::UpgradeGoAhead, + runtime_types::polkadot_primitives::v2::UpgradeGoAhead, >, ::subxt::BasicError, > { @@ -16163,7 +16718,7 @@ pub mod api { hash: ::core::option::Option, ) -> ::core::result::Result< ::core::option::Option< - runtime_types::polkadot_primitives::v1::UpgradeRestriction, + runtime_types::polkadot_primitives::v2::UpgradeRestriction, >, ::subxt::BasicError, > { @@ -16321,7 +16876,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16400,7 +16955,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16519,7 +17074,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16825,19 +17380,35 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ForceCleanHrmp { pub para: runtime_types::polkadot_parachain::primitives::Id, + pub inbound: ::core::primitive::u32, + pub outbound: ::core::primitive::u32, } impl ::subxt::Call for ForceCleanHrmp { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "force_clean_hrmp"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceProcessHrmpOpen; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct ForceProcessHrmpOpen { + pub channels: ::core::primitive::u32, + } impl ::subxt::Call for ForceProcessHrmpOpen { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "force_process_hrmp_open"; } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct ForceProcessHrmpClose; + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct ForceProcessHrmpClose { + pub channels: ::core::primitive::u32, + } impl ::subxt::Call for ForceProcessHrmpClose { const PALLET: &'static str = "Hrmp"; const FUNCTION: &'static str = "force_process_hrmp_close"; @@ -16846,6 +17417,7 @@ pub mod api { pub struct HrmpCancelOpenRequest { pub channel_id: runtime_types::polkadot_parachain::primitives::HrmpChannelId, + pub open_requests: ::core::primitive::u32, } impl ::subxt::Call for HrmpCancelOpenRequest { const PALLET: &'static str = "Hrmp"; @@ -16858,7 +17430,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -16917,6 +17489,8 @@ pub mod api { pub fn force_clean_hrmp( &self, para: runtime_types::polkadot_parachain::primitives::Id, + inbound: ::core::primitive::u32, + outbound: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, @@ -16925,11 +17499,16 @@ pub mod api { DispatchError, root_mod::Event, > { - let call = ForceCleanHrmp { para }; + let call = ForceCleanHrmp { + para, + inbound, + outbound, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_process_hrmp_open( &self, + channels: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, @@ -16938,11 +17517,12 @@ pub mod api { DispatchError, root_mod::Event, > { - let call = ForceProcessHrmpOpen {}; + let call = ForceProcessHrmpOpen { channels }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn force_process_hrmp_close( &self, + channels: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, @@ -16951,12 +17531,13 @@ pub mod api { DispatchError, root_mod::Event, > { - let call = ForceProcessHrmpClose {}; + let call = ForceProcessHrmpClose { channels }; ::subxt::SubmittableExtrinsic::new(self.client, call) } pub fn hrmp_cancel_open_request( &self, channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId, + open_requests: ::core::primitive::u32, ) -> ::subxt::SubmittableExtrinsic< 'a, T, @@ -16965,7 +17546,10 @@ pub mod api { DispatchError, root_mod::Event, > { - let call = HrmpCancelOpenRequest { channel_id }; + let call = HrmpCancelOpenRequest { + channel_id, + open_requests, + }; ::subxt::SubmittableExtrinsic::new(self.client, call) } } @@ -17230,278 +17814,535 @@ pub mod api { &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpOpenChannelRequestCount<'a>>, + ::subxt::KeyIter<'a, T, HrmpOpenChannelRequestCount<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn hrmp_accepted_channel_request_count( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = HrmpAcceptedChannelRequestCount(_0); + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_accepted_channel_request_count_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpAcceptedChannelRequestCount<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn hrmp_close_channel_requests( + &self, + _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> + { + let entry = HrmpCloseChannelRequests(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_close_channel_requests_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn hrmp_close_channel_requests_list( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::HrmpChannelId, + >, + ::subxt::BasicError, + > { + let entry = HrmpCloseChannelRequestsList; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn hrmp_watermarks( + &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option<::core::primitive::u32>, + ::subxt::BasicError, + > { + let entry = HrmpWatermarks(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_watermarks_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpWatermarks<'a>>, + ::subxt::BasicError, + > { + self.client.storage().iter(hash).await + } + pub async fn hrmp_channels( + &self, + _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::core::option::Option< + runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, + >, + ::subxt::BasicError, + > { + let entry = HrmpChannels(_0); + self.client.storage().fetch(&entry, hash).await + } + pub async fn hrmp_channels_iter( + &self, + hash: ::core::option::Option, + ) -> ::core::result::Result< + ::subxt::KeyIter<'a, T, HrmpChannels<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - pub async fn hrmp_accepted_channel_request_count( + pub async fn hrmp_ingress_channels_index( &self, _0: &runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let entry = HrmpAcceptedChannelRequestCount(_0); + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + let entry = HrmpIngressChannelsIndex(_0); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_accepted_channel_request_count_iter( + pub async fn hrmp_ingress_channels_index_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpAcceptedChannelRequestCount<'a>>, + ::subxt::KeyIter<'a, T, HrmpIngressChannelsIndex<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - pub async fn hrmp_close_channel_requests( + pub async fn hrmp_egress_channels_index( &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, + _0: &runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, - ) -> ::core::result::Result<::core::option::Option<()>, ::subxt::BasicError> - { - let entry = HrmpCloseChannelRequests(_0); - self.client.storage().fetch(&entry, hash).await + ) -> ::core::result::Result< + ::std::vec::Vec, + ::subxt::BasicError, + > { + let entry = HrmpEgressChannelsIndex(_0); + self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_close_channel_requests_iter( + pub async fn hrmp_egress_channels_index_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpCloseChannelRequests<'a>>, + ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - pub async fn hrmp_close_channel_requests_list( + pub async fn hrmp_channel_contents( &self, + _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, hash: ::core::option::Option, ) -> ::core::result::Result< ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::HrmpChannelId, + runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::primitive::u32, + >, >, ::subxt::BasicError, > { - let entry = HrmpCloseChannelRequestsList; + let entry = HrmpChannelContents(_0); self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_watermarks( + pub async fn hrmp_channel_contents_iter( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option<::core::primitive::u32>, + ::subxt::KeyIter<'a, T, HrmpChannelContents<'a>>, ::subxt::BasicError, > { - let entry = HrmpWatermarks(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn hrmp_watermarks_iter( + pub async fn hrmp_channel_digests( &self, + _0: &runtime_types::polkadot_parachain::primitives::Id, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpWatermarks<'a>>, + ::std::vec::Vec<( + ::core::primitive::u32, + ::std::vec::Vec< + runtime_types::polkadot_parachain::primitives::Id, + >, + )>, ::subxt::BasicError, > { - self.client.storage().iter(hash).await + let entry = HrmpChannelDigests(_0); + self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_channels( + pub async fn hrmp_channel_digests_iter( &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_runtime_parachains::hrmp::HrmpChannel, - >, + ::subxt::KeyIter<'a, T, HrmpChannelDigests<'a>>, ::subxt::BasicError, > { - let entry = HrmpChannels(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn hrmp_channels_iter( + } + } + } + pub mod para_session_info { + use super::root_mod; + use super::runtime_types; + pub mod storage { + use super::runtime_types; + pub struct AssignmentKeysUnsafe; + impl ::subxt::StorageEntry for AssignmentKeysUnsafe { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "AssignmentKeysUnsafe"; + type Value = ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::assignment_app::Public, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct EarliestStoredSession; + impl ::subxt::StorageEntry for EarliestStoredSession { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "EarliestStoredSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Sessions<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for Sessions<'_> { + const PALLET: &'static str = "ParaSessionInfo"; + const STORAGE: &'static str = "Sessions"; + type Value = runtime_types::polkadot_primitives::v2::SessionInfo; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Identity, + )]) + } + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn assignment_keys_unsafe( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannels<'a>>, + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::assignment_app::Public, + >, ::subxt::BasicError, > { - self.client.storage().iter(hash).await + let entry = AssignmentKeysUnsafe; + self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn hrmp_ingress_channels_index( + pub async fn earliest_stored_session( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + hash: ::core::option::Option, + ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> + { + let entry = EarliestStoredSession; + self.client.storage().fetch_or_default(&entry, hash).await + } + pub async fn sessions( + &self, + _0: &::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::std::vec::Vec, + ::core::option::Option< + runtime_types::polkadot_primitives::v2::SessionInfo, + >, ::subxt::BasicError, > { - let entry = HrmpIngressChannelsIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Sessions(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_ingress_channels_index_iter( + pub async fn sessions_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpIngressChannelsIndex<'a>>, + ::subxt::KeyIter<'a, T, Sessions<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - pub async fn hrmp_egress_channels_index( - &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, - hash: ::core::option::Option, - ) -> ::core::result::Result< - ::std::vec::Vec, - ::subxt::BasicError, - > { - let entry = HrmpEgressChannelsIndex(_0); - self.client.storage().fetch_or_default(&entry, hash).await + } + } + } + pub mod paras_disputes { + use super::root_mod; + use super::runtime_types; + pub mod calls { + use super::root_mod; + use super::runtime_types; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ForceUnfreeze; + impl ::subxt::Call for ForceUnfreeze { + const PALLET: &'static str = "ParasDisputes"; + const FUNCTION: &'static str = "force_unfreeze"; + } + pub struct TransactionApi<'a, T: ::subxt::Config, X> { + client: &'a ::subxt::Client, + marker: ::core::marker::PhantomData, + } + impl<'a, T, X> TransactionApi<'a, T, X> + where + T: ::subxt::Config, + X: ::subxt::extrinsic::ExtrinsicParams, + { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { + client, + marker: ::core::marker::PhantomData, + } + } + pub fn force_unfreeze( + &self, + ) -> ::subxt::SubmittableExtrinsic< + 'a, + T, + X, + ForceUnfreeze, + DispatchError, + root_mod::Event, + > { + let call = ForceUnfreeze {}; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } + } + } + pub type Event = + runtime_types::polkadot_runtime_parachains::disputes::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisputeInitiated( + pub runtime_types::polkadot_core_primitives::CandidateHash, + pub runtime_types::polkadot_runtime_parachains::disputes::DisputeLocation, + ); + impl ::subxt::Event for DisputeInitiated { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "DisputeInitiated"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisputeConcluded( + pub runtime_types::polkadot_core_primitives::CandidateHash, + pub runtime_types::polkadot_runtime_parachains::disputes::DisputeResult, + ); + impl ::subxt::Event for DisputeConcluded { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "DisputeConcluded"; + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct DisputeTimedOut( + pub runtime_types::polkadot_core_primitives::CandidateHash, + ); + impl ::subxt::Event for DisputeTimedOut { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "DisputeTimedOut"; + } + #[derive( + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, + )] + pub struct Revert(pub ::core::primitive::u32); + impl ::subxt::Event for Revert { + const PALLET: &'static str = "ParasDisputes"; + const EVENT: &'static str = "Revert"; + } + } + pub mod storage { + use super::runtime_types; + pub struct LastPrunedSession; + impl ::subxt::StorageEntry for LastPrunedSession { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "LastPrunedSession"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain + } + } + pub struct Disputes<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::polkadot_core_primitives::CandidateHash, + ); + impl ::subxt::StorageEntry for Disputes<'_> { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "Disputes"; + type Value = runtime_types::polkadot_primitives::v2::DisputeState< + ::core::primitive::u32, + >; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct Included<'a>( + pub &'a ::core::primitive::u32, + pub &'a runtime_types::polkadot_core_primitives::CandidateHash, + ); + impl ::subxt::StorageEntry for Included<'_> { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "Included"; + type Value = ::core::primitive::u32; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![ + ::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + ), + ::subxt::StorageMapKey::new( + &self.1, + ::subxt::StorageHasher::Blake2_128Concat, + ), + ]) + } + } + pub struct SpamSlots<'a>(pub &'a ::core::primitive::u32); + impl ::subxt::StorageEntry for SpamSlots<'_> { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "SpamSlots"; + type Value = ::std::vec::Vec<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( + &self.0, + ::subxt::StorageHasher::Twox64Concat, + )]) + } + } + pub struct Frozen; + impl ::subxt::StorageEntry for Frozen { + const PALLET: &'static str = "ParasDisputes"; + const STORAGE: &'static str = "Frozen"; + type Value = ::core::option::Option<::core::primitive::u32>; + fn key(&self) -> ::subxt::StorageEntryKey { + ::subxt::StorageEntryKey::Plain } - pub async fn hrmp_egress_channels_index_iter( + } + pub struct StorageApi<'a, T: ::subxt::Config> { + client: &'a ::subxt::Client, + } + impl<'a, T: ::subxt::Config> StorageApi<'a, T> { + pub fn new(client: &'a ::subxt::Client) -> Self { + Self { client } + } + pub async fn last_pruned_session( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpEgressChannelsIndex<'a>>, + ::core::option::Option<::core::primitive::u32>, ::subxt::BasicError, > { - self.client.storage().iter(hash).await + let entry = LastPrunedSession; + self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_channel_contents( + pub async fn disputes( &self, - _0: &runtime_types::polkadot_parachain::primitives::HrmpChannelId, + _0: &::core::primitive::u32, + _1: &runtime_types::polkadot_core_primitives::CandidateHash, hash: ::core::option::Option, ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_core_primitives::InboundHrmpMessage< + ::core::option::Option< + runtime_types::polkadot_primitives::v2::DisputeState< ::core::primitive::u32, >, >, ::subxt::BasicError, > { - let entry = HrmpChannelContents(_0); - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Disputes(_0, _1); + self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_channel_contents_iter( + pub async fn disputes_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelContents<'a>>, + ::subxt::KeyIter<'a, T, Disputes<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - pub async fn hrmp_channel_digests( + pub async fn included( &self, - _0: &runtime_types::polkadot_parachain::primitives::Id, + _0: &::core::primitive::u32, + _1: &runtime_types::polkadot_core_primitives::CandidateHash, hash: ::core::option::Option, ) -> ::core::result::Result< - ::std::vec::Vec<( - ::core::primitive::u32, - ::std::vec::Vec< - runtime_types::polkadot_parachain::primitives::Id, - >, - )>, + ::core::option::Option<::core::primitive::u32>, ::subxt::BasicError, > { - let entry = HrmpChannelDigests(_0); - self.client.storage().fetch_or_default(&entry, hash).await + let entry = Included(_0, _1); + self.client.storage().fetch(&entry, hash).await } - pub async fn hrmp_channel_digests_iter( + pub async fn included_iter( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, HrmpChannelDigests<'a>>, + ::subxt::KeyIter<'a, T, Included<'a>>, ::subxt::BasicError, > { self.client.storage().iter(hash).await } - } - } - } - pub mod para_session_info { - use super::root_mod; - use super::runtime_types; - pub mod storage { - use super::runtime_types; - pub struct AssignmentKeysUnsafe; - impl ::subxt::StorageEntry for AssignmentKeysUnsafe { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "AssignmentKeysUnsafe"; - type Value = ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::assignment_app::Public, - >; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct EarliestStoredSession; - impl ::subxt::StorageEntry for EarliestStoredSession { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "EarliestStoredSession"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Plain - } - } - pub struct Sessions<'a>(pub &'a ::core::primitive::u32); - impl ::subxt::StorageEntry for Sessions<'_> { - const PALLET: &'static str = "ParaSessionInfo"; - const STORAGE: &'static str = "Sessions"; - type Value = runtime_types::polkadot_primitives::v2::SessionInfo; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Identity, - )]) - } - } - pub struct StorageApi<'a, T: ::subxt::Config> { - client: &'a ::subxt::Client, - } - impl<'a, T: ::subxt::Config> StorageApi<'a, T> { - pub fn new(client: &'a ::subxt::Client) -> Self { - Self { client } - } - pub async fn assignment_keys_unsafe( + pub async fn spam_slots( &self, + _0: &::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::assignment_app::Public, - >, + ::core::option::Option<::std::vec::Vec<::core::primitive::u32>>, ::subxt::BasicError, > { - let entry = AssignmentKeysUnsafe; - self.client.storage().fetch_or_default(&entry, hash).await - } - pub async fn earliest_stored_session( - &self, - hash: ::core::option::Option, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - let entry = EarliestStoredSession; - self.client.storage().fetch_or_default(&entry, hash).await + let entry = SpamSlots(_0); + self.client.storage().fetch(&entry, hash).await } - pub async fn sessions( + pub async fn spam_slots_iter( &self, - _0: &::core::primitive::u32, hash: ::core::option::Option, ) -> ::core::result::Result< - ::core::option::Option< - runtime_types::polkadot_primitives::v2::SessionInfo, - >, + ::subxt::KeyIter<'a, T, SpamSlots<'a>>, ::subxt::BasicError, > { - let entry = Sessions(_0); - self.client.storage().fetch(&entry, hash).await + self.client.storage().iter(hash).await } - pub async fn sessions_iter( + pub async fn frozen( &self, hash: ::core::option::Option, ) -> ::core::result::Result< - ::subxt::KeyIter<'a, T, Sessions<'a>>, + ::core::option::Option<::core::primitive::u32>, ::subxt::BasicError, > { - self.client.storage().iter(hash).await + let entry = Frozen; + self.client.storage().fetch_or_default(&entry, hash).await } } } @@ -17575,7 +18416,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -17896,7 +18737,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -18112,7 +18953,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -18540,7 +19381,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -18840,10 +19681,10 @@ pub mod api { ::subxt::StorageEntryKey::Plain } } - pub struct NextTrieIndex; - impl ::subxt::StorageEntry for NextTrieIndex { + pub struct NextFundIndex; + impl ::subxt::StorageEntry for NextFundIndex { const PALLET: &'static str = "Crowdloan"; - const STORAGE: &'static str = "NextTrieIndex"; + const STORAGE: &'static str = "NextFundIndex"; type Value = ::core::primitive::u32; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain @@ -18901,12 +19742,12 @@ pub mod api { let entry = EndingsCount; self.client.storage().fetch_or_default(&entry, hash).await } - pub async fn next_trie_index( + pub async fn next_fund_index( &self, hash: ::core::option::Option, ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> { - let entry = NextTrieIndex; + let entry = NextFundIndex; self.client.storage().fetch_or_default(&entry, hash).await } } @@ -19066,7 +19907,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn new(client: &'a ::subxt::Client) -> Self { Self { @@ -19758,6 +20599,20 @@ pub mod api { } pub mod frame_support { use super::runtime_types; + pub mod dispatch { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Root, + #[codec(index = 1)] + Signed(_0), + #[codec(index = 2)] + None, + } + } pub mod storage { use super::runtime_types; pub mod bounded_btree_map { @@ -20108,15 +20963,6 @@ pub mod api { #[codec(index = 2)] Initialization, } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum RawOrigin<_0> { - #[codec(index = 0)] - Root, - #[codec(index = 1)] - Signed(_0), - #[codec(index = 2)] - None, - } } pub mod pallet_authorship { use super::runtime_types; @@ -20469,6 +21315,8 @@ pub mod api { Premature, #[codec(index = 9)] HasActiveChildBounty, + #[codec(index = 10)] + TooManyQueued, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -20494,34 +21342,168 @@ pub mod api { payout: ::core::primitive::u128, beneficiary: ::subxt::sp_core::crypto::AccountId32, }, - #[codec(index = 5)] - BountyCanceled { index: ::core::primitive::u32 }, - #[codec(index = 6)] - BountyExtended { index: ::core::primitive::u32 }, + #[codec(index = 5)] + BountyCanceled { index: ::core::primitive::u32 }, + #[codec(index = 6)] + BountyExtended { index: ::core::primitive::u32 }, + } + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct Bounty<_0, _1, _2> { + pub proposer: _0, + pub value: _1, + pub fee: _1, + pub curator_deposit: _1, + pub bond: _1, + pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub enum BountyStatus<_0, _1> { + #[codec(index = 0)] + Proposed, + #[codec(index = 1)] + Approved, + #[codec(index = 2)] + Funded, + #[codec(index = 3)] + CuratorProposed { curator: _0 }, + #[codec(index = 4)] + Active { curator: _0, update_due: _1 }, + #[codec(index = 5)] + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, + } + } + pub mod pallet_child_bounties { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + add_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + propose_curator { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + curator: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 2)] + accept_curator { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + #[codec(index = 3)] + unassign_curator { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + award_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::sp_runtime::MultiAddress< + ::subxt::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 5)] + claim_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + #[codec(index = 6)] + close_child_bounty { + #[codec(compact)] + parent_bounty_id: ::core::primitive::u32, + #[codec(compact)] + child_bounty_id: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + ParentBountyNotActive, + #[codec(index = 1)] + InsufficientBountyBalance, + #[codec(index = 2)] + TooManyChildBounties, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + #[codec(index = 0)] + Added { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + Awarded { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 2)] + Claimed { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + payout: ::core::primitive::u128, + beneficiary: ::subxt::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + Canceled { + index: ::core::primitive::u32, + child_index: ::core::primitive::u32, + }, } } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Bounty<_0, _1, _2> { - pub proposer: _0, + pub struct ChildBounty<_0, _1, _2> { + pub parent_bounty: _2, pub value: _1, pub fee: _1, pub curator_deposit: _1, - pub bond: _1, - pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, + pub status: + runtime_types::pallet_child_bounties::ChildBountyStatus<_0, _2>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum BountyStatus<_0, _1> { + pub enum ChildBountyStatus<_0, _1> { #[codec(index = 0)] - Proposed, + Added, #[codec(index = 1)] - Approved, + CuratorProposed { curator: _0 }, #[codec(index = 2)] - Funded, + Active { curator: _0 }, #[codec(index = 3)] - CuratorProposed { curator: _0 }, - #[codec(index = 4)] - Active { curator: _0, update_due: _1 }, - #[codec(index = 5)] PendingPayout { curator: _0, beneficiary: _0, @@ -21025,7 +22007,7 @@ pub mod api { :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { - # [codec (index = 0)] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , # [codec (index = 2)] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } + # [codec (index = 0)] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < runtime_types :: sp_npos_elections :: ElectionScore > , } , # [codec (index = 2)] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: polkadot_runtime :: NposCompactSolution16 > > , } , # [codec (index = 4)] governance_fallback { maybe_max_voters : :: core :: option :: Option < :: core :: primitive :: u32 > , maybe_max_targets : :: core :: option :: Option < :: core :: primitive :: u32 > , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] @@ -21052,6 +22034,8 @@ pub mod api { InvalidSubmissionIndex, #[codec(index = 10)] CallNotAllowed, + #[codec(index = 11)] + FallbackFailed, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -21101,22 +22085,27 @@ pub mod api { #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct RawSolution<_0> { pub solution: _0, - pub score: [::core::primitive::u128; 3usize], + pub score: runtime_types::sp_npos_elections::ElectionScore, pub round: ::core::primitive::u32, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ReadySolution<_0> { pub supports: ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, - pub score: [::core::primitive::u128; 3usize], + pub score: runtime_types::sp_npos_elections::ElectionScore, pub compute: runtime_types::pallet_election_provider_multi_phase::ElectionCompute, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct RoundSnapshot<_0> { - pub voters: - ::std::vec::Vec<(_0, ::core::primitive::u64, ::std::vec::Vec<_0>)>, - pub targets: ::std::vec::Vec<_0>, + pub struct RoundSnapshot { + pub voters: ::std::vec::Vec<( + ::subxt::sp_core::crypto::AccountId32, + ::core::primitive::u64, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, + )>, + pub targets: ::std::vec::Vec<::subxt::sp_core::crypto::AccountId32>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct SolutionOrSnapshotSize { @@ -22245,6 +23234,13 @@ pub mod api { proxy_type: runtime_types::polkadot_runtime::ProxyType, delay: ::core::primitive::u32, }, + #[codec(index = 4)] + ProxyRemoved { + delegator: ::subxt::sp_core::crypto::AccountId32, + delegatee: ::subxt::sp_core::crypto::AccountId32, + proxy_type: runtime_types::polkadot_runtime::ProxyType, + delay: ::core::primitive::u32, + }, } } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] @@ -22390,15 +23386,6 @@ pub mod api { } } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub enum Releases { - #[codec(index = 0)] - V1, - #[codec(index = 1)] - V2, - #[codec(index = 2)] - V3, - } - #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct ScheduledV3<_0, _1, _2, _3> { pub maybe_id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, @@ -22584,22 +23571,50 @@ pub mod api { }, #[codec(index = 23)] set_staking_configs { - min_nominator_bond: ::core::primitive::u128, - min_validator_bond: ::core::primitive::u128, + min_nominator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + min_validator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, max_nominator_count: - ::core::option::Option<::core::primitive::u32>, + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, max_validator_count: - ::core::option::Option<::core::primitive::u32>, - chill_threshold: ::core::option::Option< - runtime_types::sp_arithmetic::per_things::Percent, - >, + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + chill_threshold: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, min_commission: - runtime_types::sp_arithmetic::per_things::Perbill, + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, }, #[codec(index = 24)] chill_other { controller: ::subxt::sp_core::crypto::AccountId32, }, + #[codec(index = 25)] + force_apply_min_commission { + validator_stash: ::subxt::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum ConfigOp<_0> { + #[codec(index = 0)] + Noop, + #[codec(index = 1)] + Set(_0), + #[codec(index = 2)] + Remove, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -22767,8 +23782,11 @@ pub mod api { pub value: _1, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] - pub struct Nominations<_0> { - pub targets: ::std::vec::Vec<_0>, + pub struct Nominations { + pub targets: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::sp_core::crypto::AccountId32, + >, pub submitted_in: ::core::primitive::u32, pub suppressed: ::core::primitive::bool, } @@ -22812,7 +23830,9 @@ pub mod api { #[codec(compact)] pub active: _1, pub unlocking: - ::std::vec::Vec>, + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + runtime_types::pallet_staking::UnlockChunk<_1>, + >, pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] @@ -23502,20 +24522,16 @@ pub mod api { } pub mod polkadot_primitives { use super::runtime_types; - pub mod v0 { + pub mod v2 { use super::runtime_types; - pub mod collator_app { + pub mod assignment_app { use super::runtime_types; #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct Public(pub runtime_types::sp_core::sr25519::Public); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } - pub mod validator_app { + pub mod collator_app { use super::runtime_types; #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -23526,42 +24542,23 @@ pub mod api { )] pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } - #[derive( - :: subxt :: codec :: Encode, - :: subxt :: codec :: Decode, - Debug, - :: subxt :: codec :: CompactAs, - )] - pub struct ValidatorIndex(pub ::core::primitive::u32); - #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, - )] - pub enum ValidityAttestation { - #[codec(index = 1)] - Implicit( - runtime_types::polkadot_primitives::v0::validator_app::Signature, - ), - #[codec(index = 2)] - Explicit( - runtime_types::polkadot_primitives::v0::validator_app::Signature, - ), - } - } - pub mod v1 { - use super::runtime_types; - pub mod assignment_app { + pub mod signed { use super::runtime_types; #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] - pub struct Public(pub runtime_types::sp_core::sr25519::Public); + pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v2 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > } } - pub mod signed { + pub mod validator_app { use super::runtime_types; #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] - pub struct UncheckedSigned < _0 , _1 > { pub payload : _0 , pub validator_index : runtime_types :: polkadot_primitives :: v0 :: ValidatorIndex , pub signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _1 > } + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -23577,11 +24574,11 @@ pub mod api { )] pub struct BackedCandidate<_0> { pub candidate: - runtime_types::polkadot_primitives::v1::CommittedCandidateReceipt< + runtime_types::polkadot_primitives::v2::CommittedCandidateReceipt< _0, >, pub validity_votes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidityAttestation, + runtime_types::polkadot_primitives::v2::ValidityAttestation, >, pub validator_indices: ::subxt::bitvec::vec::BitVec< ::core::primitive::u8, @@ -23614,12 +24611,12 @@ pub mod api { pub para_id: runtime_types::polkadot_parachain::primitives::Id, pub relay_parent: _0, pub collator: - runtime_types::polkadot_primitives::v0::collator_app::Public, + runtime_types::polkadot_primitives::v2::collator_app::Public, pub persisted_validation_data_hash: _0, pub pov_hash: _0, pub erasure_root: _0, pub signature: - runtime_types::polkadot_primitives::v0::collator_app::Signature, + runtime_types::polkadot_primitives::v2::collator_app::Signature, pub para_head: _0, pub validation_code_hash: runtime_types::polkadot_parachain::primitives::ValidationCodeHash, @@ -23629,7 +24626,7 @@ pub mod api { )] pub struct CandidateReceipt<_0> { pub descriptor: - runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, + runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, pub commitments_hash: _0, } #[derive( @@ -23637,9 +24634,9 @@ pub mod api { )] pub struct CommittedCandidateReceipt<_0> { pub descriptor: - runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, + runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, pub commitments: - runtime_types::polkadot_primitives::v1::CandidateCommitments< + runtime_types::polkadot_primitives::v2::CandidateCommitments< ::core::primitive::u32, >, } @@ -23655,15 +24652,30 @@ pub mod api { )] pub enum CoreOccupied { #[codec(index = 0)] - Parathread(runtime_types::polkadot_primitives::v1::ParathreadEntry), + Parathread(runtime_types::polkadot_primitives::v2::ParathreadEntry), #[codec(index = 1)] Parachain, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + pub struct DisputeState<_0> { + pub validators_for: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub validators_against: ::subxt::bitvec::vec::BitVec< + ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, + >, + pub start: _0, + pub concluded_at: ::core::option::Option<_0>, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub enum DisputeStatement { - # [codec (index = 0)] Valid (runtime_types :: polkadot_primitives :: v1 :: ValidDisputeStatementKind ,) , # [codec (index = 1)] Invalid (runtime_types :: polkadot_primitives :: v1 :: InvalidDisputeStatementKind ,) , } + # [codec (index = 0)] Valid (runtime_types :: polkadot_primitives :: v2 :: ValidDisputeStatementKind ,) , # [codec (index = 1)] Invalid (runtime_types :: polkadot_primitives :: v2 :: InvalidDisputeStatementKind ,) , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] @@ -23672,9 +24684,9 @@ pub mod api { runtime_types::polkadot_core_primitives::CandidateHash, pub session: ::core::primitive::u32, pub statements: ::std::vec::Vec<( - runtime_types::polkadot_primitives::v1::DisputeStatement, - runtime_types::polkadot_primitives::v0::ValidatorIndex, - runtime_types::polkadot_primitives::v0::validator_app::Signature, + runtime_types::polkadot_primitives::v2::DisputeStatement, + runtime_types::polkadot_primitives::v2::ValidatorIndex, + runtime_types::polkadot_primitives::v2::validator_app::Signature, )>, } #[derive( @@ -23689,18 +24701,18 @@ pub mod api { )] pub struct InherentData<_0> { pub bitfields: ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::signed::UncheckedSigned< - runtime_types::polkadot_primitives::v1::AvailabilityBitfield, - runtime_types::polkadot_primitives::v1::AvailabilityBitfield, + runtime_types::polkadot_primitives::v2::signed::UncheckedSigned< + runtime_types::polkadot_primitives::v2::AvailabilityBitfield, + runtime_types::polkadot_primitives::v2::AvailabilityBitfield, >, >, pub backed_candidates: ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::BackedCandidate< + runtime_types::polkadot_primitives::v2::BackedCandidate< ::subxt::sp_core::H256, >, >, pub disputes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::DisputeStatementSet, + runtime_types::polkadot_primitives::v2::DisputeStatementSet, >, pub parent_header: _0, } @@ -23716,30 +24728,71 @@ pub mod api { )] pub struct ParathreadClaim( pub runtime_types::polkadot_parachain::primitives::Id, - pub runtime_types::polkadot_primitives::v0::collator_app::Public, + pub runtime_types::polkadot_primitives::v2::collator_app::Public, ); #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct ParathreadEntry { - pub claim: runtime_types::polkadot_primitives::v1::ParathreadClaim, + pub claim: runtime_types::polkadot_primitives::v2::ParathreadClaim, pub retries: ::core::primitive::u32, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] + pub struct PvfCheckStatement { + pub accept: ::core::primitive::bool, + pub subject: + runtime_types::polkadot_parachain::primitives::ValidationCodeHash, + pub session_index: ::core::primitive::u32, + pub validator_index: + runtime_types::polkadot_primitives::v2::ValidatorIndex, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] pub struct ScrapedOnChainVotes<_0> { pub session: ::core::primitive::u32, pub backing_validators_per_candidate: ::std::vec::Vec<( - runtime_types::polkadot_primitives::v1::CandidateReceipt<_0>, + runtime_types::polkadot_primitives::v2::CandidateReceipt<_0>, ::std::vec::Vec<( - runtime_types::polkadot_primitives::v0::ValidatorIndex, - runtime_types::polkadot_primitives::v0::ValidityAttestation, + runtime_types::polkadot_primitives::v2::ValidatorIndex, + runtime_types::polkadot_primitives::v2::ValidityAttestation, )>, )>, pub disputes: ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::DisputeStatementSet, + runtime_types::polkadot_primitives::v2::DisputeStatementSet, + >, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub struct SessionInfo { + pub active_validator_indices: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, + pub random_seed: [::core::primitive::u8; 32usize], + pub dispute_period: ::core::primitive::u32, + pub validators: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::validator_app::Public, + >, + pub discovery_keys: ::std::vec::Vec< + runtime_types::sp_authority_discovery::app::Public, + >, + pub assignment_keys: ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::assignment_app::Public, + >, + pub validator_groups: ::std::vec::Vec< + ::std::vec::Vec< + runtime_types::polkadot_primitives::v2::ValidatorIndex, + >, >, + pub n_cores: ::core::primitive::u32, + pub zeroth_delay_tranche_width: ::core::primitive::u32, + pub relay_vrf_modulo_samples: ::core::primitive::u32, + pub n_delay_tranches: ::core::primitive::u32, + pub no_show_slots: ::core::primitive::u32, + pub needed_approvals: ::core::primitive::u32, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -23770,49 +24823,25 @@ pub mod api { #[codec(index = 3)] ApprovalChecking, } - } - pub mod v2 { - use super::runtime_types; #[derive( - :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + :: subxt :: codec :: Encode, + :: subxt :: codec :: Decode, + Debug, + :: subxt :: codec :: CompactAs, )] - pub struct PvfCheckStatement { - pub accept: ::core::primitive::bool, - pub subject: - runtime_types::polkadot_parachain::primitives::ValidationCodeHash, - pub session_index: ::core::primitive::u32, - pub validator_index: - runtime_types::polkadot_primitives::v0::ValidatorIndex, - } + pub struct ValidatorIndex(pub ::core::primitive::u32); #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] - pub struct SessionInfo { - pub active_validator_indices: ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidatorIndex, - >, - pub random_seed: [::core::primitive::u8; 32usize], - pub dispute_period: ::core::primitive::u32, - pub validators: ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, - >, - pub discovery_keys: ::std::vec::Vec< - runtime_types::sp_authority_discovery::app::Public, - >, - pub assignment_keys: ::std::vec::Vec< - runtime_types::polkadot_primitives::v1::assignment_app::Public, - >, - pub validator_groups: ::std::vec::Vec< - ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::ValidatorIndex, - >, - >, - pub n_cores: ::core::primitive::u32, - pub zeroth_delay_tranche_width: ::core::primitive::u32, - pub relay_vrf_modulo_samples: ::core::primitive::u32, - pub n_delay_tranches: ::core::primitive::u32, - pub no_show_slots: ::core::primitive::u32, - pub needed_approvals: ::core::primitive::u32, + pub enum ValidityAttestation { + #[codec(index = 1)] + Implicit( + runtime_types::polkadot_primitives::v2::validator_app::Signature, + ), + #[codec(index = 2)] + Explicit( + runtime_types::polkadot_primitives::v2::validator_app::Signature, + ), } } } @@ -23820,10 +24849,10 @@ pub mod api { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Call { - # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Call ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Call ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Call ,) , # [codec (index = 2)] Babe (runtime_types :: pallet_babe :: pallet :: Call ,) , # [codec (index = 3)] Timestamp (runtime_types :: pallet_timestamp :: pallet :: Call ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Call ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Call ,) , # [codec (index = 6)] Authorship (runtime_types :: pallet_authorship :: pallet :: Call ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Call ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Call ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Call ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Call ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Call ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Call ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Call ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Call ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Call ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Call ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Call ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Call ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Call ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Call ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Call ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Call ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Call ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Call ,) , # [codec (index = 37)] BagsList (runtime_types :: pallet_bags_list :: pallet :: Call ,) , # [codec (index = 51)] Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , # [codec (index = 52)] ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , # [codec (index = 54)] ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , # [codec (index = 57)] Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , # [codec (index = 58)] Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , # [codec (index = 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)] BagsList (runtime_types :: pallet_bags_list :: pallet :: Call ,) , # [codec (index = 51)] Configuration (runtime_types :: polkadot_runtime_parachains :: configuration :: pallet :: Call ,) , # [codec (index = 52)] ParasShared (runtime_types :: polkadot_runtime_parachains :: shared :: pallet :: Call ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Call ,) , # [codec (index = 54)] ParaInherent (runtime_types :: polkadot_runtime_parachains :: paras_inherent :: pallet :: Call ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Call ,) , # [codec (index = 57)] Initializer (runtime_types :: polkadot_runtime_parachains :: initializer :: pallet :: Call ,) , # [codec (index = 58)] Dmp (runtime_types :: polkadot_runtime_parachains :: dmp :: pallet :: Call ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Call ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Call ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Call ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Call ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Call ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Call ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Call ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Call ,) , } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum Event { - # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] BagsList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Event ,) , } + # [codec (index = 0)] System (runtime_types :: frame_system :: pallet :: Event ,) , # [codec (index = 1)] Scheduler (runtime_types :: pallet_scheduler :: pallet :: Event ,) , # [codec (index = 10)] Preimage (runtime_types :: pallet_preimage :: pallet :: Event ,) , # [codec (index = 4)] Indices (runtime_types :: pallet_indices :: pallet :: Event ,) , # [codec (index = 5)] Balances (runtime_types :: pallet_balances :: pallet :: Event ,) , # [codec (index = 7)] Staking (runtime_types :: pallet_staking :: pallet :: pallet :: Event ,) , # [codec (index = 8)] Offences (runtime_types :: pallet_offences :: pallet :: Event ,) , # [codec (index = 9)] Session (runtime_types :: pallet_session :: pallet :: Event ,) , # [codec (index = 11)] Grandpa (runtime_types :: pallet_grandpa :: pallet :: Event ,) , # [codec (index = 12)] ImOnline (runtime_types :: pallet_im_online :: pallet :: Event ,) , # [codec (index = 14)] Democracy (runtime_types :: pallet_democracy :: pallet :: Event ,) , # [codec (index = 15)] Council (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 16)] TechnicalCommittee (runtime_types :: pallet_collective :: pallet :: Event ,) , # [codec (index = 17)] PhragmenElection (runtime_types :: pallet_elections_phragmen :: pallet :: Event ,) , # [codec (index = 18)] TechnicalMembership (runtime_types :: pallet_membership :: pallet :: Event ,) , # [codec (index = 19)] Treasury (runtime_types :: pallet_treasury :: pallet :: Event ,) , # [codec (index = 24)] Claims (runtime_types :: polkadot_runtime_common :: claims :: pallet :: Event ,) , # [codec (index = 25)] Vesting (runtime_types :: pallet_vesting :: pallet :: Event ,) , # [codec (index = 26)] Utility (runtime_types :: pallet_utility :: pallet :: Event ,) , # [codec (index = 28)] Identity (runtime_types :: pallet_identity :: pallet :: Event ,) , # [codec (index = 29)] Proxy (runtime_types :: pallet_proxy :: pallet :: Event ,) , # [codec (index = 30)] Multisig (runtime_types :: pallet_multisig :: pallet :: Event ,) , # [codec (index = 34)] Bounties (runtime_types :: pallet_bounties :: pallet :: Event ,) , # [codec (index = 38)] ChildBounties (runtime_types :: pallet_child_bounties :: pallet :: Event ,) , # [codec (index = 35)] Tips (runtime_types :: pallet_tips :: pallet :: Event ,) , # [codec (index = 36)] ElectionProviderMultiPhase (runtime_types :: pallet_election_provider_multi_phase :: pallet :: Event ,) , # [codec (index = 37)] BagsList (runtime_types :: pallet_bags_list :: pallet :: Event ,) , # [codec (index = 53)] ParaInclusion (runtime_types :: polkadot_runtime_parachains :: inclusion :: pallet :: Event ,) , # [codec (index = 56)] Paras (runtime_types :: polkadot_runtime_parachains :: paras :: pallet :: Event ,) , # [codec (index = 59)] Ump (runtime_types :: polkadot_runtime_parachains :: ump :: pallet :: Event ,) , # [codec (index = 60)] Hrmp (runtime_types :: polkadot_runtime_parachains :: hrmp :: pallet :: Event ,) , # [codec (index = 62)] ParasDisputes (runtime_types :: polkadot_runtime_parachains :: disputes :: pallet :: Event ,) , # [codec (index = 70)] Registrar (runtime_types :: polkadot_runtime_common :: paras_registrar :: pallet :: Event ,) , # [codec (index = 71)] Slots (runtime_types :: polkadot_runtime_common :: slots :: pallet :: Event ,) , # [codec (index = 72)] Auctions (runtime_types :: polkadot_runtime_common :: auctions :: pallet :: Event ,) , # [codec (index = 73)] Crowdloan (runtime_types :: polkadot_runtime_common :: crowdloan :: pallet :: Event ,) , # [codec (index = 99)] XcmPallet (runtime_types :: pallet_xcm :: pallet :: Event ,) , } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct NposCompactSolution16 { pub votes1: @@ -23953,7 +24982,7 @@ pub mod api { pub enum OriginCaller { #[codec(index = 0)] system( - runtime_types::frame_system::RawOrigin< + runtime_types::frame_support::dispatch::RawOrigin< ::subxt::sp_core::crypto::AccountId32, >, ), @@ -24004,9 +25033,9 @@ pub mod api { pub im_online: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, pub para_validator: - runtime_types::polkadot_primitives::v0::validator_app::Public, + runtime_types::polkadot_primitives::v2::validator_app::Public, pub para_assignment: - runtime_types::polkadot_primitives::v1::assignment_app::Public, + runtime_types::polkadot_primitives::v2::assignment_app::Public, pub authority_discovery: runtime_types::sp_authority_discovery::app::Public, } @@ -24345,7 +25374,7 @@ pub mod api { #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] - pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : :: core :: option :: Option < runtime_types :: sp_runtime :: MultiSigner > , pub deposit : _1 , pub raised : _1 , pub end : _2 , pub cap : _1 , pub last_contribution : runtime_types :: polkadot_runtime_common :: crowdloan :: LastContribution < _2 > , pub first_period : _2 , pub last_period : _2 , pub trie_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > } + pub struct FundInfo < _0 , _1 , _2 , _3 > { pub depositor : _0 , pub verifier : :: core :: option :: Option < runtime_types :: sp_runtime :: MultiSigner > , pub deposit : _1 , pub raised : _1 , pub end : _2 , pub cap : _1 , pub last_contribution : runtime_types :: polkadot_runtime_common :: crowdloan :: LastContribution < _2 > , pub first_period : _2 , pub last_period : _2 , pub fund_index : _2 , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _3 > } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] @@ -24397,6 +25426,8 @@ pub mod api { NotReserved, #[codec(index = 12)] EmptyCode, + #[codec(index = 13)] + CannotSwap, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -24711,6 +25742,61 @@ pub mod api { pub minimum_validation_upgrade_delay: _0, } } + pub mod disputes { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Call { + #[codec(index = 0)] + force_unfreeze, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Error { + #[codec(index = 0)] + DuplicateDisputeStatementSets, + #[codec(index = 1)] + AncientDisputeStatement, + #[codec(index = 2)] + ValidatorIndexOutOfBounds, + #[codec(index = 3)] + InvalidSignature, + #[codec(index = 4)] + DuplicateStatement, + #[codec(index = 5)] + PotentialSpam, + #[codec(index = 6)] + SingleSidedDispute, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum Event { + # [codec (index = 0)] DisputeInitiated (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeLocation ,) , # [codec (index = 1)] DisputeConcluded (runtime_types :: polkadot_core_primitives :: CandidateHash , runtime_types :: polkadot_runtime_parachains :: disputes :: DisputeResult ,) , # [codec (index = 2)] DisputeTimedOut (runtime_types :: polkadot_core_primitives :: CandidateHash ,) , # [codec (index = 3)] Revert (:: core :: primitive :: u32 ,) , } + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DisputeLocation { + #[codec(index = 0)] + Local, + #[codec(index = 1)] + Remote, + } + #[derive( + :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, + )] + pub enum DisputeResult { + #[codec(index = 0)] + Valid, + #[codec(index = 1)] + Invalid, + } + } pub mod dmp { use super::runtime_types; pub mod pallet { @@ -24729,7 +25815,7 @@ pub mod api { :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { - # [codec (index = 0)] 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)] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 4)] force_process_hrmp_open , # [codec (index = 5)] force_process_hrmp_close , # [codec (index = 6)] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , } + # [codec (index = 0)] 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)] hrmp_accept_open_channel { sender : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 2)] hrmp_close_channel { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , } , # [codec (index = 3)] force_clean_hrmp { para : runtime_types :: polkadot_parachain :: primitives :: Id , inbound : :: core :: primitive :: u32 , outbound : :: core :: primitive :: u32 , } , # [codec (index = 4)] force_process_hrmp_open { channels : :: core :: primitive :: u32 , } , # [codec (index = 5)] force_process_hrmp_close { channels : :: core :: primitive :: u32 , } , # [codec (index = 6)] hrmp_cancel_open_request { channel_id : runtime_types :: polkadot_parachain :: primitives :: HrmpChannelId , open_requests : :: core :: primitive :: u32 , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] @@ -24770,6 +25856,8 @@ pub mod api { OpenHrmpChannelDoesntExist, #[codec(index = 17)] OpenHrmpChannelAlreadyConfirmed, + #[codec(index = 18)] + WrongWitness, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -24901,29 +25989,29 @@ pub mod api { pub enum Event { #[codec(index = 0)] CandidateBacked( - runtime_types::polkadot_primitives::v1::CandidateReceipt< + runtime_types::polkadot_primitives::v2::CandidateReceipt< ::subxt::sp_core::H256, >, runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v1::CoreIndex, - runtime_types::polkadot_primitives::v1::GroupIndex, + runtime_types::polkadot_primitives::v2::CoreIndex, + runtime_types::polkadot_primitives::v2::GroupIndex, ), #[codec(index = 1)] CandidateIncluded( - runtime_types::polkadot_primitives::v1::CandidateReceipt< + runtime_types::polkadot_primitives::v2::CandidateReceipt< ::subxt::sp_core::H256, >, runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v1::CoreIndex, - runtime_types::polkadot_primitives::v1::GroupIndex, + runtime_types::polkadot_primitives::v2::CoreIndex, + runtime_types::polkadot_primitives::v2::GroupIndex, ), #[codec(index = 2)] CandidateTimedOut( - runtime_types::polkadot_primitives::v1::CandidateReceipt< + runtime_types::polkadot_primitives::v2::CandidateReceipt< ::subxt::sp_core::H256, >, runtime_types::polkadot_parachain::primitives::HeadData, - runtime_types::polkadot_primitives::v1::CoreIndex, + runtime_types::polkadot_primitives::v2::CoreIndex, ), } } @@ -24932,17 +26020,17 @@ pub mod api { )] pub struct AvailabilityBitfieldRecord<_0> { pub bitfield: - runtime_types::polkadot_primitives::v1::AvailabilityBitfield, + runtime_types::polkadot_primitives::v2::AvailabilityBitfield, pub submitted_at: _0, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct CandidatePendingAvailability<_0, _1> { - pub core: runtime_types::polkadot_primitives::v1::CoreIndex, + pub core: runtime_types::polkadot_primitives::v2::CoreIndex, pub hash: runtime_types::polkadot_core_primitives::CandidateHash, pub descriptor: - runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, + runtime_types::polkadot_primitives::v2::CandidateDescriptor<_0>, pub availability_votes: ::subxt::bitvec::vec::BitVec< ::core::primitive::u8, ::subxt::bitvec::order::Lsb0, @@ -24953,7 +26041,7 @@ pub mod api { >, pub relay_parent_number: _1, pub backed_in_number: _1, - pub backing_group: runtime_types::polkadot_primitives::v1::GroupIndex, + pub backing_group: runtime_types::polkadot_primitives::v2::GroupIndex, } } pub mod initializer { @@ -24973,10 +26061,10 @@ pub mod api { )] pub struct BufferedSessionChange { pub validators: ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, + runtime_types::polkadot_primitives::v2::validator_app::Public, >, pub queued: ::std::vec::Vec< - runtime_types::polkadot_primitives::v0::validator_app::Public, + runtime_types::polkadot_primitives::v2::validator_app::Public, >, pub session_index: ::core::primitive::u32, } @@ -25002,7 +26090,7 @@ pub mod api { :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub enum Call { - # [codec (index = 0)] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 6)] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v2 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v0 :: validator_app :: Signature , } , } + # [codec (index = 0)] force_set_current_code { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 1)] force_set_current_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 2)] force_schedule_code_upgrade { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , relay_parent_number : :: core :: primitive :: u32 , } , # [codec (index = 3)] force_note_new_head { para : runtime_types :: polkadot_parachain :: primitives :: Id , new_head : runtime_types :: polkadot_parachain :: primitives :: HeadData , } , # [codec (index = 4)] force_queue_action { para : runtime_types :: polkadot_parachain :: primitives :: Id , } , # [codec (index = 5)] add_trusted_validation_code { validation_code : runtime_types :: polkadot_parachain :: primitives :: ValidationCode , } , # [codec (index = 6)] poke_unused_validation_code { validation_code_hash : runtime_types :: polkadot_parachain :: primitives :: ValidationCodeHash , } , # [codec (index = 7)] include_pvf_check_statement { stmt : runtime_types :: polkadot_primitives :: v2 :: PvfCheckStatement , signature : runtime_types :: polkadot_primitives :: v2 :: validator_app :: Signature , } , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] @@ -25121,7 +26209,7 @@ pub mod api { pub enum Call { #[codec(index = 0)] enter { - data: runtime_types::polkadot_primitives::v1::InherentData< + data: runtime_types::polkadot_primitives::v2::InherentData< runtime_types::sp_runtime::generic::header::Header< ::core::primitive::u32, runtime_types::sp_runtime::traits::BlakeTwo256, @@ -25158,14 +26246,14 @@ pub mod api { Parachain, #[codec(index = 1)] Parathread( - runtime_types::polkadot_primitives::v0::collator_app::Public, + runtime_types::polkadot_primitives::v2::collator_app::Public, ::core::primitive::u32, ), } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] - pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v1 :: CoreIndex , pub para_id : runtime_types :: polkadot_parachain :: primitives :: Id , pub kind : runtime_types :: polkadot_runtime_parachains :: scheduler :: AssignmentKind , pub group_idx : runtime_types :: polkadot_primitives :: v1 :: GroupIndex , } + pub struct CoreAssignment { pub core : runtime_types :: polkadot_primitives :: v2 :: CoreIndex , pub para_id : runtime_types :: polkadot_parachain :: primitives :: Id , pub kind : runtime_types :: polkadot_runtime_parachains :: scheduler :: AssignmentKind , pub group_idx : runtime_types :: polkadot_primitives :: v2 :: GroupIndex , } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] @@ -25174,7 +26262,7 @@ pub mod api { :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, )] pub struct QueuedParathread { - pub claim: runtime_types::polkadot_primitives::v1::ParathreadEntry, + pub claim: runtime_types::polkadot_primitives::v2::ParathreadEntry, pub core_offset: ::core::primitive::u32, } } @@ -25474,6 +26562,12 @@ pub mod api { pub mod sp_npos_elections { use super::runtime_types; #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ElectionScore { + pub minimal_stake: ::core::primitive::u128, + pub sum_stake: ::core::primitive::u128, + pub sum_stake_squared: ::core::primitive::u128, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub struct Support<_0> { pub total: ::core::primitive::u128, pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, @@ -26108,10 +27202,7 @@ pub mod api { #[codec(index = 2)] BadOrigin, #[codec(index = 3)] - Module { - index: ::core::primitive::u8, - error: ::core::primitive::u8, - }, + Module(runtime_types::sp_runtime::ModuleError), #[codec(index = 4)] ConsumerRemaining, #[codec(index = 5)] @@ -26124,6 +27215,11 @@ pub mod api { Arithmetic(runtime_types::sp_runtime::ArithmeticError), } #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] + pub struct ModuleError { + pub index: ::core::primitive::u8, + pub error: ::core::primitive::u8, + } + #[derive(:: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug)] pub enum MultiSignature { #[codec(index = 0)] Ed25519(runtime_types::sp_core::ed25519::Signature), @@ -27256,8 +28352,8 @@ pub mod api { pub type DispatchError = runtime_types::sp_runtime::DispatchError; impl ::subxt::HasModuleError for runtime_types::sp_runtime::DispatchError { fn module_error_indices(&self) -> Option<(u8, u8)> { - if let &Self::Module { index, error } = self { - Some((index, error)) + if let Self::Module(module_error) = self { + Some((module_error.index, module_error.error)) } else { None } @@ -27270,7 +28366,7 @@ pub mod api { impl ::core::convert::From<::subxt::Client> for RuntimeApi where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { fn from(client: ::subxt::Client) -> Self { Self { @@ -27282,7 +28378,7 @@ pub mod api { impl<'a, T, X> RuntimeApi where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn constants(&'a self) -> ConstantsApi { ConstantsApi @@ -27408,6 +28504,9 @@ pub mod api { pub fn bounties(&self) -> bounties::constants::ConstantsApi { bounties::constants::ConstantsApi } + pub fn child_bounties(&self) -> child_bounties::constants::ConstantsApi { + child_bounties::constants::ConstantsApi + } pub fn tips(&self) -> tips::constants::ConstantsApi { tips::constants::ConstantsApi } @@ -27526,6 +28625,9 @@ pub mod api { pub fn bounties(&self) -> bounties::storage::StorageApi<'a, T> { bounties::storage::StorageApi::new(self.client) } + pub fn child_bounties(&self) -> child_bounties::storage::StorageApi<'a, T> { + child_bounties::storage::StorageApi::new(self.client) + } pub fn tips(&self) -> tips::storage::StorageApi<'a, T> { tips::storage::StorageApi::new(self.client) } @@ -27570,6 +28672,9 @@ pub mod api { pub fn para_session_info(&self) -> para_session_info::storage::StorageApi<'a, T> { para_session_info::storage::StorageApi::new(self.client) } + pub fn paras_disputes(&self) -> paras_disputes::storage::StorageApi<'a, T> { + paras_disputes::storage::StorageApi::new(self.client) + } pub fn registrar(&self) -> registrar::storage::StorageApi<'a, T> { registrar::storage::StorageApi::new(self.client) } @@ -27593,7 +28698,7 @@ pub mod api { impl<'a, T, X> TransactionApi<'a, T, X> where T: ::subxt::Config, - X: ::subxt::ExtrinsicParams, + X: ::subxt::extrinsic::ExtrinsicParams, { pub fn system(&self) -> system::calls::TransactionApi<'a, T, X> { system::calls::TransactionApi::new(self.client) @@ -27676,6 +28781,9 @@ pub mod api { pub fn bounties(&self) -> bounties::calls::TransactionApi<'a, T, X> { bounties::calls::TransactionApi::new(self.client) } + pub fn child_bounties(&self) -> child_bounties::calls::TransactionApi<'a, T, X> { + child_bounties::calls::TransactionApi::new(self.client) + } pub fn tips(&self) -> tips::calls::TransactionApi<'a, T, X> { tips::calls::TransactionApi::new(self.client) } @@ -27714,6 +28822,9 @@ pub mod api { pub fn hrmp(&self) -> hrmp::calls::TransactionApi<'a, T, X> { hrmp::calls::TransactionApi::new(self.client) } + pub fn paras_disputes(&self) -> paras_disputes::calls::TransactionApi<'a, T, X> { + paras_disputes::calls::TransactionApi::new(self.client) + } pub fn registrar(&self) -> registrar::calls::TransactionApi<'a, T, X> { registrar::calls::TransactionApi::new(self.client) } diff --git a/subxt/tests/integration/events.rs b/subxt/tests/integration/events.rs index 8fa6ae5bdb..5d388c9996 100644 --- a/subxt/tests/integration/events.rs +++ b/subxt/tests/integration/events.rs @@ -24,7 +24,6 @@ use crate::{ }; use futures::StreamExt; use sp_keyring::AccountKeyring; -use subxt::Signer; // Check that we can subscribe to non-finalized block events. #[async_std::test] diff --git a/subxt/tests/integration/frame/balances.rs b/subxt/tests/integration/frame/balances.rs index b67333d6bc..564b5232bc 100644 --- a/subxt/tests/integration/frame/balances.rs +++ b/subxt/tests/integration/frame/balances.rs @@ -34,10 +34,7 @@ use sp_runtime::{ AccountId32, MultiAddress, }; -use subxt::{ - Error, - Signer, -}; +use subxt::Error; #[async_std::test] async fn tx_basic_transfer() -> Result<(), subxt::Error> { diff --git a/subxt/tests/integration/frame/staking.rs b/subxt/tests/integration/frame/staking.rs index 7042a9b7a1..121fcfea58 100644 --- a/subxt/tests/integration/frame/staking.rs +++ b/subxt/tests/integration/frame/staking.rs @@ -32,10 +32,7 @@ use sp_core::{ Pair, }; use sp_keyring::AccountKeyring; -use subxt::{ - Error, - Signer, -}; +use subxt::Error; /// Helper function to generate a crypto pair from seed fn get_from_seed(seed: &str) -> sr25519::Pair { diff --git a/subxt/tests/integration/frame/system.rs b/subxt/tests/integration/frame/system.rs index a6e8c50c72..c63e282c4f 100644 --- a/subxt/tests/integration/frame/system.rs +++ b/subxt/tests/integration/frame/system.rs @@ -24,7 +24,6 @@ use crate::{ }; use assert_matches::assert_matches; use sp_keyring::AccountKeyring; -use subxt::Signer; #[async_std::test] async fn storage_account() -> Result<(), subxt::Error> { From 59d8fdd8089e841660af6fb46f375cddad3c2b04 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 24 Mar 2022 12:33:12 +0000 Subject: [PATCH 10/13] clippy fix, and save an allocation when signing --- subxt/src/client.rs | 12 +++++------- subxt/src/extrinsic/params.rs | 8 +------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index fb5bd37cdd..d83e461899 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -320,16 +320,16 @@ where other_params, ); - // 4. construct payload to be signed - let payload_to_be_signed = { + // 4. construct signature + let signature = { let mut bytes = Vec::new(); call_data.encode_to(&mut bytes); additional_and_extra_params.encode_extra_to(&mut bytes); additional_and_extra_params.encode_additional_to(&mut bytes); if bytes.len() > 256 { - sp_core::blake2_256(&bytes).to_vec() + signer.sign(&sp_core::blake2_256(&bytes)) } else { - bytes + signer.sign(&bytes) } }; @@ -342,9 +342,7 @@ where // from address for signature signer.address().encode_to(&mut encoded_inner); // the signature bytes - signer - .sign(&payload_to_be_signed) - .encode_to(&mut encoded_inner); + signature.encode_to(&mut encoded_inner); // attach custom extra params additional_and_extra_params.encode_extra_to(&mut encoded_inner); // and now, call data diff --git a/subxt/src/extrinsic/params.rs b/subxt/src/extrinsic/params.rs index 6f06a573fd..bd9455a668 100644 --- a/subxt/src/extrinsic/params.rs +++ b/subxt/src/extrinsic/params.rs @@ -186,7 +186,7 @@ impl ExtrinsicParams for BaseExtrinsicParams } /// A tip payment. -#[derive(Copy, Clone, Encode)] +#[derive(Copy, Clone, Default, Encode)] pub struct PlainTip { #[codec(compact)] tip: u128, @@ -199,12 +199,6 @@ impl PlainTip { } } -impl Default for PlainTip { - fn default() -> Self { - PlainTip { tip: 0 } - } -} - impl From for PlainTip { fn from(n: u128) -> Self { PlainTip::new(n) From 6012d2a75e3ea50209f9f5ab9638e6ee9e91a900 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Thu, 24 Mar 2022 16:11:08 +0000 Subject: [PATCH 11/13] Remove unnecessary Default clauses --- subxt/src/client.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index d83e461899..c50f14c9d6 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -229,10 +229,7 @@ where self, signer: &(dyn Signer + Send + Sync), other_params: X::OtherParams, - ) -> Result, BasicError> - where - X::OtherParams: Default, - { + ) -> Result, BasicError> { // Sign the call data to create our extrinsic. let extrinsic = self.create_signed(signer, other_params).await?; @@ -277,10 +274,7 @@ where self, signer: &(dyn Signer + Send + Sync), other_params: X::OtherParams, - ) -> Result - where - X::OtherParams: Default, - { + ) -> Result { let extrinsic = self.create_signed(signer, other_params).await?; self.client.rpc().submit_extrinsic(extrinsic).await } From 403d57bed93be07ce89a416ee2097f0719fe9066 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 29 Mar 2022 12:21:11 +0200 Subject: [PATCH 12/13] Tidy up and fix comments. Panic if payload size >4GB --- subxt/src/client.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/subxt/src/client.rs b/subxt/src/client.rs index c50f14c9d6..3033271b96 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -285,7 +285,7 @@ where signer: &(dyn Signer + Send + Sync), other_params: X::OtherParams, ) -> Result { - // 1. get nonce + // 1. Get nonce let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { @@ -305,7 +305,7 @@ where Encoded(bytes) }; - // 3. construct our custom additional/extra params. + // 3. Construct our custom additional/extra params. let additional_and_extra_params = X::new( self.client.runtime_version.spec_version, self.client.runtime_version.transaction_version, @@ -314,7 +314,10 @@ where other_params, ); - // 4. construct signature + // 4. Construct signature. This is compatible with the Encode impl + // for SignedPayload (which is this payload of bytes that we'd like) + // to sign. See: + // https://github.com/paritytech/substrate/blob/9a6d706d8db00abb6ba183839ec98ecd9924b1f8/primitives/runtime/src/generic/unchecked_extrinsic.rs#L215) let signature = { let mut bytes = Vec::new(); call_data.encode_to(&mut bytes); @@ -327,8 +330,8 @@ where } }; - // 5. Encode extrinsic, now that we have the parts we need. - // (this may not be 100% correct but should be close enough for this example) + // 5. Encode extrinsic, now that we have the parts we need. This is compatible + // with the Encode impl for UncheckedExtrinsic (protocol version 4). let extrinsic = { let mut encoded_inner = Vec::new(); // "is signed" + transaction protocol version (4) @@ -342,7 +345,10 @@ where // and now, call data call_data.encode_to(&mut encoded_inner); // now, prefix byte length: - let len = Compact(encoded_inner.len() as u64); + let len = Compact( + u32::try_from(encoded_inner.len()) + .expect("extrinsic size expected to be <4GB"), + ); let mut encoded = Vec::new(); len.encode_to(&mut encoded); encoded.extend(encoded_inner); From 251d07ddeae3d708b37af0c19833ab0f321fba05 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Tue, 29 Mar 2022 12:40:55 +0200 Subject: [PATCH 13/13] fix typo --- subxt/src/extrinsic/params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subxt/src/extrinsic/params.rs b/subxt/src/extrinsic/params.rs index bd9455a668..981cbc6abb 100644 --- a/subxt/src/extrinsic/params.rs +++ b/subxt/src/extrinsic/params.rs @@ -32,7 +32,7 @@ pub use sp_runtime::generic::Era; /// see [`BaseExtrinsicParams`] for an implementation that is compatible with /// a Polkadot node. pub trait ExtrinsicParams { - /// Thexe parameters can be provided to the constructor along with + /// These parameters can be provided to the constructor along with /// some default parameters that `subxt` understands, in order to /// help construct your [`ExtrinsicParams`] object. type OtherParams;