diff --git a/CHANGELOG.md b/CHANGELOG.md index 53fb99055a..307c857730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Update scale-info and parity-scale-codec requirements ([#462](https://github.com/paritytech/subxt/pull/462)) + ## [0.17.0] - 2022-02-04 ### Added diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 916999e367..d3bc383914 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -30,9 +30,9 @@ serde_json = "1.0.68" # hex encoded metadata to bytes hex = "0.4.3" # actual metadata types -frame-metadata = { version = "14.0.0", features = ["v14", "std"] } +frame-metadata = { version = "15.0.0", features = ["v14", "std"] } # decode bytes into the metadata types -scale = { package = "parity-scale-codec", version = "2.3.0", default-features = false } +scale = { package = "parity-scale-codec", version = "3.0.0", default-features = false } # handle urls to communicate with substrate nodes url = { version = "2.2.2", features = ["serde"] } # generate the item mod for codegen diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 75965e344f..1bded4c759 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -12,17 +12,17 @@ description = "Generate an API for interacting with a substrate node from FRAME [dependencies] async-trait = "0.1.49" -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } darling = "0.13.0" -frame-metadata = "14.0" +frame-metadata = "15.0.0" heck = "0.4.0" proc-macro2 = "1.0.24" proc-macro-crate = "0.1.5" proc-macro-error = "1.0.4" quote = "1.0.8" syn = "1.0.58" -scale-info = { version = "1.0.0", features = ["bit-vec"] } +scale-info = { version = "2.0.0", features = ["bit-vec"] } [dev-dependencies] -bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } +bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } pretty_assertions = "1.0.0" diff --git a/codegen/src/types/tests.rs b/codegen/src/types/tests.rs index 639ce2a949..507ca92ffa 100644 --- a/codegen/src/types/tests.rs +++ b/codegen/src/types/tests.rs @@ -686,8 +686,8 @@ fn generate_bitvec() { #[allow(unused)] #[derive(TypeInfo)] struct S { - lsb: BitVec, - msb: BitVec, + lsb: BitVec, + msb: BitVec, } let mut registry = Registry::new(); @@ -710,8 +710,8 @@ fn generate_bitvec() { use super::root; #[derive(::subxt::codec::Encode, ::subxt::codec::Decode, Debug)] pub struct S { - pub lsb: ::subxt::bitvec::vec::BitVec, - pub msb: ::subxt::bitvec::vec::BitVec, + pub lsb: ::subxt::bitvec::vec::BitVec<::core::primitive::u8, root::bitvec::order::Lsb0>, + pub msb: ::subxt::bitvec::vec::BitVec<::core::primitive::u16, root::bitvec::order::Msb0>, } } } diff --git a/codegen/src/types/type_path.rs b/codegen/src/types/type_path.rs index b0c239954c..8a04cd8608 100644 --- a/codegen/src/types/type_path.rs +++ b/codegen/src/types/type_path.rs @@ -179,7 +179,7 @@ impl TypePathType { let bit_order_type = &self.params[0]; let bit_store_type = &self.params[1]; - let type_path = parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_order_type, #bit_store_type> }; + let type_path = parse_quote! { ::subxt::bitvec::vec::BitVec<#bit_store_type, #bit_order_type> }; syn::Type::Path(type_path) } diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 8d8cbf21b1..14f743b36e 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -14,8 +14,8 @@ description = "Subxt example usage" [dev-dependencies] subxt = { path = "../subxt" } async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } -sp-keyring = "5.0.0" +sp-keyring = "6.0.0" env_logger = "0.9.0" futures = "0.3.13" -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } hex = "0.4.3" diff --git a/macro/Cargo.toml b/macro/Cargo.toml index c8165e2da6..38662f5f8b 100644 --- a/macro/Cargo.toml +++ b/macro/Cargo.toml @@ -16,16 +16,16 @@ proc-macro = true [dependencies] async-trait = "0.1.49" -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full"] } darling = "0.13.0" -frame-metadata = "14.0" +frame-metadata = "15.0.0" heck = "0.4.0" proc-macro2 = "1.0.24" proc-macro-crate = "0.1.5" proc-macro-error = "1.0.4" quote = "1.0.8" syn = "1.0.58" -scale-info = "1.0.0" +scale-info = "2.0.0" subxt-codegen = { path = "../codegen", version = "0.17.0" } @@ -33,4 +33,4 @@ subxt-codegen = { path = "../codegen", version = "0.17.0" } pretty_assertions = "1.0.0" subxt = { path = "../subxt" } trybuild = "1.0.38" -sp-keyring = "5.0.0" +sp-keyring = "6.0.0" diff --git a/subxt/Cargo.toml b/subxt/Cargo.toml index dd22638ba8..72eb38d327 100644 --- a/subxt/Cargo.toml +++ b/subxt/Cargo.toml @@ -14,10 +14,10 @@ keywords = ["parity", "substrate", "blockchain"] [dependencies] async-trait = "0.1.49" -bitvec = { version = "0.20.1", default-features = false, features = ["alloc"] } -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } +bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } chameleon = "0.1.0" -scale-info = { version = "1.0.0", features = ["bit-vec"] } +scale-info = { version = "2.0.0", features = ["bit-vec"] } futures = "0.3.13" hex = "0.4.3" jsonrpsee = { version = "0.8.0", features = ["async-client", "client-ws-transport"] } @@ -29,15 +29,15 @@ thiserror = "1.0.24" subxt-macro = { version = "0.17.0", path = "../macro" } -sp-core = { version = "5.0.0", default-features = false } -sp-runtime = "5.0.0" -sp-version = "4.0.0" +sp-core = { version = "6.0.0", default-features = false } +sp-runtime = "6.0.0" +sp-version = "5.0.0" -frame-metadata = "14.0.0" +frame-metadata = "15.0.0" derivative = "2.2.0" [dev-dependencies] -sp-arithmetic = { version = "4.0.0", default-features = false } +sp-arithmetic = { version = "5.0.0", default-features = false } assert_matches = "1.5.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } env_logger = "0.9.0" @@ -45,4 +45,4 @@ tempdir = "0.3.7" wabt = "0.10.0" which = "4.0.2" test-runtime = { path = "../test-runtime" } -sp-keyring = "5.0.0" +sp-keyring = "6.0.0" diff --git a/subxt/src/events/decoding.rs b/subxt/src/events/decoding.rs index e2ea7834e8..6594f39b3e 100644 --- a/subxt/src/events/decoding.rs +++ b/subxt/src/events/decoding.rs @@ -189,16 +189,16 @@ pub fn decode_and_consume_type( // used lines up in terms of the number of bytes it will take to encode/decode it. match bit_store_def { TypeDef::Primitive(TypeDefPrimitive::U8) => { - consume_type::>(input) + consume_type::>(input) } TypeDef::Primitive(TypeDefPrimitive::U16) => { - consume_type::>(input) + consume_type::>(input) } TypeDef::Primitive(TypeDefPrimitive::U32) => { - consume_type::>(input) + consume_type::>(input) } TypeDef::Primitive(TypeDefPrimitive::U64) => { - consume_type::>(input) + consume_type::>(input) } store => { return Err(EventsDecodingError::InvalidBitSequenceType(format!( @@ -272,31 +272,31 @@ mod tests { use bitvec::order::Msb0; decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Lsb0, u8; 0, 1, 1, 0, 1], + bitvec::bitvec![u8, Lsb0; 0, 1, 1, 0, 1], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Msb0, u8; 0, 1, 1, 0, 1, 0, 1, 0, 0], + bitvec::bitvec![u8, Msb0; 0, 1, 1, 0, 1, 0, 1, 0, 0], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Lsb0, u16; 0, 1, 1, 0, 1], + bitvec::bitvec![u16, Lsb0; 0, 1, 1, 0, 1], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Msb0, u16; 0, 1, 1, 0, 1, 0, 1, 0, 0], + bitvec::bitvec![u16, Msb0; 0, 1, 1, 0, 1, 0, 1, 0, 0], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Lsb0, u32; 0, 1, 1, 0, 1], + bitvec::bitvec![u32, Lsb0; 0, 1, 1, 0, 1], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Msb0, u32; 0, 1, 1, 0, 1, 0, 1, 0, 0], + bitvec::bitvec![u32, Msb0; 0, 1, 1, 0, 1, 0, 1, 0, 0], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Lsb0, u64; 0, 1, 1, 0, 1], + bitvec::bitvec![u64, Lsb0; 0, 1, 1, 0, 1], ); decode_and_consume_type_consumes_all_bytes( - bitvec::bitvec![Msb0, u64; 0, 1, 1, 0, 1, 0, 1, 0, 0], + bitvec::bitvec![u64, Msb0; 0, 1, 1, 0, 1, 0, 1, 0, 0], ); } @@ -434,7 +434,7 @@ mod tests { }); decode_and_consume_type_consumes_all_bytes(CompositeV3 { id: 10, - extra: bitvec::bitvec![Lsb0, u8; 0, 1, 1, 0, 1], + extra: bitvec::bitvec![u8, Lsb0; 0, 1, 1, 0, 1], }); decode_and_consume_type_consumes_all_bytes(CompositeV3 { id: 10, diff --git a/subxt/src/lib.rs b/subxt/src/lib.rs index ccd8a91127..f7620a710c 100644 --- a/subxt/src/lib.rs +++ b/subxt/src/lib.rs @@ -195,7 +195,7 @@ impl WrapperKeepOpaque { /// /// Returns `None` if the decoding failed. pub fn try_decode(&self) -> Option { - T::decode_all(&self.data[..]).ok() + T::decode_all(&mut &self.data[..]).ok() } /// Returns the length of the encoded `T`. diff --git a/subxt/tests/integration/codegen/polkadot.rs b/subxt/tests/integration/codegen/polkadot.rs index 99641f1616..13a71e40d3 100644 --- a/subxt/tests/integration/codegen/polkadot.rs +++ b/subxt/tests/integration/codegen/polkadot.rs @@ -1,4 +1,3 @@ -// Note [jsdw]: generated from polkadot 0.9.13-82616422d0-aarch64-macos #[allow(dead_code, unused_imports, non_camel_case_types)] pub mod api { use super::api as root_mod; @@ -821,7 +820,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, 210u8, 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, @@ -839,7 +838,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, 11u8, 0u8, 0u8, 0u8, 0u8, ][..], )?) } @@ -1204,15 +1203,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, } @@ -1255,16 +1245,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 { @@ -3378,6 +3358,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, A> { client: &'a ::subxt::Client, marker: ::core::marker::PhantomData<(X, A)>, @@ -3822,6 +3810,21 @@ 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, + A, + 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; @@ -4070,9 +4073,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, @@ -4358,7 +4359,7 @@ pub mod api { >; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, + &(&self.0, &self.1), ::subxt::StorageHasher::Twox64Concat, )]) } @@ -4586,11 +4587,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); @@ -5033,14 +5030,6 @@ pub mod api { &mut &[0u8, 1u8, 0u8, 0u8][..], )?) } - pub fn max_nominations( - &self, - ) -> ::core::result::Result<::core::primitive::u32, ::subxt::BasicError> - { - Ok(::subxt::codec::Decode::decode( - &mut &[16u8, 0u8, 0u8, 0u8][..], - )?) - } } } } @@ -5361,7 +5350,7 @@ pub mod api { type Value = ::subxt::sp_core::crypto::AccountId32; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, + &(&self.0, &self.1), ::subxt::StorageHasher::Twox64Concat, )]) } @@ -6973,18 +6962,6 @@ pub mod api { )]) } } - pub struct Locks(pub ::subxt::sp_core::crypto::AccountId32); - impl ::subxt::StorageEntry for Locks { - const PALLET: &'static str = "Democracy"; - const STORAGE: &'static str = "Locks"; - type Value = ::core::primitive::u32; - fn key(&self) -> ::subxt::StorageEntryKey { - ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, - ::subxt::StorageHasher::Twox64Concat, - )]) - } - } pub struct LastTabledWasExternal; impl ::subxt::StorageEntry for LastTabledWasExternal { const PALLET: &'static str = "Democracy"; @@ -7186,26 +7163,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>, - ::subxt::BasicError, - > { - self.client.storage().iter(hash).await - } pub async fn last_tabled_was_external( &self, hash: ::core::option::Option, @@ -12346,7 +12303,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, @@ -12358,7 +12318,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 } @@ -12409,7 +12372,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); @@ -12428,7 +12395,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; @@ -12923,6 +12892,15 @@ pub mod api { 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, A> { client: &'a ::subxt::Client, marker: ::core::marker::PhantomData<(X, A)>, @@ -13014,6 +12992,25 @@ pub mod api { }; ::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, + A, + GovernanceFallback, + DispatchError, + root_mod::Event, + > { + let call = GovernanceFallback { + maybe_max_voters, + maybe_max_targets, + }; + ::subxt::SubmittableExtrinsic::new(self.client, call) + } } } pub type Event = @@ -13124,9 +13121,7 @@ pub mod api { 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, - >; + runtime_types::pallet_election_provider_multi_phase::RoundSnapshot; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Plain } @@ -13217,7 +13212,7 @@ pub mod api { } 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 >{ + } 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 } @@ -16024,7 +16019,7 @@ pub mod api { runtime_types::polkadot_parachain::primitives::ValidationCodeHash; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, + &(&self.0, &self.1), ::subxt::StorageHasher::Twox64Concat, )]) } @@ -17098,19 +17093,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"; @@ -17119,6 +17130,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"; @@ -17194,6 +17206,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, @@ -17203,11 +17217,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, @@ -17217,11 +17236,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, @@ -17231,12 +17251,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, @@ -17246,7 +17267,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) } } @@ -18572,7 +18596,7 @@ pub mod api { type Value = ::core::primitive::u128; fn key(&self) -> ::subxt::StorageEntryKey { ::subxt::StorageEntryKey::Map(vec![::subxt::StorageMapKey::new( - &self.0, + &(&self.0, &self.1), ::subxt::StorageHasher::Twox64Concat, )]) } @@ -20067,6 +20091,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 { @@ -20417,15 +20455,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; @@ -20778,6 +20807,8 @@ pub mod api { Premature, #[codec(index = 9)] HasActiveChildBounty, + #[codec(index = 10)] + TooManyQueued, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -21334,7 +21365,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 < [:: 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 = 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, )] @@ -21361,6 +21392,8 @@ pub mod api { InvalidSubmissionIndex, #[codec(index = 10)] CallNotAllowed, + #[codec(index = 11)] + FallbackFailed, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -21422,10 +21455,15 @@ pub mod api { 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 { @@ -22699,15 +22737,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>>, @@ -22909,6 +22938,10 @@ pub mod api { 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, @@ -23076,8 +23109,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, } @@ -23877,8 +23913,8 @@ pub mod api { )] pub struct AvailabilityBitfield( pub ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, >, ); #[derive( @@ -23893,8 +23929,8 @@ pub mod api { runtime_types::polkadot_primitives::v0::ValidityAttestation, >, pub validator_indices: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, >, } #[derive( @@ -24262,7 +24298,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, >, ), @@ -25038,7 +25074,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, )] @@ -25079,6 +25115,8 @@ pub mod api { OpenHrmpChannelDoesntExist, #[codec(index = 17)] OpenHrmpChannelAlreadyConfirmed, + #[codec(index = 18)] + WrongWitness, } #[derive( :: subxt :: codec :: Encode, :: subxt :: codec :: Decode, Debug, @@ -25253,12 +25291,12 @@ pub mod api { pub descriptor: runtime_types::polkadot_primitives::v1::CandidateDescriptor<_0>, pub availability_votes: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, >, pub backers: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, >, pub relay_parent_number: _1, pub backed_in_number: _1, @@ -25385,12 +25423,12 @@ pub mod api { )] pub struct PvfCheckActiveVoteState<_0> { pub votes_accept: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, >, pub votes_reject: ::subxt::bitvec::vec::BitVec< - ::subxt::bitvec::order::Lsb0, ::core::primitive::u8, + ::subxt::bitvec::order::Lsb0, >, pub age: _0, pub created_at: _0, @@ -26417,10 +26455,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)] @@ -26433,6 +26468,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), @@ -27565,8 +27605,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 } diff --git a/test-runtime/Cargo.toml b/test-runtime/Cargo.toml index fdd63aedc7..a0a1431659 100644 --- a/test-runtime/Cargo.toml +++ b/test-runtime/Cargo.toml @@ -5,11 +5,11 @@ edition = "2021" [dependencies] subxt = { path = "../subxt" } -sp-runtime = "5.0.0" -codec = { package = "parity-scale-codec", version = "2", default-features = false, features = ["derive", "full", "bit-vec"] } +sp-runtime = "6.0.0" +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } [build-dependencies] subxt = { path = "../subxt" } -sp-core = "5.0.0" +sp-core = "6.0.0" async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } which = "4.2.2"