mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
xxx: Backup
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -507,15 +507,46 @@ pub enum FollowEvent<Hash> {
|
||||
/// The result of a chain head method.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg(feature = "experimental-light-client")]
|
||||
#[serde(try_from = "LightClientChainHeadResult<T>")]
|
||||
pub struct ChainHeadResult<T> {
|
||||
/// Result of the method.
|
||||
#[cfg(not(feature = "experimental-light-client"))]
|
||||
pub result: T,
|
||||
/// Result of the method.
|
||||
///
|
||||
/// # Note
|
||||
///
|
||||
/// `chainHead_body` returns a vector of values, while
|
||||
/// `chainHead_storage` returns just one plain element.
|
||||
#[cfg(feature = "experimental-light-client")]
|
||||
pub value: Vec<T>,
|
||||
}
|
||||
|
||||
/// The result of a chain head method.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[cfg(feature = "experimental-light-client")]
|
||||
pub struct LightClientChainHeadResult<T> {
|
||||
/// Result of the method.
|
||||
///
|
||||
/// # Note
|
||||
///
|
||||
/// `chainHead_body` returns a vector of values, while
|
||||
/// `chainHead_storage` returns just one plain element.
|
||||
pub value: T,
|
||||
}
|
||||
|
||||
impl<T> TryFrom<LightClientChainHeadResult<T>> for ChainHeadResult<T> {
|
||||
type Error = &'static str;
|
||||
|
||||
fn try_from(light: LightClientChainHeadResult<T>) -> Result<Self, &'static str> {
|
||||
Ok(Self {
|
||||
value: vec![light.value],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// The event generated by the body / call / storage methods.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
||||
Reference in New Issue
Block a user