json: add FlushCache, AddAuxPow

This commit is contained in:
hinto.janai 2024-07-04 20:52:42 -04:00
parent 6f1289507f
commit 57a98e58a0
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
3 changed files with 51 additions and 4 deletions

View file

@ -9,8 +9,8 @@ use crate::{
free::{is_one, is_zero},
macros::define_request_and_response,
misc::{
BlockHeader, ChainInfo, ConnectionInfo, GetBan, HardforkEntry, HistogramEntry, Peer,
SetBan, Span, TxBacklogEntry,
AuxPow, BlockHeader, ChainInfo, ConnectionInfo, GetBan, HardforkEntry, HistogramEntry,
Peer, SetBan, Span, TxBacklogEntry,
},
OutputDistributionData, Status,
};
@ -622,6 +622,38 @@ define_request_and_response! {
}
}
define_request_and_response! {
flush_cache,
cc73fe71162d564ffda8e549b79a350bca53c454 =>
core_rpc_server_commands_defs.h => 2774..=2796,
FlushCache,
Request {
#[cfg_attr(feature = "serde", serde(default = "default_bool"))]
bad_txs: bool = default_bool(),
#[cfg_attr(feature = "serde", serde(default = "default_bool"))]
bad_blocks: bool = default_bool(),
},
ResponseBase {}
}
define_request_and_response! {
add_aux_pow,
cc73fe71162d564ffda8e549b79a350bca53c454 =>
core_rpc_server_commands_defs.h => 1068..=1112,
AddAuxPow,
Request {
blocktemplate_blob: String,
aux_pow: Vec<AuxPow>,
},
ResponseBase {
blocktemplate_blob: String,
blockhashing_blob: String,
merkle_root: String,
merkle_tree_depth: u64,
aux_pow: Vec<AuxPow>,
}
}
//---------------------------------------------------------------------------------------------------- Tests
#[cfg(test)]
mod test {

View file

@ -125,6 +125,6 @@ pub mod other;
mod misc;
pub use misc::{
BlockHeader, ChainInfo, ConnectionInfo, GetBan, HardforkEntry, HistogramEntry,
OutputDistributionData, Peer, SetBan, Span, TxBacklogEntry,
AuxPow, BlockHeader, ChainInfo, ConnectionInfo, GetBan, GetMinerDataTxBacklogEntry,
HardforkEntry, HistogramEntry, OutputDistributionData, Peer, SetBan, Span, TxBacklogEntry,
};

View file

@ -298,6 +298,21 @@ define_struct_and_impl_epee! {
}
}
define_struct_and_impl_epee! {
#[doc = monero_definition_link!(
cc73fe71162d564ffda8e549b79a350bca53c454,
"rpc/core_rpc_server_commands_defs.h",
1070..=1079
)]
/// Used in [`crate::json::GetAuxPowRequest`].
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
AuxPow {
id: String,
hash: String,
}
}
//---------------------------------------------------------------------------------------------------- Custom serde
// This section is for `struct`s that have custom (de)serialization code.