@@ -28,27 +28,25 @@ pub struct GetBlockVerbosityOne {
28
28
/// The block hash (same as provided) in RPC call.
29
29
pub hash : BlockHash ,
30
30
/// The number of confirmations, or -1 if the block is not on the main chain.
31
- pub confirmations : i32 ,
31
+ pub confirmations : i64 ,
32
32
/// The block size.
33
- pub size : usize ,
33
+ pub size : u32 ,
34
34
/// The block size excluding witness data.
35
- pub stripped_size : Option < usize > , // Weight?
35
+ pub stripped_size : Option < u32 > ,
36
36
/// The block weight as defined in BIP-141.
37
37
pub weight : Weight ,
38
38
/// The block height or index.
39
- pub height : usize ,
39
+ pub height : u32 ,
40
40
/// The block version.
41
41
pub version : block:: Version ,
42
- /// The block version formatted in hexadecimal.
43
- pub version_hex : String ,
44
42
/// The merkle root.
45
43
pub merkle_root : String ,
46
44
/// The transaction ids.
47
45
pub tx : Vec < Txid > ,
48
46
/// The block time expressed in UNIX epoch time.
49
- pub time : usize ,
47
+ pub time : u32 ,
50
48
/// The median block time expressed in UNIX epoch time.
51
- pub median_time : Option < usize > ,
49
+ pub median_time : Option < u32 > ,
52
50
/// The nonce.
53
51
pub nonce : u32 ,
54
52
/// The bits.
@@ -71,15 +69,15 @@ pub struct GetBlockchainInfo {
71
69
/// Current network name as defined in BIP70 (main, test, signet, regtest).
72
70
pub chain : Network ,
73
71
/// The current number of blocks processed in the server.
74
- pub blocks : u64 ,
72
+ pub blocks : u32 ,
75
73
/// The current number of headers we have validated.
76
- pub headers : u64 ,
74
+ pub headers : u32 ,
77
75
/// The hash of the currently best block.
78
76
pub best_block_hash : BlockHash ,
79
77
/// The current difficulty.
80
78
pub difficulty : f64 ,
81
79
/// Median time for the current best block.
82
- pub median_time : u64 ,
80
+ pub median_time : u32 ,
83
81
/// Estimate of verification progress (between 0 and 1).
84
82
pub verification_progress : f64 ,
85
83
/// Estimate of whether this node is in Initial Block Download (IBD) mode.
@@ -91,11 +89,11 @@ pub struct GetBlockchainInfo {
91
89
/// If the blocks are subject to pruning.
92
90
pub pruned : bool ,
93
91
/// Lowest-height complete block stored (only present if pruning is enabled)
94
- pub prune_height : Option < u64 > ,
92
+ pub prune_height : Option < u32 > ,
95
93
/// Whether automatic pruning is enabled (only present if pruning is enabled).
96
94
pub automatic_pruning : Option < bool > ,
97
95
/// The target size used by pruning (only present if automatic pruning is enabled).
98
- pub prune_target_size : Option < u64 > ,
96
+ pub prune_target_size : Option < u32 > ,
99
97
/// Status of softforks in progress, maps softfork name -> [`Softfork`].
100
98
pub softforks : BTreeMap < String , Softfork > ,
101
99
/// Any network and blockchain warnings.
@@ -111,7 +109,7 @@ pub struct Softfork {
111
109
/// The status of bip9 softforks (only for "bip9" type).
112
110
pub bip9 : Option < Bip9SoftforkInfo > ,
113
111
/// Height of the first block which the rules are or will be enforced (only for "buried" type, or "bip9" type with "active" status).
114
- pub height : Option < u64 > ,
112
+ pub height : Option < u32 > ,
115
113
/// `true` if the rules are enforced for the mempool and the next block.
116
114
pub active : bool ,
117
115
}
@@ -138,9 +136,9 @@ pub struct Bip9SoftforkInfo {
138
136
/// The bit (0-28) in the block version field used to signal this softfork (only for "started" status).
139
137
pub bit : Option < u8 > ,
140
138
/// The minimum median time past of a block at which the bit gains its meaning.
141
- pub start_time : i64 ,
139
+ pub start_time : u32 ,
142
140
/// The median time past of a block at which the deployment is considered failed if not yet locked in.
143
- pub timeout : u64 ,
141
+ pub timeout : u32 ,
144
142
/// Height of the first block to which the status applies.
145
143
pub since : u32 ,
146
144
/// Numeric statistics about BIP-9 signalling for a softfork (only for "started" status).
@@ -197,17 +195,17 @@ pub struct GetBlockHeaderVerbose {
197
195
/// The number of confirmations, or -1 if the block is not on the main chain.
198
196
pub confirmations : i64 ,
199
197
/// The block height or index.
200
- pub height : u64 ,
198
+ pub height : u32 ,
201
199
/// Block version, now repurposed for soft fork signalling.
202
200
pub version : block:: Version ,
203
201
/// The root hash of the Merkle tree of transactions in the block.
204
202
pub merkle_root : TxMerkleNode ,
205
203
/// The timestamp of the block, as claimed by the miner (seconds since epoch (Jan 1 1970 GMT).
206
- pub time : u64 ,
204
+ pub time : u32 ,
207
205
/// The median block time in seconds since epoch (Jan 1 1970 GMT).
208
- pub median_time : u64 ,
206
+ pub median_time : u32 ,
209
207
/// The nonce.
210
- pub nonce : u64 ,
208
+ pub nonce : u32 ,
211
209
/// The target value below which the blockhash must lie.
212
210
pub bits : CompactTarget ,
213
211
/// The difficulty.
@@ -223,66 +221,65 @@ pub struct GetBlockHeaderVerbose {
223
221
}
224
222
225
223
/// Models the result of JSON-RPC method `getblockstats`.
226
- // FIXME: Should all the sizes be u32, u64, or usize?
227
224
pub struct GetBlockStats {
228
225
/// Average fee in the block.
229
226
pub average_fee : Amount ,
230
227
/// Average feerate.
231
228
pub average_fee_rate : Option < FeeRate > ,
232
229
/// Average transaction size.
233
- pub average_tx_size : u64 ,
230
+ pub average_tx_size : u32 ,
234
231
/// The block hash (to check for potential reorgs).
235
232
pub block_hash : BlockHash ,
236
233
/// Feerates at the 10th, 25th, 50th, 75th, and 90th percentile weight unit (in satoshis per virtual byte).
237
234
pub fee_rate_percentiles : Vec < Option < FeeRate > > ,
238
235
/// The height of the block.
239
- pub height : u64 ,
236
+ pub height : u32 ,
240
237
/// The number of inputs (excluding coinbase).
241
- pub inputs : u64 ,
238
+ pub inputs : u32 ,
242
239
/// Maximum fee in the block.
243
240
pub max_fee : Amount ,
244
241
/// Maximum feerate (in satoshis per virtual byte).
245
242
pub max_fee_rate : Option < FeeRate > ,
246
243
/// Maximum transaction size.
247
- pub max_tx_size : u64 ,
244
+ pub max_tx_size : u32 ,
248
245
/// Truncated median fee in the block.
249
246
pub median_fee : Amount ,
250
247
/// The block median time past.
251
248
pub median_time : u32 ,
252
249
/// Truncated median transaction size
253
- pub median_tx_size : u64 ,
250
+ pub median_tx_size : u32 ,
254
251
/// Minimum fee in the block.
255
252
pub minimum_fee : Amount ,
256
253
/// Minimum feerate (in satoshis per virtual byte).
257
254
pub minimum_fee_rate : Option < FeeRate > ,
258
255
/// Minimum transaction size.
259
- pub minimum_tx_size : u64 ,
256
+ pub minimum_tx_size : u32 ,
260
257
/// The number of outputs.
261
- pub outputs : u64 ,
258
+ pub outputs : u32 ,
262
259
/// The block subsidy.
263
260
pub subsidy : Amount ,
264
261
/// Total size of all segwit transactions.
265
- pub segwit_total_size : u64 ,
262
+ pub segwit_total_size : u32 ,
266
263
/// Total weight of all segwit transactions divided by segwit scale factor (4).
267
264
pub segwit_total_weight : Option < Weight > ,
268
265
/// The number of segwit transactions.
269
- pub segwit_txs : u64 ,
266
+ pub segwit_txs : u32 ,
270
267
/// The block time.
271
268
pub time : u32 ,
272
269
/// Total amount in all outputs (excluding coinbase and thus reward [ie subsidy + totalfee]).
273
270
pub total_out : Amount ,
274
271
/// Total size of all non-coinbase transactions.
275
- pub total_size : u64 ,
272
+ pub total_size : u32 ,
276
273
/// Total weight of all non-coinbase transactions divided by segwit scale factor (4).
277
274
pub total_weight : Option < Weight > ,
278
275
/// The fee total.
279
276
pub total_fee : Amount ,
280
277
/// The number of transactions (excluding coinbase).
281
- pub txs : u64 ,
278
+ pub txs : u32 ,
282
279
/// The increase/decrease in the number of unspent outputs.
283
- pub utxo_increase : u64 ,
280
+ pub utxo_increase : i32 ,
284
281
/// The increase/decrease in size for the utxo index (not discounting op_return and similar).
285
- pub utxo_size_increase : u64 ,
282
+ pub utxo_size_increase : i32 ,
286
283
}
287
284
288
285
/// Result of JSON-RPC method `getchaintips`.
@@ -293,11 +290,11 @@ pub struct GetChainTips(pub Vec<ChainTips>);
293
290
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
294
291
pub struct ChainTips {
295
292
/// Height of the chain tip.
296
- pub height : u64 ,
293
+ pub height : u32 ,
297
294
/// Block hash of the tip.
298
295
pub hash : BlockHash ,
299
296
/// Zero for main chain.
300
- pub branch_length : u64 ,
297
+ pub branch_length : u32 ,
301
298
/// "active" for the main chain.
302
299
pub status : ChainTipsStatus ,
303
300
}
@@ -324,17 +321,17 @@ pub struct GetChainTxStats {
324
321
/// The timestamp for the final block in the window in UNIX format.
325
322
pub time : u32 ,
326
323
/// The total number of transactions in the chain up to that point.
327
- pub tx_count : u64 ,
324
+ pub tx_count : u32 ,
328
325
/// The hash of the final block in the window.
329
326
pub window_final_block_hash : BlockHash ,
330
327
/// Size of the window in number of blocks.
331
- pub window_block_count : u64 ,
328
+ pub window_block_count : u32 ,
332
329
/// The number of transactions in the window. Only returned if "window_block_count" is > 0.
333
- pub window_tx_count : Option < u64 > ,
330
+ pub window_tx_count : Option < u32 > ,
334
331
/// The elapsed time in the window in seconds. Only returned if "window_block_count" is > 0.
335
- pub window_interval : Option < u64 > ,
332
+ pub window_interval : Option < u32 > ,
336
333
/// The average rate of transactions per second in the window. Only returned if "window_interval" is > 0.
337
- pub tx_rate : Option < u64 > ,
334
+ pub tx_rate : Option < u32 > ,
338
335
}
339
336
340
337
/// Result of JSON-RPC method `getdifficulty`.
@@ -354,8 +351,8 @@ pub struct GetMempoolAncestorsVerbose {}
354
351
pub struct GetTxOut {
355
352
/// The hash of the block at the tip of the chain.
356
353
pub best_block : BlockHash ,
357
- /// The number of confirmations.
358
- pub confirmations : u32 ,
354
+ /// The number of confirmations (signed to match other types with the same field name) .
355
+ pub confirmations : i64 ,
359
356
/// The returned `TxOut` (strongly typed).
360
357
pub tx_out : TxOut ,
361
358
/// Address that `tx_out` spends to.
0 commit comments