mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 03:58:04 +00:00
Adding Serde Deserialisation to UncheckExtrinsics (#4793)
* Adding Serde:Deserialise to UncheckExtrinsics to be able to use the ChainApi RPC from the client side * Update primitives/runtime/src/generic/unchecked_extrinsic.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2f9315cc02
commit
111207afe8
@@ -274,6 +274,19 @@ impl<Address: Encode, Signature: Encode, Call: Encode, Extra: SignedExtension> s
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl<'a, Address: Decode, Signature: Decode, Call: Decode, Extra: SignedExtension> serde::Deserialize<'a>
|
||||
for UncheckedExtrinsic<Address, Call, Signature, Extra>
|
||||
{
|
||||
fn deserialize<D>(de: D) -> Result<Self, D::Error> where
|
||||
D: serde::Deserializer<'a>,
|
||||
{
|
||||
let r = sp_core::bytes::deserialize(de)?;
|
||||
Decode::decode(&mut &r[..])
|
||||
.map_err(|e| serde::de::Error::custom(format!("Decode error: {}", e)))
|
||||
}
|
||||
}
|
||||
|
||||
impl<Address, Call, Signature, Extra> fmt::Debug
|
||||
for UncheckedExtrinsic<Address, Call, Signature, Extra>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user