mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-23 03:59:31 +00:00
fixes
This commit is contained in:
parent
7c7f64101f
commit
4f3b943b12
7 changed files with 13 additions and 17 deletions
|
@ -9,8 +9,7 @@ use cuprate_rpc_types::{
|
|||
bin::{
|
||||
BinRequest, BinResponse, GetBlocksByHeightRequest, GetBlocksRequest, GetHashesRequest,
|
||||
GetOutputDistributionRequest, GetOutputIndexesRequest, GetOutsRequest,
|
||||
GetTransactionPoolBacklogRequest, GetTransactionPoolBacklogResponse,
|
||||
GetTransactionPoolHashesRequest,
|
||||
GetTransactionPoolBacklogRequest, GetTransactionPoolHashesRequest,
|
||||
},
|
||||
RpcCall,
|
||||
};
|
||||
|
|
|
@ -181,6 +181,7 @@ generate_router_builder! {
|
|||
bin_get_o_indexes => "/get_o_indexes.bin" => bin::get_o_indexes => (get, post),
|
||||
bin_get_outs => "/get_outs.bin" => bin::get_outs => (get, post),
|
||||
bin_get_transaction_pool_hashes => "/get_transaction_pool_hashes.bin" => bin::get_transaction_pool_hashes => (get, post),
|
||||
bin_get_txpool_backlog => "/get_txpool_backlog.bin" => bin::get_txpool_backlog => (get, post),
|
||||
bin_get_output_distribution => "/get_output_distribution.bin" => bin::get_output_distribution => (get, post),
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ TODO: update after finalizing <https://github.com/monero-project/monero/issues/9
|
|||
- [`crate::json::GetOutputDistributionV2Response`]
|
||||
|
||||
# Optimized types
|
||||
TODO: updated after deciding compatability <-> optimization tradeoff.
|
||||
TODO: updated after deciding compatibility <-> optimization tradeoff.
|
||||
|
||||
- Fixed byte containers
|
||||
|
||||
|
|
|
@ -1378,12 +1378,12 @@ define_request_and_response! {
|
|||
},
|
||||
|
||||
#[doc = serde_doc_test!(
|
||||
GET_OUTPUT_DISTRIBUTION_RESPONSE => GetOutputDistributionResponse {
|
||||
GET_OUTPUT_DISTRIBUTION_V2_RESPONSE => GetOutputDistributionV2Response {
|
||||
base: AccessResponseBase::OK,
|
||||
distributions: vec![Distribution::Uncompressed(DistributionUncompressed {
|
||||
start_height: 1462078,
|
||||
base: 0,
|
||||
distribution: vec![],
|
||||
distribution: vec![0, 1, 2],
|
||||
amount: 2628780000,
|
||||
binary: true,
|
||||
})],
|
||||
|
|
|
@ -44,7 +44,7 @@ fn decompress_integer_array(_: &[u8]) -> Vec<u64> {
|
|||
"rpc/core_rpc_server_commands_defs.h",
|
||||
2468..=2508
|
||||
)]
|
||||
/// Used in [`crate::json::GetOutputDistributionResponse`].
|
||||
/// Used in [`crate::json::GetOutputDistributionV2Response`].
|
||||
///
|
||||
/// # Internals
|
||||
/// This type's (de)serialization depends on `monerod`'s (de)serialization.
|
||||
|
@ -82,10 +82,8 @@ impl Default for Distribution {
|
|||
pub struct DistributionUncompressed {
|
||||
pub start_height: u64,
|
||||
pub base: u64,
|
||||
/// TODO: this is a binary JSON string if `binary == true`.
|
||||
pub distribution: Vec<u64>,
|
||||
pub amount: u64,
|
||||
pub binary: bool,
|
||||
}
|
||||
|
||||
#[cfg(feature = "epee")]
|
||||
|
@ -95,7 +93,6 @@ epee_object! {
|
|||
base: u64,
|
||||
distribution: Vec<u64>,
|
||||
amount: u64,
|
||||
binary: bool,
|
||||
}
|
||||
|
||||
/// Data within [`Distribution::CompressedBinary`].
|
||||
|
@ -212,10 +209,9 @@ impl EpeeObjectBuilder<Distribution> for __DistributionEpeeBuilder {
|
|||
})
|
||||
} else if let Some(distribution) = self.distribution {
|
||||
Distribution::Uncompressed(DistributionUncompressed {
|
||||
binary: self.binary.ok_or(ELSE)?,
|
||||
distribution,
|
||||
start_height,
|
||||
base,
|
||||
distribution,
|
||||
amount,
|
||||
})
|
||||
} else {
|
||||
|
|
|
@ -178,7 +178,7 @@ define_struct_and_impl_epee! {
|
|||
2139..=2156
|
||||
)]
|
||||
#[derive(Copy)]
|
||||
/// Used in [`crate::json::GetOutputHistogramResponse`].
|
||||
/// Used in [`crate::json::GetOutputHistogramV2Response`].
|
||||
HistogramEntry {
|
||||
amount: u64,
|
||||
total_instances: u64,
|
||||
|
@ -257,7 +257,7 @@ define_struct_and_impl_epee! {
|
|||
1637..=1642
|
||||
)]
|
||||
#[derive(Copy)]
|
||||
/// Used in [`crate::json::GetTransactionPoolBacklogResponse`].
|
||||
/// Used in [`crate::json::GetTransactionPoolBacklogV2Response`].
|
||||
TxBacklogEntry {
|
||||
weight: u64,
|
||||
fee: u64,
|
||||
|
@ -271,7 +271,7 @@ define_struct_and_impl_epee! {
|
|||
"rpc/rpc_handler.h",
|
||||
45..=50
|
||||
)]
|
||||
/// Used in [`crate::json::GetOutputDistributionResponse`].
|
||||
/// Used in [`crate::json::GetOutputDistributionV2Response`].
|
||||
OutputDistributionData {
|
||||
distribution: Vec<u64>,
|
||||
start_height: u64,
|
||||
|
|
|
@ -1085,9 +1085,9 @@ r#"{
|
|||
"result": {
|
||||
"backlog": [
|
||||
{
|
||||
weight: 0,
|
||||
fee: 0,
|
||||
time_in_pool: 0,
|
||||
"weight": 0,
|
||||
"fee": 0,
|
||||
"time_in_pool": 0
|
||||
}
|
||||
],
|
||||
"status": "OK",
|
||||
|
|
Loading…
Reference in a new issue