response_base: fn -> const

This commit is contained in:
hinto.janai 2024-10-14 20:40:03 -04:00
parent 08b5ff2f05
commit 2daf2555bb
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
4 changed files with 100 additions and 130 deletions

View file

@ -117,7 +117,7 @@ async fn get_block_count(
request: GetBlockCountRequest,
) -> Result<GetBlockCountResponse, Error> {
Ok(GetBlockCountResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
count: helper::top_height(&mut state).await?.0,
})
}
@ -150,7 +150,7 @@ async fn submit_block(
blockchain_manager::relay_block(&mut state.blockchain_manager, block).await?;
Ok(SubmitBlockResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
block_id,
})
}
@ -161,7 +161,7 @@ async fn generate_blocks(
request: GenerateBlocksRequest,
) -> Result<GenerateBlocksResponse, Error> {
Ok(GenerateBlocksResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
blocks: todo!(),
height: todo!(),
})
@ -176,7 +176,7 @@ async fn get_last_block_header(
let block_header = helper::block_header(&mut state, height, request.fill_pow_hash).await?;
Ok(GetLastBlockHeaderResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
block_header,
})
}
@ -212,7 +212,7 @@ async fn get_block_header_by_hash(
}
Ok(GetBlockHeaderByHashResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
block_header,
block_headers,
})
@ -228,7 +228,7 @@ async fn get_block_header_by_height(
helper::block_header(&mut state, request.height, request.fill_pow_hash).await?;
Ok(GetBlockHeaderByHeightResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
block_header,
})
}
@ -276,7 +276,7 @@ async fn get_block_headers_range(
}
Ok(GetBlockHeadersRangeResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
headers,
})
}
@ -309,7 +309,7 @@ async fn get_block(
};
Ok(GetBlockResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
blob,
json,
miner_tx_hash,
@ -326,7 +326,7 @@ async fn get_connections(
let connections = address_book::connection_info::<ClearNet>(&mut DummyAddressBook).await?;
Ok(GetConnectionsResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
connections,
})
}
@ -337,7 +337,7 @@ async fn get_info(
request: GetInfoRequest,
) -> Result<GetInfoResponse, Error> {
Ok(GetInfoResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
adjusted_time: todo!(),
alt_blocks_count: todo!(),
block_size_limit: todo!(),
@ -397,7 +397,7 @@ async fn hard_fork_info(
let info = blockchain_context::hard_fork_info(&mut state.blockchain_context, hard_fork).await?;
Ok(HardForkInfoResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
earliest_height: info.earliest_height,
enabled: info.enabled,
state: info.state,
@ -429,7 +429,7 @@ async fn set_bans(
}
Ok(SetBansResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
})
}
@ -464,7 +464,7 @@ async fn get_bans(
.collect();
Ok(GetBansResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
bans,
})
}
@ -538,7 +538,7 @@ async fn get_output_histogram(
.collect();
Ok(GetOutputHistogramResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
histogram,
})
}
@ -561,7 +561,7 @@ async fn get_coinbase_tx_sum(
let (fee_amount, fee_amount_top64) = split_u128_into_low_high_bits(sum.fee_amount);
Ok(GetCoinbaseTxSumResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
emission_amount,
emission_amount_top64,
fee_amount,
@ -589,7 +589,7 @@ async fn get_version(
.collect();
Ok(GetVersionResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
version: CORE_RPC_VERSION,
release: RELEASE,
current_height,
@ -608,7 +608,7 @@ async fn get_fee_estimate(
.await?;
Ok(GetFeeEstimateResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
fee: estimate.fee,
fees: estimate.fees,
quantization_mask: estimate.quantization_mask,
@ -641,7 +641,7 @@ async fn get_alternate_chains(
.collect();
Ok(GetAlternateChainsResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
chains,
})
}
@ -668,7 +668,7 @@ async fn sync_info(
request: SyncInfoRequest,
) -> Result<SyncInfoResponse, Error> {
Ok(SyncInfoResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
height: todo!(),
next_needed_pruning_seed: todo!(),
overview: todo!(),
@ -684,7 +684,7 @@ async fn get_transaction_pool_backlog(
request: GetTransactionPoolBacklogRequest,
) -> Result<GetTransactionPoolBacklogResponse, Error> {
Ok(GetTransactionPoolBacklogResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
backlog: todo!(),
})
}
@ -695,7 +695,7 @@ async fn get_miner_data(
request: GetMinerDataRequest,
) -> Result<GetMinerDataResponse, Error> {
Ok(GetMinerDataResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
major_version: todo!(),
height: todo!(),
prev_id: todo!(),
@ -713,7 +713,7 @@ async fn prune_blockchain(
request: PruneBlockchainRequest,
) -> Result<PruneBlockchainResponse, Error> {
Ok(PruneBlockchainResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
pruned: todo!(),
pruning_seed: todo!(),
})
@ -735,7 +735,7 @@ async fn flush_cache(
todo!();
Ok(FlushCacheResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
})
}
@ -745,7 +745,7 @@ async fn add_aux_pow(
request: AddAuxPowRequest,
) -> Result<AddAuxPowResponse, Error> {
Ok(AddAuxPowResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
blocktemplate_blob: todo!(),
blockhashing_blob: todo!(),
merkle_root: todo!(),
@ -760,7 +760,7 @@ async fn get_tx_ids_loose(
request: GetTxIdsLooseRequest,
) -> Result<GetTxIdsLooseResponse, Error> {
Ok(GetTxIdsLooseResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
txids: todo!(),
})
}

View file

@ -58,61 +58,37 @@ pub struct ResponseBase {
}
impl ResponseBase {
/// `const` version of [`Default::default`].
///
/// ```rust
/// use cuprate_rpc_types::{misc::*, base::*};
///
/// let new = ResponseBase::new();
/// assert_eq!(new, ResponseBase {
/// status: Status::Ok,
/// untrusted: false,
/// });
/// ```
pub const fn new() -> Self {
Self {
status: Status::Ok,
untrusted: false,
}
}
/// Returns OK and trusted [`Self`].
/// [`Status::Ok`] and trusted [`Self`].
///
/// This is the most common version of [`Self`].
///
/// ```rust
/// use cuprate_rpc_types::{misc::*, base::*};
///
/// let ok = ResponseBase::ok();
/// assert_eq!(ok, ResponseBase {
/// assert_eq!(ResponseBase::OK, ResponseBase {
/// status: Status::Ok,
/// untrusted: false,
/// });
/// ```
pub const fn ok() -> Self {
Self {
status: Status::Ok,
untrusted: false,
}
}
pub const OK: Self = Self {
status: Status::Ok,
untrusted: false,
};
/// Same as [`Self::ok`] but with [`Self::untrusted`] set to `true`.
/// Same as [`Self::OK`] but with [`Self::untrusted`] set to `true`.
///
/// ```rust
/// use cuprate_rpc_types::{misc::*, base::*};
///
/// let ok_untrusted = ResponseBase::ok_untrusted();
/// assert_eq!(ok_untrusted, ResponseBase {
/// assert_eq!(ResponseBase::OK_UNTRUSTED, ResponseBase {
/// status: Status::Ok,
/// untrusted: true,
/// });
/// ```
pub const fn ok_untrusted() -> Self {
Self {
status: Status::Ok,
untrusted: true,
}
}
pub const OK_UNTRUSTED: Self = Self {
status: Status::Ok,
untrusted: true,
};
}
#[cfg(feature = "epee")]
@ -148,9 +124,9 @@ impl AccessResponseBase {
/// ```rust
/// use cuprate_rpc_types::{misc::*, base::*};
///
/// let new = AccessResponseBase::new(ResponseBase::ok());
/// let new = AccessResponseBase::new(ResponseBase::OK);
/// assert_eq!(new, AccessResponseBase {
/// response_base: ResponseBase::ok(),
/// response_base: ResponseBase::OK,
/// credits: 0,
/// top_hash: "".into(),
/// });
@ -163,47 +139,41 @@ impl AccessResponseBase {
}
}
/// Returns OK and trusted [`Self`].
/// [`Status::Ok`] and trusted [`Self`].
///
/// This is the most common version of [`Self`].
///
/// ```rust
/// use cuprate_rpc_types::{misc::*, base::*};
///
/// let ok = AccessResponseBase::ok();
/// assert_eq!(ok, AccessResponseBase {
/// response_base: ResponseBase::ok(),
/// assert_eq!(AccessResponseBase::OK, AccessResponseBase {
/// response_base: ResponseBase::OK,
/// credits: 0,
/// top_hash: "".into(),
/// });
/// ```
pub const fn ok() -> Self {
Self {
response_base: ResponseBase::ok(),
credits: 0,
top_hash: String::new(),
}
}
pub const OK: Self = Self {
response_base: ResponseBase::OK,
credits: 0,
top_hash: String::new(),
};
/// Same as [`Self::ok`] but with `untrusted` set to `true`.
/// Same as [`Self::OK`] but with `untrusted` set to `true`.
///
/// ```rust
/// use cuprate_rpc_types::{misc::*, base::*};
///
/// let ok_untrusted = AccessResponseBase::ok_untrusted();
/// assert_eq!(ok_untrusted, AccessResponseBase {
/// assert_eq!(AccessResponseBase::OK_UNTRUSTED, AccessResponseBase {
/// response_base: ResponseBase::ok_untrusted(),
/// credits: 0,
/// top_hash: "".into(),
/// });
/// ```
pub const fn ok_untrusted() -> Self {
Self {
response_base: ResponseBase::ok_untrusted(),
credits: 0,
top_hash: String::new(),
}
}
pub const OK_UNTRUSTED: Self = Self {
response_base: ResponseBase::OK_UNTRUSTED,
credits: 0,
top_hash: String::new(),
};
}
#[cfg(feature = "epee")]

View file

@ -184,7 +184,7 @@ define_request_and_response! {
// <https://serde.rs/field-attrs.html#flatten>.
#[doc = serde_doc_test!(
GET_BLOCK_TEMPLATE_RESPONSE => GetBlockTemplateResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
blockhashing_blob: "1010f4bae0b4069d648e741d85ca0e7acb4501f051b27e9b107d3cd7a3f03aa7f776089117c81a00000000e0c20372be23d356347091025c5b5e8f2abf83ab618378565cce2b703491523401".into(),
blocktemplate_blob: "1010f4bae0b4069d648e741d85ca0e7acb4501f051b27e9b107d3cd7a3f03aa7f776089117c81a0000000002c681c30101ff8a81c3010180e0a596bb11033b7eedf47baf878f3490cb20b696079c34bd017fe59b0d070e74d73ffabc4bb0e05f011decb630f3148d0163b3bd39690dde4078e4cfb69fecf020d6278a27bad10c58023c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000".into(),
difficulty_top64: 0,
@ -240,7 +240,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_BLOCK_COUNT_RESPONSE => GetBlockCountResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
count: 3195019,
}
)]
@ -332,7 +332,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GENERATE_BLOCKS_RESPONSE => GenerateBlocksResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
blocks: vec!["49b712db7760e3728586f8434ee8bc8d7b3d410dac6bb6e98bf5845c83b917e4".into()],
height: 9783,
}
@ -357,7 +357,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_LAST_BLOCK_HEADER_RESPONSE => GetLastBlockHeaderResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
block_header: BlockHeader {
block_size: 200419,
block_weight: 200419,
@ -409,7 +409,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_BLOCK_HEADER_BY_HASH_RESPONSE => GetBlockHeaderByHashResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
block_headers: vec![],
block_header: BlockHeader {
block_size: 210,
@ -464,7 +464,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_BLOCK_HEADER_BY_HEIGHT_RESPONSE => GetBlockHeaderByHeightResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
block_header: BlockHeader {
block_size: 210,
block_weight: 210,
@ -519,7 +519,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_BLOCK_HEADERS_RANGE_RESPONSE => GetBlockHeadersRangeResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
headers: vec![
BlockHeader {
block_size: 301413,
@ -601,7 +601,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_BLOCK_RESPONSE => GetBlockResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
blob: "1010c58bab9b06b27bdecfc6cd0a46172d136c08831cf67660377ba992332363228b1b722781e7807e07f502cef8a70101ff92f8a7010180e0a596bb1103d7cbf826b665d7a532c316982dc8dbc24f285cbc18bbcc27c7164cd9b3277a85d034019f629d8b36bd16a2bfce3ea80c31dc4d8762c67165aec21845494e32b7582fe00211000000297a787a000000000000000000000000".into(),
block_header: BlockHeader {
block_size: 106,
@ -654,7 +654,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_CONNECTIONS_RESPONSE => GetConnectionsResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
connections: vec![
ConnectionInfo {
address: "3evk3kezfjg44ma6tvesy7rbxwwpgpympj45xar5fo4qajrsmkoaqdqd.onion:18083".into(),
@ -728,7 +728,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_INFO_RESPONSE => GetInfoResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
adjusted_time: 1721245289,
alt_blocks_count: 16,
block_size_limit: 600000,
@ -831,7 +831,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
HARD_FORK_INFO_RESPONSE => HardForkInfoResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
earliest_height: 2689608,
enabled: true,
state: 0,
@ -877,7 +877,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SET_BANS_RESPONSE => SetBansResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -892,7 +892,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_BANS_RESPONSE => GetBansResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
bans: vec![
GetBan {
host: "104.248.206.131".into(),
@ -994,7 +994,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_OUTPUT_HISTOGRAM_RESPONSE => GetOutputHistogramResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
histogram: vec![HistogramEntry {
amount: 20000000000,
recent_instances: 0,
@ -1028,7 +1028,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_COINBASE_TX_SUM_RESPONSE => GetCoinbaseTxSumResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
emission_amount: 9387854817320,
emission_amount_top64: 0,
fee_amount: 83981380000,
@ -1057,7 +1057,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_VERSION_RESPONSE => GetVersionResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
current_height: 3195051,
hard_forks: vec![
HardforkEntry {
@ -1152,7 +1152,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_FEE_ESTIMATE_RESPONSE => GetFeeEstimateResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
fee: 20000,
fees: vec![20000,80000,320000,4000000],
quantization_mask: 10000,
@ -1174,7 +1174,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_ALTERNATE_CHAINS_RESPONSE => GetAlternateChainsResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
chains: vec![
ChainInfo {
block_hash: "4826c7d45d7cf4f02985b5c405b0e5d7f92c8d25e015492ce19aa3b209295dce".into(),
@ -1242,7 +1242,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SYNC_INFO_RESPONSE => SyncInfoResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
height: 3195157,
next_needed_pruning_seed: 0,
overview: "[]".into(),
@ -1332,7 +1332,7 @@ define_request_and_response! {
// TODO: enable test after binary string impl.
// #[doc = serde_doc_test!(
// GET_TRANSACTION_POOL_BACKLOG_RESPONSE => GetTransactionPoolBacklogResponse {
// base: ResponseBase::ok(),
// base: ResponseBase::OK,
// backlog: "...Binary...".into(),
// }
// )]
@ -1374,7 +1374,7 @@ define_request_and_response! {
// TODO: enable test after binary string impl.
// #[doc = serde_doc_test!(
// GET_OUTPUT_DISTRIBUTION_RESPONSE => GetOutputDistributionResponse {
// base: AccessResponseBase::ok(),
// base: AccessResponseBase::OK,
// distributions: vec![Distribution::Uncompressed(DistributionUncompressed {
// start_height: 1462078,
// base: 0,
@ -1398,7 +1398,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_MINER_DATA_RESPONSE => GetMinerDataResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
already_generated_coins: 18186022843595960691,
difficulty: "0x48afae42de".into(),
height: 2731375,
@ -1451,7 +1451,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
PRUNE_BLOCKCHAIN_RESPONSE => PruneBlockchainResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
pruned: true,
pruning_seed: 387,
}
@ -1517,7 +1517,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
FLUSH_CACHE_RESPONSE => FlushCacheResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -1546,7 +1546,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
ADD_AUX_POW_RESPONSE => AddAuxPowResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
aux_pow: vec![AuxPow {
hash: "7b35762de164b20885e15dbe656b1138db06bb402fa1796f5765a23933d8859a".into(),
id: "3200b4ea97c3b2081cd4190b58e49572b2319fed00d030ad51809dff06b5d8c8".into(),

View file

@ -102,7 +102,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_HEIGHT_RESPONSE => GetHeightResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
hash: "68bb1a1cff8e2a44c3221e8e1aff80bc6ca45d06fa8eff4d2a3a7ac31d4efe3f".into(),
height: 3195160,
}
@ -157,7 +157,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_ALT_BLOCKS_HASHES_RESPONSE => GetAltBlocksHashesResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
blks_hashes: vec!["8ee10db35b1baf943f201b303890a29e7d45437bd76c2bd4df0d2f2ee34be109".into()],
}
)]
@ -187,7 +187,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
IS_KEY_IMAGE_SPENT_RESPONSE => IsKeyImageSpentResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
spent_status: vec![1, 1],
}
)]
@ -283,7 +283,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
START_MINING_RESPONSE => StartMiningResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -298,7 +298,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
STOP_MINING_RESPONSE => StopMiningResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -313,7 +313,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
MINING_STATUS_RESPONSE => MiningStatusResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
active: false,
address: "".into(),
bg_idle_threshold: 0,
@ -359,7 +359,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SAVE_BC_RESPONSE => SaveBcResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -385,7 +385,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_PEER_LIST_RESPONSE => GetPeerListResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
gray_list: vec![
Peer {
host: "161.97.193.0".into(),
@ -467,7 +467,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SET_LOG_HASH_RATE_RESPONSE => SetLogHashRateResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -492,7 +492,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SET_LOG_LEVEL_RESPONSE => SetLogLevelResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
}
)]
ResponseBase {}
@ -516,7 +516,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SET_LOG_CATEGORIES_RESPONSE => SetLogCategoriesResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
categories: "*:INFO".into(),
}
)]
@ -582,7 +582,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_TRANSACTION_POOL_STATS_RESPONSE => GetTransactionPoolStatsResponse {
base: AccessResponseBase::ok(),
base: AccessResponseBase::OK,
pool_stats: TxpoolStats {
bytes_max: 11843,
bytes_med: 2219,
@ -644,7 +644,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_LIMIT_RESPONSE => GetLimitResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
limit_down: 1280000,
limit_up: 1280000,
}
@ -676,7 +676,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
SET_LIMIT_RESPONSE => SetLimitResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
limit_down: 1024,
limit_up: 128,
}
@ -707,7 +707,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
OUT_PEERS_RESPONSE => OutPeersResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
out_peers: 3232235535,
}
)]
@ -740,7 +740,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_NET_STATS_RESPONSE => GetNetStatsResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
start_time: 1721251858,
total_bytes_in: 16283817214,
total_bytes_out: 34225244079,
@ -779,7 +779,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_OUTS_RESPONSE => GetOutsResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
outs: vec![
OutKey {
height: 51941,
@ -823,7 +823,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
UPDATE_RESPONSE => UpdateResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
auto_uri: "".into(),
hash: "".into(),
path: "".into(),
@ -860,7 +860,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
POP_BLOCKS_RESPONSE => PopBlocksResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
height: 76482,
}
)]
@ -879,7 +879,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_TRANSACTION_POOL_HASHES_RESPONSE => GetTransactionPoolHashesResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
tx_hashes: vec![
"aa928aed888acd6152c60194d50a4df29b0b851be6169acf11b6a8e304dd6c03".into(),
"794345f321a98f3135151f3056c0fdf8188646a8dab27de971428acf3551dd11".into(),
@ -929,7 +929,7 @@ define_request_and_response! {
#[doc = serde_doc_test!(
GET_PUBLIC_NODES_RESPONSE => GetPublicNodesResponse {
base: ResponseBase::ok(),
base: ResponseBase::OK,
gray: vec![],
white: vec![
PublicNode {