From ec26d46a57452e1387d86717a9b3cde318e997f5 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Tue, 9 Jan 2024 13:23:58 +0100 Subject: [PATCH 1/3] Make PrevalidateAttests Send + Sync and remove bounds Signed-off-by: Oliver Tale-Yazdi --- polkadot/runtime/common/src/claims.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index d15e04a660f7..cd9413940e05 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -591,11 +591,9 @@ impl Pallet { /// otherwise free to place on chain. #[derive(Encode, Decode, Clone, Eq, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct PrevalidateAttests(sp_std::marker::PhantomData) -where - ::RuntimeCall: IsSubType>; +pub struct PrevalidateAttests(core::marker::PhantomData); -impl Debug for PrevalidateAttests +impl Debug for PrevalidateAttests where ::RuntimeCall: IsSubType>, { @@ -610,7 +608,7 @@ where } } -impl PrevalidateAttests +impl PrevalidateAttests where ::RuntimeCall: IsSubType>, { @@ -620,7 +618,7 @@ where } } -impl SignedExtension for PrevalidateAttests +impl SignedExtension for PrevalidateAttests where ::RuntimeCall: IsSubType>, { @@ -1469,6 +1467,12 @@ mod tests { ); }); } + + #[test] + fn prevalidate_assets_is_send_and_sync() { + fn is_send_and_sync() {} + is_send_and_sync::>(); + } } #[cfg(feature = "runtime-benchmarks")] From 7cb1ed6925078f8fe3fc4506c21af14fb859ea27 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Tue, 9 Jan 2024 13:27:17 +0100 Subject: [PATCH 2/3] Add prdoc Signed-off-by: Oliver Tale-Yazdi --- prdoc/pr_2886.prdoc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 prdoc/pr_2886.prdoc diff --git a/prdoc/pr_2886.prdoc b/prdoc/pr_2886.prdoc new file mode 100644 index 000000000000..9fd97c11e111 --- /dev/null +++ b/prdoc/pr_2886.prdoc @@ -0,0 +1,13 @@ +# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 +# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json + +title: Remove bounds from `PrevalidateAttests` struct definition + +doc: + - audience: Runtime Dev + description: | + Minimal change to `PrevalidateAssets` to remove some trait bounds on the struct itself while + keeping all its capabilities. + +crates: + - name: polkadot-runtime-common From cfaf2783e60a0fde0aff2f4cfca2bf3fba8b9a10 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Tue, 9 Jan 2024 18:01:07 +0100 Subject: [PATCH 3/3] Update polkadot/runtime/common/src/claims.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- polkadot/runtime/common/src/claims.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/polkadot/runtime/common/src/claims.rs b/polkadot/runtime/common/src/claims.rs index cd9413940e05..4cddab969c08 100644 --- a/polkadot/runtime/common/src/claims.rs +++ b/polkadot/runtime/common/src/claims.rs @@ -1467,12 +1467,6 @@ mod tests { ); }); } - - #[test] - fn prevalidate_assets_is_send_and_sync() { - fn is_send_and_sync() {} - is_send_and_sync::>(); - } } #[cfg(feature = "runtime-benchmarks")]