diff --git a/subxt/src/rpc/types.rs b/subxt/src/rpc/types.rs index c12c8d34df..dd9bf2e89e 100644 --- a/subxt/src/rpc/types.rs +++ b/subxt/src/rpc/types.rs @@ -110,20 +110,8 @@ pub type ConsensusEngineId = [u8; 4]; pub type EncodedJustification = Vec; /// Bytes representing an extrinsic in a [`ChainBlock`]. -#[derive(Clone, Debug)] -pub struct ChainBlockExtrinsic(pub Vec); - -impl<'a> ::serde::Deserialize<'a> for ChainBlockExtrinsic { - fn deserialize(de: D) -> Result - where - D: ::serde::Deserializer<'a>, - { - let r = impl_serde::serialize::deserialize(de)?; - let bytes = Decode::decode(&mut &r[..]) - .map_err(|e| ::serde::de::Error::custom(format!("Decode error: {e}")))?; - Ok(ChainBlockExtrinsic(bytes)) - } -} +#[derive(Clone, Debug, Deserialize)] +pub struct ChainBlockExtrinsic(#[serde(with = "impl_serde::serialize")] pub Vec); /// Wrapper for NumberOrHex to allow custom From impls #[derive(Serialize)]