mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-11-16 15:58:14 +00:00
other: SetLogCategories
, SetBootstrapDaemon
, GetTransactionPool
This commit is contained in:
parent
e6d5709963
commit
5b765ed796
4 changed files with 91 additions and 3 deletions
|
@ -85,6 +85,7 @@ define_request_and_response! {
|
|||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 487..=510,
|
||||
GetOutputIndexes,
|
||||
#[derive(Copy)]
|
||||
Request {
|
||||
txid: [u8; 32],
|
||||
},
|
||||
|
|
|
@ -626,6 +626,7 @@ define_request_and_response! {
|
|||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 2774..=2796,
|
||||
FlushCache,
|
||||
#[derive(Copy)]
|
||||
Request {
|
||||
#[cfg_attr(feature = "serde", serde(default = "default_bool"))]
|
||||
bad_txs: bool = default_bool(),
|
||||
|
|
|
@ -28,7 +28,7 @@ use crate::{
|
|||
CORE_RPC_STATUS_BUSY, CORE_RPC_STATUS_NOT_MINING, CORE_RPC_STATUS_OK,
|
||||
CORE_RPC_STATUS_PAYMENT_REQUIRED, CORE_RPC_STATUS_UNKNOWN,
|
||||
},
|
||||
defaults::{default_u16, default_u32},
|
||||
defaults::{default_u16, default_u32, default_u64},
|
||||
macros::monero_definition_link,
|
||||
};
|
||||
|
||||
|
@ -438,6 +438,47 @@ define_struct_and_impl_epee! {
|
|||
}
|
||||
}
|
||||
|
||||
define_struct_and_impl_epee! {
|
||||
#[doc = monero_definition_link!(
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454,
|
||||
"rpc/core_rpc_server_commands_defs.h",
|
||||
1519..=1556
|
||||
)]
|
||||
/// Used in [`crate::other::GetTransactionPoolResponse`].
|
||||
TxInfo {
|
||||
id_hash: String,
|
||||
tx_json: String,
|
||||
blob_size: u64,
|
||||
#[cfg_attr(feature = "serde", serde(default = "default_u64"))]
|
||||
weight: u64 = default_u64(),
|
||||
fee: u64,
|
||||
max_used_block_id_hash: String,
|
||||
max_used_block_height: u64,
|
||||
kept_by_block: bool,
|
||||
last_failed_height: u64,
|
||||
last_failed_id_hash: String,
|
||||
receive_time: u64,
|
||||
relayed: bool,
|
||||
last_relayed_time: u64,
|
||||
do_not_relay: bool,
|
||||
double_spend_seen: bool,
|
||||
tx_blob: String,
|
||||
}
|
||||
}
|
||||
|
||||
define_struct_and_impl_epee! {
|
||||
#[doc = monero_definition_link!(
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454,
|
||||
"rpc/core_rpc_server_commands_defs.h",
|
||||
1558..=1567
|
||||
)]
|
||||
/// Used in [`crate::other::GetTransactionPoolResponse`].
|
||||
SpentKeyImageInfo {
|
||||
id_hash: String,
|
||||
txs_hashes: Vec<String>,
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- TODO
|
||||
// TODO - weird types.
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
//---------------------------------------------------------------------------------------------------- Import
|
||||
use crate::{
|
||||
base::{AccessResponseBase, ResponseBase},
|
||||
defaults::{default_bool, default_bool_true},
|
||||
defaults::{default_bool, default_bool_true, default_string},
|
||||
macros::define_request_and_response,
|
||||
misc::{Peer, TxEntry},
|
||||
misc::{Peer, SpentKeyImageInfo, Status, TxEntry, TxInfo},
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- TODO
|
||||
|
@ -181,6 +181,7 @@ define_request_and_response! {
|
|||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 1450..=1470,
|
||||
SetLogHashRate,
|
||||
#[derive(Copy)]
|
||||
Request {
|
||||
visible: bool,
|
||||
},
|
||||
|
@ -192,12 +193,56 @@ define_request_and_response! {
|
|||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 1450..=1470,
|
||||
SetLogLevel,
|
||||
#[derive(Copy)]
|
||||
Request {
|
||||
level: u8,
|
||||
},
|
||||
ResponseBase {}
|
||||
}
|
||||
|
||||
define_request_and_response! {
|
||||
set_log_categories,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 1494..=1517,
|
||||
SetLogCategories,
|
||||
Request {
|
||||
#[cfg_attr(feature = "serde", serde(default = "default_string"))]
|
||||
categories: String = default_string(),
|
||||
},
|
||||
ResponseBase {
|
||||
categories: String,
|
||||
}
|
||||
}
|
||||
|
||||
define_request_and_response! {
|
||||
set_bootstrap_daemon,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 1785..=1812,
|
||||
SetBootstrapDaemon,
|
||||
Request {
|
||||
address: String,
|
||||
username: String,
|
||||
password: String,
|
||||
proxy: String,
|
||||
},
|
||||
#[derive(Copy)]
|
||||
Response {
|
||||
status: Status,
|
||||
}
|
||||
}
|
||||
|
||||
define_request_and_response! {
|
||||
get_transaction_pool,
|
||||
cc73fe71162d564ffda8e549b79a350bca53c454 =>
|
||||
core_rpc_server_commands_defs.h => 1569..=1591,
|
||||
GetTransactionPool,
|
||||
Request {},
|
||||
AccessResponseBase {
|
||||
transactions: Vec<TxInfo>,
|
||||
spent_key_images: Vec<SpentKeyImageInfo>,
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------- Tests
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
|
|
Loading…
Reference in a new issue