@@ -18,14 +18,17 @@ use crate::ScriptPubkey;
18
18
19
19
/// Models the result of JSON-RPC method `getbestblockhash`.
20
20
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
21
+ #[ serde( deny_unknown_fields) ]
21
22
pub struct GetBestBlockHash ( pub BlockHash ) ;
22
23
23
24
/// Models the result of JSON-RPC method `getblock` with verbosity set to 0.
24
25
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
26
+ #[ serde( deny_unknown_fields) ]
25
27
pub struct GetBlockVerboseZero ( pub Block ) ;
26
28
27
29
/// Models the result of JSON-RPC method `getblock` with verbosity set to 1.
28
30
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
31
+ #[ serde( deny_unknown_fields) ]
29
32
pub struct GetBlockVerboseOne {
30
33
/// The block hash (same as provided) in RPC call.
31
34
pub hash : BlockHash ,
@@ -69,6 +72,7 @@ pub struct GetBlockVerboseOne {
69
72
70
73
/// Models the result of JSON-RPC method `getblockchaininfo`.
71
74
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
75
+ #[ serde( deny_unknown_fields) ]
72
76
pub struct GetBlockchainInfo {
73
77
/// Current network name as defined in BIP70 (main, test, signet, regtest).
74
78
pub chain : Network ,
@@ -114,6 +118,7 @@ pub struct GetBlockchainInfo {
114
118
115
119
/// Status of softfork.
116
120
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
121
+ #[ serde( deny_unknown_fields) ]
117
122
pub struct Softfork {
118
123
/// The [`SoftforkType`]: one of "buried", "bip9".
119
124
#[ serde( rename = "type" ) ]
@@ -142,6 +147,7 @@ pub enum SoftforkType {
142
147
143
148
/// Status of BIP-9 softforks.
144
149
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
150
+ #[ serde( deny_unknown_fields) ]
145
151
pub struct Bip9SoftforkInfo {
146
152
/// One of "defined", "started", "locked_in", "active", "failed".
147
153
pub status : Bip9SoftforkStatus ,
@@ -176,6 +182,7 @@ pub enum Bip9SoftforkStatus {
176
182
177
183
/// Statistics for a BIP-9 softfork.
178
184
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
185
+ #[ serde( deny_unknown_fields) ]
179
186
pub struct Bip9SoftforkStatistics {
180
187
/// The length in blocks of the BIP9 signalling period.
181
188
pub period : u32 ,
@@ -191,10 +198,12 @@ pub struct Bip9SoftforkStatistics {
191
198
192
199
/// Models the result of JSON-RPC method `getblockcount`.
193
200
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
201
+ #[ serde( deny_unknown_fields) ]
194
202
pub struct GetBlockCount ( pub u64 ) ;
195
203
196
204
/// Models the result of JSON-RPC method `getblockfilter`.
197
205
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
206
+ #[ serde( deny_unknown_fields) ]
198
207
pub struct GetBlockFilter {
199
208
/// The filter data.
200
209
pub filter : Vec < u8 > ,
@@ -204,14 +213,17 @@ pub struct GetBlockFilter {
204
213
205
214
/// Models the result of JSON-RPC method `getblockhash`.
206
215
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
216
+ #[ serde( deny_unknown_fields) ]
207
217
pub struct GetBlockHash ( pub BlockHash ) ;
208
218
209
219
/// Models the result of JSON-RPC method `getblockheader`.
210
220
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
221
+ #[ serde( deny_unknown_fields) ]
211
222
pub struct GetBlockHeader ( pub block:: Header ) ;
212
223
213
224
/// Models the result of JSON-RPC method `getblockheader`.
214
225
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
226
+ #[ serde( deny_unknown_fields) ]
215
227
pub struct GetBlockHeaderVerbose {
216
228
/// the block hash (same as provided).
217
229
pub hash : BlockHash ,
@@ -247,6 +259,7 @@ pub struct GetBlockHeaderVerbose {
247
259
248
260
/// Models the result of JSON-RPC method `getblockstats`.
249
261
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
262
+ #[ serde( deny_unknown_fields) ]
250
263
pub struct GetBlockStats {
251
264
/// Average fee in the block.
252
265
pub average_fee : Amount ,
@@ -316,10 +329,12 @@ pub struct GetBlockStats {
316
329
317
330
/// Models the result of JSON-RPC method `getchaintips`.
318
331
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
332
+ #[ serde( deny_unknown_fields) ]
319
333
pub struct GetChainTips ( pub Vec < ChainTips > ) ;
320
334
321
335
/// An individual list item from the result of JSON-RPC method `getchaintips`.
322
336
#[ derive( Clone , PartialEq , Eq , Debug , Deserialize , Serialize ) ]
337
+ #[ serde( deny_unknown_fields) ]
323
338
pub struct ChainTips {
324
339
/// Height of the chain tip.
325
340
pub height : u32 ,
@@ -349,6 +364,7 @@ pub enum ChainTipsStatus {
349
364
350
365
/// Models the result of JSON-RPC method `getchaintxstats`.
351
366
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
367
+ #[ serde( deny_unknown_fields) ]
352
368
pub struct GetChainTxStats {
353
369
/// The timestamp for the final block in the window in UNIX format.
354
370
pub time : u32 ,
@@ -370,30 +386,37 @@ pub struct GetChainTxStats {
370
386
371
387
/// Models the result of JSON-RPC method `getdifficulty`.
372
388
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
389
+ #[ serde( deny_unknown_fields) ]
373
390
pub struct GetDifficulty ( pub f64 ) ;
374
391
375
392
/// Models the result of JSON-RPC method `getmempoolancestors` with verbose set to false.
376
393
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
394
+ #[ serde( deny_unknown_fields) ]
377
395
pub struct GetMempoolAncestors ( pub Vec < Txid > ) ;
378
396
379
397
/// Models the result of JSON-RPC method `getmempoolancestors` with verbose set to true.
380
398
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
399
+ #[ serde( deny_unknown_fields) ]
381
400
pub struct GetMempoolAncestorsVerbose ( pub BTreeMap < Txid , MempoolEntry > ) ;
382
401
383
402
/// Models the result of JSON-RPC method `getmempoolancestors` with verbose set to false.
384
403
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
404
+ #[ serde( deny_unknown_fields) ]
385
405
pub struct GetMempoolDescendants ( pub Vec < Txid > ) ;
386
406
387
407
/// Models the result of JSON-RPC method `getmempooldescendants` with verbose set to true.
388
408
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
409
+ #[ serde( deny_unknown_fields) ]
389
410
pub struct GetMempoolDescendantsVerbose ( pub BTreeMap < Txid , MempoolEntry > ) ;
390
411
391
412
/// Models the result of JSON-RPC method `getmempoolentry`.
392
413
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
414
+ #[ serde( deny_unknown_fields) ]
393
415
pub struct GetMempoolEntry ( pub MempoolEntry ) ;
394
416
395
417
/// A relative (ancestor or descendant) transaction of a transaction in the mempool.
396
418
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
419
+ #[ serde( deny_unknown_fields) ]
397
420
pub struct MempoolEntry {
398
421
/// Virtual transaction size as defined in BIP 141. v0.19 and later only.
399
422
///
@@ -436,6 +459,7 @@ pub struct MempoolEntry {
436
459
437
460
/// (No docs in Core v0.17.)
438
461
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
462
+ #[ serde( deny_unknown_fields) ]
439
463
pub struct MempoolEntryFees {
440
464
/// Transaction fee in BTC.
441
465
pub base : Amount ,
@@ -449,6 +473,7 @@ pub struct MempoolEntryFees {
449
473
450
474
/// Models the result of JSON-RPC method `getmempoolinfo` with verbose set to true.
451
475
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
476
+ #[ serde( deny_unknown_fields) ]
452
477
pub struct GetMempoolInfo {
453
478
/// True if the mempool is fully loaded. v0.19 and later only.
454
479
pub loaded : Option < bool > ,
@@ -482,14 +507,17 @@ pub struct GetMempoolInfo {
482
507
483
508
/// Models the result of JSON-RPC method `getrawmempool` with verbose set to false.
484
509
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
510
+ #[ serde( deny_unknown_fields) ]
485
511
pub struct GetRawMempool ( pub Vec < Txid > ) ;
486
512
487
513
/// Models the result of JSON-RPC method `getrawmempool` with verbose set to true.
488
514
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
515
+ #[ serde( deny_unknown_fields) ]
489
516
pub struct GetRawMempoolVerbose ( pub BTreeMap < Txid , MempoolEntry > ) ;
490
517
491
518
/// Models the result of JSON-RPC method `gettxout`.
492
519
#[ derive( Clone , Debug , PartialEq , Eq , Deserialize , Serialize ) ]
520
+ #[ serde( deny_unknown_fields) ]
493
521
pub struct GetTxOut {
494
522
/// The hash of the block at the tip of the chain.
495
523
pub best_block : BlockHash ,
@@ -507,6 +535,7 @@ pub struct GetTxOut {
507
535
508
536
/// Models the result of JSON-RPC method `gettxoutsetinfo`.
509
537
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
538
+ #[ serde( deny_unknown_fields) ]
510
539
pub struct GetTxOutSetInfo {
511
540
/// The current block height (index).
512
541
pub height : u32 ,
@@ -533,10 +562,12 @@ pub struct GetTxOutSetInfo {
533
562
534
563
/// Models the result of JSON-RPC method `verifytxoutproof`.
535
564
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
565
+ #[ serde( deny_unknown_fields) ]
536
566
pub struct VerifyTxOutProof ( pub Vec < Txid > ) ;
537
567
538
568
/// Models the result of the JSON-RPC method `getdescriptoractivity`.
539
569
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
570
+ #[ serde( deny_unknown_fields) ]
540
571
pub struct GetDescriptorActivity {
541
572
/// A list of activity events related to the descriptors.
542
573
pub activity : Vec < ActivityEntry > ,
@@ -553,6 +584,7 @@ pub enum ActivityEntry {
553
584
554
585
/// Models a 'spend' activity event with strongly typed fields.
555
586
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
587
+ #[ serde( deny_unknown_fields) ]
556
588
pub struct SpendActivity {
557
589
/// The total amount of the spent output.
558
590
pub amount : Amount ,
@@ -574,6 +606,7 @@ pub struct SpendActivity {
574
606
575
607
/// Models a 'receive' activity event with strongly typed fields.
576
608
#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
609
+ #[ serde( deny_unknown_fields) ]
577
610
pub struct ReceiveActivity {
578
611
/// The total amount in BTC of the new output, converted to `bitcoin::Amount`.
579
612
pub amount : Amount ,
0 commit comments