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/codegen/src/api/calls.rs b/codegen/src/api/calls.rs index 4fc531f499..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::SignedExtra, + 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 277983b6cd..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::SignedExtra + 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::SignedExtra, + 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::SignedExtra, + 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 50e24dbd5c..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 @@ -26,8 +26,8 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -43,12 +43,12 @@ 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) - .sign_and_submit(&signer) + .transfer(dest, 123_456_789_012_345) + .sign_and_submit_default(&signer) .await?; println!("Balance transfer extrinsic submitted: {}", hash); 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 ad2b9d0a30..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 @@ -27,8 +27,8 @@ use subxt::{ ClientBuilder, Config, DefaultConfig, - DefaultExtra, 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(); @@ -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/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 46bac8eb5a..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 @@ -25,7 +25,7 @@ use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + 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 017e306548..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, - DefaultExtra, + 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/polkadot_metadata.scale b/examples/examples/polkadot_metadata.scale index 73177314a1..a9bb72cf6a 100644 Binary files a/examples/examples/polkadot_metadata.scale and b/examples/examples/polkadot_metadata.scale differ diff --git a/examples/examples/rpc_call.rs b/examples/examples/rpc_call.rs index 71eafd1f34..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 @@ -25,7 +25,7 @@ use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, + 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 6ca86a57ad..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 @@ -27,8 +27,8 @@ use sp_keyring::AccountKeyring; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, PairSigner, + PolkadotExtrinsicParams, }; #[subxt::subxt(runtime_metadata_path = "examples/polkadot_metadata.scale")] @@ -55,13 +55,13 @@ async fn simple_transfer() -> Result<(), Box> { let api = ClientBuilder::new() .build() .await? - .to_runtime_api::>>(); + .to_runtime_api::>>(); let balance_transfer = api .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?; @@ -87,13 +87,13 @@ async fn simple_transfer_separate_events() -> Result<(), Box>>(); + .to_runtime_api::>>(); let balance_transfer = api .tx() .balances() .transfer(dest, 10_000) - .sign_and_submit_then_watch(&signer) + .sign_and_submit_then_watch_default(&signer) .await? .wait_for_finalized() .await?; @@ -138,13 +138,13 @@ 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() .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..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 @@ -28,8 +28,8 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, 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; @@ -65,7 +69,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..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 @@ -28,8 +28,8 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, 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,18 +58,22 @@ 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 { 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..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 @@ -28,8 +28,8 @@ use std::time::Duration; use subxt::{ ClientBuilder, DefaultConfig, - DefaultExtra, 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,18 +59,22 @@ 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 { 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/src/client.rs b/subxt/src/client.rs index 9d1f710438..3033271b96 100644 --- a/subxt/src/client.rs +++ b/subxt/src/client.rs @@ -24,10 +24,8 @@ use crate::{ HasModuleError, }, extrinsic::{ - self, - SignedExtra, + ExtrinsicParams, Signer, - UncheckedExtrinsic, }, rpc::{ Rpc, @@ -39,9 +37,14 @@ use crate::{ transaction::TransactionProgress, Call, Config, + Encoded, Metadata, }; -use codec::Decode; +use codec::{ + Compact, + Decode, + Encode, +}; use derivative::Derivative; use std::sync::Arc; @@ -188,7 +191,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, @@ -202,20 +205,33 @@ where } } - /// Creates and signs an extrinsic and submits it to the chain. + /// 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( + pub async fn sign_and_submit_then_watch_default( self, - signer: &(dyn Signer + Send + Sync), + signer: &(dyn Signer + Send + Sync), ) -> Result, BasicError> where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, + 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 + /// 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), + other_params: X::OtherParams, + ) -> Result, BasicError> { // 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); @@ -226,7 +242,9 @@ where Ok(TransactionProgress::new(sub, self.client, ext_hash)) } - /// Creates and signs an extrinsic and submits to the chain for block inclusion. + /// 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. /// @@ -234,28 +252,40 @@ where /// /// 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( + pub async fn sign_and_submit_default( self, - signer: &(dyn Signer + Send + Sync), + signer: &(dyn Signer + Send + Sync), ) -> Result where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, + X::OtherParams: Default, { - let extrinsic = self.create_signed(signer, Default::default()).await?; + 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. + /// + /// # Note + /// + /// Success does not mean the extrinsic has been included in the block, just that it is valid + /// and has been included in the transaction pool. + pub async fn sign_and_submit( + self, + signer: &(dyn Signer + Send + Sync), + other_params: X::OtherParams, + ) -> Result { + 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::Parameters, - ) -> Result, BasicError> - where - <>::Extra as SignedExtension>::AdditionalSigned: - Send + Sync + 'static, - { + signer: &(dyn Signer + Send + Sync), + other_params: X::OtherParams, + ) -> Result { + // 1. Get nonce let account_nonce = if let Some(nonce) = signer.nonce() { nonce } else { @@ -264,21 +294,69 @@ 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 = { + let mut bytes = Vec::new(); + let pallet = self.client.metadata().pallet(C::PALLET)?; + bytes.push(pallet.index()); + bytes.push(pallet.call_index::()?); + self.call.encode_to(&mut bytes); + Encoded(bytes) + }; + + // 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, - additional_params, - ) - .await?; - Ok(signed) + self.client.genesis_hash, + other_params, + ); + + // 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); + additional_and_extra_params.encode_extra_to(&mut bytes); + additional_and_extra_params.encode_additional_to(&mut bytes); + if bytes.len() > 256 { + signer.sign(&sp_core::blake2_256(&bytes)) + } else { + signer.sign(&bytes) + } + }; + + // 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) + (0b10000000 + 4u8).encode_to(&mut encoded_inner); + // from address for signature + signer.address().encode_to(&mut encoded_inner); + // the signature bytes + signature.encode_to(&mut encoded_inner); + // attach custom extra params + additional_and_extra_params.encode_extra_to(&mut encoded_inner); + // and now, call data + call_data.encode_to(&mut encoded_inner); + // now, prefix byte length: + 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); + 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.. + 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 deleted file mode 100644 index 7a456e4a5c..0000000000 --- a/subxt/src/extrinsic/extra.rs +++ /dev/null @@ -1,481 +0,0 @@ -// Copyright 2019-2022 Parity Technologies (UK) Ltd. -// This file is part of subxt. -// -// subxt is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// subxt is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with subxt. If not, see . - -use crate::PhantomDataSendSync; -use codec::{ - Decode, - Encode, -}; -use derivative::Derivative; -use scale_info::TypeInfo; -use sp_runtime::{ - generic::Era, - traits::{ - DispatchInfoOf, - SignedExtension, - }, - transaction_validity::TransactionValidityError, -}; - -use crate::Config; - -/// 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>; diff --git a/subxt/src/extrinsic/mod.rs b/subxt/src/extrinsic/mod.rs index d87d491f2f..60b256dfaf 100644 --- a/subxt/src/extrinsic/mod.rs +++ b/subxt/src/extrinsic/mod.rs @@ -16,74 +16,22 @@ //! Create signed or unsigned extrinsics. -mod extra; +mod params; mod signer; pub use self::{ - extra::{ - ChargeAssetTxPayment, - ChargeTransactionPayment, - CheckGenesis, - CheckMortality, - CheckNonce, - CheckSpecVersion, - CheckTxVersion, - CheckWeight, - DefaultExtra, - DefaultExtraWithTxPayment, - SignedExtra, + params::{ + AssetTip, + Era, + ExtrinsicParams, + PlainTip, + PolkadotExtrinsicParams, + PolkadotExtrinsicParamsBuilder, + SubstrateExtrinsicParams, + SubstrateExtrinsicParamsBuilder, }, 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/params.rs b/subxt/src/extrinsic/params.rs new file mode 100644 index 0000000000..981cbc6abb --- /dev/null +++ b/subxt/src/extrinsic/params.rs @@ -0,0 +1,237 @@ +// Copyright 2019-2022 Parity Technologies (UK) Ltd. +// This file is part of subxt. +// +// subxt is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// subxt is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with subxt. If not, see . + +use codec::{ + Compact, + Encode, +}; + +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 +/// a Polkadot node. +pub trait ExtrinsicParams { + /// 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; + + /// Construct a new instance of our [`ExtrinsicParams`] + fn new( + spec_version: u32, + tx_version: u32, + nonce: T::Index, + genesis_hash: T::Hash, + 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); +} + +/// 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 `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 `sign_and_submit()`. +pub type PolkadotExtrinsicParamsBuilder = BaseExtrinsicParamsBuilder; + +/// 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. 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 can define your own type which +/// implements the [`ExtrinsicParams`] trait. +pub struct BaseExtrinsicParams { + era: Era, + nonce: T::Index, + tip: Tip, + spec_version: u32, + transaction_version: u32, + genesis_hash: T::Hash, + mortality_checkpoint: T::Hash, + marker: std::marker::PhantomData, +} + +/// 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, + tip: Tip, +} + +impl BaseExtrinsicParamsBuilder { + /// Instantiate the default set of [`BaseExtrinsicParamsBuilder`] + pub fn new() -> Self { + Self::default() + } + + /// 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); + self + } + + /// Set the tip you'd like to give to the block author + /// for this transaction. + pub fn tip(mut self, tip: impl Into) -> Self { + self.tip = tip.into(); + self + } +} + +impl Default for BaseExtrinsicParamsBuilder { + fn default() -> Self { + Self { + era: Era::Immortal, + mortality_checkpoint: None, + tip: Tip::default(), + } + } +} + +impl ExtrinsicParams for BaseExtrinsicParams { + type OtherParams = BaseExtrinsicParamsBuilder; + + 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 { + BaseExtrinsicParams { + 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, + } + } + + fn encode_extra_to(&self, v: &mut Vec) { + let nonce: u64 = self.nonce.into(); + let tip = Encoded(self.tip.encode()); + (self.era, Compact(nonce), 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); + } +} + +/// A tip payment. +#[derive(Copy, Clone, Default, Encode)] +pub struct PlainTip { + #[codec(compact)] + tip: u128, +} + +impl PlainTip { + /// Create a new tip of the amount provided. + pub fn new(amount: u128) -> Self { + PlainTip { tip: amount } + } +} + +impl From for PlainTip { + fn from(n: u128) -> Self { + PlainTip::new(n) + } +} + +/// 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. + /// 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 65f5fef0f1..694c567a60 100644 --- a/subxt/src/extrinsic/signer.rs +++ b/subxt/src/extrinsic/signer.rs @@ -17,58 +17,51 @@ //! 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> { - /// Returns the account id. - fn account_id(&self) -> &T::AccountId; - +/// 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 { /// 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; + + /// 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. - async fn sign( - &self, - extrinsic: SignedPayload, - ) -> Result, String>; + fn sign(&self, signer_payload: &[u8]) -> T::Signature; } -/// Extrinsic signer using a private key. +/// 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, - marker: std::marker::PhantomData, } -impl PairSigner +impl PairSigner where T: Config, - E: SignedExtra, T::Signature: From, ::Signer: From + IdentifyAccount, 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(); @@ -76,11 +69,11 @@ where account_id, nonce: None, signer, - marker: Default::default(), } } - /// 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); } @@ -90,43 +83,37 @@ 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 } + + /// Return the account ID. + pub fn account_id(&self) -> &T::AccountId { + &self.account_id + } } -#[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, + 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 address(&self) -> T::Address { + self.account_id.clone().into() } - 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 sign(&self, signer_payload: &[u8]) -> T::Signature { + self.signer.sign(signer_payload).into() } } diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index dc4e1e2723..0e808387b8 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -90,12 +90,11 @@ pub use crate::{ RawEventDetails, }, extrinsic::{ - DefaultExtra, - DefaultExtraWithTxPayment, PairSigner, - SignedExtra, - Signer, - UncheckedExtrinsic, + PolkadotExtrinsicParams, + PolkadotExtrinsicParamsBuilder, + SubstrateExtrinsicParams, + SubstrateExtrinsicParamsBuilder, }, metadata::{ ErrorMetadata, diff --git a/subxt/src/metadata.rs b/subxt/src/metadata.rs index 491112919e..4529c8cff7 100644 --- a/subxt/src/metadata.rs +++ b/subxt/src/metadata.rs @@ -30,10 +30,7 @@ use frame_metadata::{ META_RESERVED, }; -use crate::{ - Call, - Encoded, -}; +use crate::Call; use scale_info::{ form::PortableForm, Type, @@ -148,18 +145,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. diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs index eca60c0583..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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, - { - 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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::SignedExtra, + 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 44f00845e6..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] @@ -118,7 +117,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..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> { @@ -62,7 +59,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 +115,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 +160,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 +200,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 +212,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 +239,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..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, - NodeRuntimeSignedExtra, + NodeRuntimeParams, 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..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 { @@ -58,7 +55,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 +72,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 +155,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 +170,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 +194,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 +210,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..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> { @@ -52,7 +51,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 NodeRuntimeParams = SubstrateExtrinsicParams; 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 { @@ -76,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) }