@@ -20,12 +20,14 @@ use cuprate_types::BlockCompleteEntry;
20
20
21
21
use crate :: {
22
22
base:: AccessResponseBase ,
23
- defaults:: { default_false, default_zero} ,
24
23
macros:: { define_request, define_request_and_response, define_request_and_response_doc} ,
25
- misc:: { BlockOutputIndices , GetOutputsOut , OutKeyBin , PoolInfoExtent , PoolTxInfo , Status } ,
24
+ misc:: { BlockOutputIndices , GetOutputsOut , OutKeyBin , PoolTxInfo , Status } ,
26
25
rpc_call:: RpcCallValue ,
27
26
} ;
28
27
28
+ #[ cfg( any( feature = "epee" , feature = "serde" ) ) ]
29
+ use crate :: defaults:: { default_false, default_zero} ;
30
+
29
31
//---------------------------------------------------------------------------------------------------- Definitions
30
32
define_request_and_response ! {
31
33
get_blocks_by_heightbin,
@@ -137,15 +139,15 @@ define_request! {
137
139
core_rpc_server_commands_defs, h, 162 , 262 ,
138
140
) ]
139
141
///
140
- /// This response's variant depends upon [`PoolInfoExtent`].
142
+ /// This response's variant depends upon [`crate::misc:: PoolInfoExtent`].
141
143
#[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
142
144
#[ derive( Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
143
145
pub enum GetBlocksResponse {
144
- /// Will always serialize a [`PoolInfoExtent::None`] field.
146
+ /// Will always serialize a [`crate::misc:: PoolInfoExtent::None`] field.
145
147
PoolInfoNone ( GetBlocksResponsePoolInfoNone ) ,
146
- /// Will always serialize a [`PoolInfoExtent::Incremental`] field.
148
+ /// Will always serialize a [`crate::misc:: PoolInfoExtent::Incremental`] field.
147
149
PoolInfoIncremental ( GetBlocksResponsePoolInfoIncremental ) ,
148
- /// Will always serialize a [`PoolInfoExtent::Full`] field.
150
+ /// Will always serialize a [`crate::misc:: PoolInfoExtent::Full`] field.
149
151
PoolInfoFull ( GetBlocksResponsePoolInfoFull ) ,
150
152
}
151
153
@@ -254,7 +256,7 @@ pub struct __GetBlocksResponseEpeeBuilder {
254
256
pub current_height : Option < u64 > ,
255
257
pub output_indices : Option < Vec < BlockOutputIndices > > ,
256
258
pub daemon_time : Option < u64 > ,
257
- pub pool_info_extent : Option < PoolInfoExtent > ,
259
+ pub pool_info_extent : Option < crate :: misc :: PoolInfoExtent > ,
258
260
pub added_pool_txs : Option < Vec < PoolTxInfo > > ,
259
261
pub remaining_added_pool_txids : Option < ByteArrayVec < 32 > > ,
260
262
pub removed_pool_txids : Option < ByteArrayVec < 32 > > ,
@@ -304,7 +306,7 @@ impl EpeeObjectBuilder<GetBlocksResponse> for __GetBlocksResponseEpeeBuilder {
304
306
let pool_info_extent = self . pool_info_extent . ok_or ( ELSE ) ?;
305
307
306
308
let this = match pool_info_extent {
307
- PoolInfoExtent :: None => {
309
+ crate :: misc :: PoolInfoExtent :: None => {
308
310
GetBlocksResponse :: PoolInfoNone ( GetBlocksResponsePoolInfoNone {
309
311
status,
310
312
untrusted,
@@ -315,7 +317,7 @@ impl EpeeObjectBuilder<GetBlocksResponse> for __GetBlocksResponseEpeeBuilder {
315
317
daemon_time,
316
318
} )
317
319
}
318
- PoolInfoExtent :: Incremental => {
320
+ crate :: misc :: PoolInfoExtent :: Incremental => {
319
321
GetBlocksResponse :: PoolInfoIncremental ( GetBlocksResponsePoolInfoIncremental {
320
322
status,
321
323
untrusted,
@@ -329,7 +331,7 @@ impl EpeeObjectBuilder<GetBlocksResponse> for __GetBlocksResponseEpeeBuilder {
329
331
removed_pool_txids : self . removed_pool_txids . ok_or ( ELSE ) ?,
330
332
} )
331
333
}
332
- PoolInfoExtent :: Full => {
334
+ crate :: misc :: PoolInfoExtent :: Full => {
333
335
GetBlocksResponse :: PoolInfoFull ( GetBlocksResponsePoolInfoFull {
334
336
status,
335
337
untrusted,
@@ -353,7 +355,7 @@ impl EpeeObject for GetBlocksResponse {
353
355
type Builder = __GetBlocksResponseEpeeBuilder ;
354
356
355
357
fn number_of_fields ( & self ) -> u64 {
356
- // [`PoolInfoExtent`] + inner struct fields.
358
+ // [`crate::misc:: PoolInfoExtent`] + inner struct fields.
357
359
let inner_fields = match self {
358
360
Self :: PoolInfoNone ( s) => s. number_of_fields ( ) ,
359
361
Self :: PoolInfoIncremental ( s) => s. number_of_fields ( ) ,
@@ -367,15 +369,27 @@ impl EpeeObject for GetBlocksResponse {
367
369
match self {
368
370
Self :: PoolInfoNone ( s) => {
369
371
s. write_fields ( w) ?;
370
- write_field ( PoolInfoExtent :: None . to_u8 ( ) , "pool_info_extent" , w) ?;
372
+ write_field (
373
+ crate :: misc:: PoolInfoExtent :: None . to_u8 ( ) ,
374
+ "pool_info_extent" ,
375
+ w,
376
+ ) ?;
371
377
}
372
378
Self :: PoolInfoIncremental ( s) => {
373
379
s. write_fields ( w) ?;
374
- write_field ( PoolInfoExtent :: Incremental . to_u8 ( ) , "pool_info_extent" , w) ?;
380
+ write_field (
381
+ crate :: misc:: PoolInfoExtent :: Incremental . to_u8 ( ) ,
382
+ "pool_info_extent" ,
383
+ w,
384
+ ) ?;
375
385
}
376
386
Self :: PoolInfoFull ( s) => {
377
387
s. write_fields ( w) ?;
378
- write_field ( PoolInfoExtent :: Full . to_u8 ( ) , "pool_info_extent" , w) ?;
388
+ write_field (
389
+ crate :: misc:: PoolInfoExtent :: Full . to_u8 ( ) ,
390
+ "pool_info_extent" ,
391
+ w,
392
+ ) ?;
379
393
}
380
394
}
381
395
0 commit comments