From c184cbb91f784c3302658f1d09c4f0bc9e4b7b48 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 28 Oct 2024 18:35:14 +0100 Subject: [PATCH 1/3] [pallet-revive] Update typeInfo Update typeinfo impl to make it transparent for subxt --- substrate/frame/revive/src/evm/runtime.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/substrate/frame/revive/src/evm/runtime.rs b/substrate/frame/revive/src/evm/runtime.rs index 024f0750d2ae..362ab2c2ce5a 100644 --- a/substrate/frame/revive/src/evm/runtime.rs +++ b/substrate/frame/revive/src/evm/runtime.rs @@ -52,12 +52,24 @@ pub const GAS_PRICE: u32 = 1u32; /// Wraps [`generic::UncheckedExtrinsic`] to support checking unsigned /// [`crate::Call::eth_transact`] extrinsic. -#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug, TypeInfo)] -#[scale_info(skip_type_params(E))] +#[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] pub struct UncheckedExtrinsic( pub generic::UncheckedExtrinsic, Signature, E::Extension>, ); +impl TypeInfo for UncheckedExtrinsic +where + Address: TypeInfo + 'static, + Signature: TypeInfo + 'static, + E::Extension: TypeInfo + 'static, +{ + type Identity = + generic::UncheckedExtrinsic, Signature, E::Extension>; + fn type_info() -> scale_info::Type { + generic::UncheckedExtrinsic::, Signature, E::Extension>::type_info() + } +} + impl From, Signature, E::Extension>> for UncheckedExtrinsic From 82fd6c962525a54a7e42deb5bd5adc76d4dda27f Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 28 Oct 2024 17:40:27 +0000 Subject: [PATCH 2/3] Update from pgherveou running command 'prdoc --audience runtime_dev --bump minor' --- prdoc/pr_6263.prdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 prdoc/pr_6263.prdoc diff --git a/prdoc/pr_6263.prdoc b/prdoc/pr_6263.prdoc new file mode 100644 index 000000000000..1b1da78c85a2 --- /dev/null +++ b/prdoc/pr_6263.prdoc @@ -0,0 +1,10 @@ +title: '[pallet-revive] Update typeInfo' +doc: +- audience: Runtime Dev + description: |- + Update typeinfo impl to make it transparent for subxt + + see https://github.com/paritytech/subxt/pull/1845 +crates: +- name: pallet-revive + bump: minor From 9fbd3768cfc3bd4818195bf479101a2ef6250684 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Mon, 28 Oct 2024 20:38:33 +0100 Subject: [PATCH 3/3] use StaticTypeInfo --- substrate/frame/revive/src/evm/runtime.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/substrate/frame/revive/src/evm/runtime.rs b/substrate/frame/revive/src/evm/runtime.rs index 362ab2c2ce5a..bb076da3b3a6 100644 --- a/substrate/frame/revive/src/evm/runtime.rs +++ b/substrate/frame/revive/src/evm/runtime.rs @@ -25,7 +25,7 @@ use frame_support::{ traits::{ExtrinsicCall, InherentBuilder, SignedTransactionBuilder}, }; use pallet_transaction_payment::OnChargeTransaction; -use scale_info::TypeInfo; +use scale_info::{StaticTypeInfo, TypeInfo}; use sp_arithmetic::Percent; use sp_core::{Get, U256}; use sp_runtime::{ @@ -59,9 +59,9 @@ pub struct UncheckedExtrinsic( impl TypeInfo for UncheckedExtrinsic where - Address: TypeInfo + 'static, - Signature: TypeInfo + 'static, - E::Extension: TypeInfo + 'static, + Address: StaticTypeInfo, + Signature: StaticTypeInfo, + E::Extension: StaticTypeInfo, { type Identity = generic::UncheckedExtrinsic, Signature, E::Extension>;