From 33c31871e13a7314378c6b9b765ecd94b93e3d44 Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Thu, 26 Sep 2024 16:42:20 -0400 Subject: [PATCH] todo!() epee impl --- types/src/json/block.rs | 31 +++++++++++++++++++++++++++++++ types/src/json/tx.rs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/types/src/json/block.rs b/types/src/json/block.rs index f53be50..7f1c697 100644 --- a/types/src/json/block.rs +++ b/types/src/json/block.rs @@ -9,6 +9,9 @@ use crate::json::output::Output; /// /// Used in: /// - [`/get_block` -> `json`](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_block) +/// +/// # TODO +/// The epee implementation on this struct panics. #[derive(Clone, Default, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct Block { @@ -21,6 +24,34 @@ pub struct Block { pub tx_hashes: Vec, } +#[cfg(feature = "epee")] +impl cuprate_epee_encoding::EpeeObjectBuilder for () { + fn add_field( + &mut self, + _: &str, + _: &mut B, + ) -> cuprate_epee_encoding::error::Result { + todo!() + } + + fn finish(self) -> cuprate_epee_encoding::error::Result { + todo!() + } +} + +#[cfg(feature = "epee")] +impl cuprate_epee_encoding::EpeeObject for Block { + type Builder = (); + + fn number_of_fields(&self) -> u64 { + todo!() + } + + fn write_fields(self, _: &mut B) -> cuprate_epee_encoding::error::Result<()> { + todo!() + } +} + /// [`Block::miner_tx`]. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] diff --git a/types/src/json/tx.rs b/types/src/json/tx.rs index 7d60f41..417b4c7 100644 --- a/types/src/json/tx.rs +++ b/types/src/json/tx.rs @@ -15,6 +15,9 @@ use crate::json::output::Output; /// Used in: /// - [`/get_transactions` -> `txs.as_json`](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_transactions) /// - [`/get_transaction_pool` -> `tx_json`](https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_transaction_pool) +/// +/// # TODO +/// The epee implementation on this struct panics. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[serde(untagged)] @@ -34,6 +37,34 @@ pub enum Transaction { }, } +#[cfg(feature = "epee")] +impl cuprate_epee_encoding::EpeeObjectBuilder for () { + fn add_field( + &mut self, + _: &str, + _: &mut B, + ) -> cuprate_epee_encoding::error::Result { + todo!() + } + + fn finish(self) -> cuprate_epee_encoding::error::Result { + todo!() + } +} + +#[cfg(feature = "epee")] +impl cuprate_epee_encoding::EpeeObject for Transaction { + type Builder = (); + + fn number_of_fields(&self) -> u64 { + todo!() + } + + fn write_fields(self, _: &mut B) -> cuprate_epee_encoding::error::Result<()> { + todo!() + } +} + /// [`Transaction::V1::prefix`] & [`Transaction::V2::prefix`]. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]