todo!() epee impl

This commit is contained in:
hinto.janai 2024-09-26 16:42:20 -04:00
parent aa94d93f4d
commit 33c31871e1
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
2 changed files with 62 additions and 0 deletions

View file

@ -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<String>,
}
#[cfg(feature = "epee")]
impl cuprate_epee_encoding::EpeeObjectBuilder<Block> for () {
fn add_field<B: bytes::Buf>(
&mut self,
_: &str,
_: &mut B,
) -> cuprate_epee_encoding::error::Result<bool> {
todo!()
}
fn finish(self) -> cuprate_epee_encoding::error::Result<Block> {
todo!()
}
}
#[cfg(feature = "epee")]
impl cuprate_epee_encoding::EpeeObject for Block {
type Builder = ();
fn number_of_fields(&self) -> u64 {
todo!()
}
fn write_fields<B: bytes::BufMut>(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))]

View file

@ -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<Transaction> for () {
fn add_field<B: bytes::Buf>(
&mut self,
_: &str,
_: &mut B,
) -> cuprate_epee_encoding::error::Result<bool> {
todo!()
}
fn finish(self) -> cuprate_epee_encoding::error::Result<Transaction> {
todo!()
}
}
#[cfg(feature = "epee")]
impl cuprate_epee_encoding::EpeeObject for Transaction {
type Builder = ();
fn number_of_fields(&self) -> u64 {
todo!()
}
fn write_fields<B: bytes::BufMut>(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))]