mirror of
https://github.com/hinto-janai/cuprate.git
synced 2025-03-12 09:31:30 +00:00
other: GetNetStats
, GetOuts
, PopBlocks
, Update
, PopBlocks
This commit is contained in:
parent
9c27ff8311
commit
04ecd4f72d
3 changed files with 79 additions and 13 deletions
|
@ -13,8 +13,8 @@ use crate::{
|
|||
macros::define_request_and_response,
|
||||
misc::{
|
||||
AuxPow, BlockCompleteEntry, BlockHeader, BlockOutputIndices, ChainInfo, ConnectionInfo,
|
||||
GetBan, GetOutputsOut, HardforkEntry, HistogramEntry, OutKey, OutputDistributionData, Peer,
|
||||
PoolTxInfo, SetBan, Span, Status, TxBacklogEntry,
|
||||
GetBan, GetOutputsOut, HardforkEntry, HistogramEntry, OutKeyBin, OutputDistributionData,
|
||||
Peer, PoolTxInfo, SetBan, Span, Status, TxBacklogEntry,
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -105,7 +105,7 @@ define_request_and_response! {
|
|||
get_txid: bool = default_bool(),
|
||||
},
|
||||
AccessResponseBase {
|
||||
outs: Vec<OutKey>,
|
||||
outs: Vec<OutKeyBin>,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -377,7 +377,10 @@ define_struct_and_impl_epee! {
|
|||
512..=521
|
||||
)]
|
||||
#[derive(Copy)]
|
||||
/// Used in [`crate::bin::GetOutsRequest`].
|
||||
///
|
||||
/// Used in:
|
||||
/// - [`crate::bin::GetOutsRequest`]
|
||||
/// - [`crate::other::GetOutsRequest`]
|
||||
GetOutputsOut {
|
||||
amount: u64,
|
||||
index: u64,
|
||||
|
@ -392,7 +395,7 @@ define_struct_and_impl_epee! {
|
|||
)]
|
||||
#[derive(Copy)]
|
||||
/// Used in [`crate::bin::GetOutsRequest`].
|
||||
OutKey {
|
||||
OutKeyBin {
|
||||
key: u8, // TODO: crypto::public_key,
|
||||
mask: u8, // TODO: rct::key,
|
||||
unlocked: bool,
|
||||
|
@ -517,6 +520,22 @@ define_struct_and_impl_epee! {
|
|||
}
|
||||
}
|
||||
|
||||
define_struct_and_impl_epee! {
|
||||
#[doc = monero_definition_link!(
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454,
|
||||
"rpc/core_rpc_server_commands_defs.h",
|
||||
582..=597
|
||||
)]
|
||||
/// Used in [`crate::other::GetOutsResponse`].
|
||||
OutKey {
|
||||
key: String,
|
||||
mask: String,
|
||||
unlocked: bool,
|
||||
height: u64,
|
||||
txid: String,
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- TODO
|
||||
// TODO - weird types.
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
base::{AccessResponseBase, ResponseBase},
|
||||
defaults::{default_bool, default_bool_true, default_string},
|
||||
macros::define_request_and_response,
|
||||
misc::{Peer, SpentKeyImageInfo, Status, TxEntry, TxInfo, TxpoolStats},
|
||||
misc::{GetOutputsOut, OutKey, Peer, SpentKeyImageInfo, Status, TxEntry, TxInfo, TxpoolStats},
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- TODO
|
||||
|
@ -308,17 +308,64 @@ define_request_and_response! {
|
|||
}
|
||||
|
||||
define_request_and_response! {
|
||||
in_peers,
|
||||
get_net_stats,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 1932..=1956,
|
||||
InPeers,
|
||||
core_rpc_server_commands_defs.h => 793..=822,
|
||||
GetNetStats,
|
||||
Request {},
|
||||
ResponseBase {
|
||||
start_time: u64,
|
||||
total_packets_in: u64,
|
||||
total_bytes_in: u64,
|
||||
total_packets_out: u64,
|
||||
total_bytes_out: u64,
|
||||
}
|
||||
}
|
||||
|
||||
define_request_and_response! {
|
||||
get_outs,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 567..=609,
|
||||
GetOuts,
|
||||
Request {
|
||||
#[cfg_attr(feature = "serde", serde(default = "default_bool_true"))]
|
||||
set: bool = default_bool_true(),
|
||||
in_peers: u32,
|
||||
outputs: Vec<GetOutputsOut>,
|
||||
get_txid: bool,
|
||||
},
|
||||
ResponseBase {
|
||||
in_peers: u32,
|
||||
outs: Vec<OutKey>,
|
||||
}
|
||||
}
|
||||
|
||||
define_request_and_response! {
|
||||
update,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 2324..=2359,
|
||||
Update,
|
||||
Request {
|
||||
command: String,
|
||||
#[cfg_attr(feature = "serde", serde(default = "default_string"))]
|
||||
path: String = default_string(),
|
||||
},
|
||||
ResponseBase {
|
||||
auto_uri: String,
|
||||
hash: String,
|
||||
path: String,
|
||||
update: bool,
|
||||
user_uri: String,
|
||||
version: String,
|
||||
}
|
||||
}
|
||||
|
||||
define_request_and_response! {
|
||||
pop_blocks,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 2722..=2745,
|
||||
PopBlocks,
|
||||
Request {
|
||||
nblocks: u64,
|
||||
},
|
||||
ResponseBase {
|
||||
height: u64,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue