@@ -217,6 +217,10 @@ pub struct BitcoinChainhookSpecification {
217
217
pub expire_after_occurrence : Option < u64 > ,
218
218
pub predicate : BitcoinPredicateType ,
219
219
pub action : HookAction ,
220
+ pub include_proof : bool ,
221
+ pub include_inputs : bool ,
222
+ pub include_outputs : bool ,
223
+ pub include_witness : bool ,
220
224
}
221
225
222
226
#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , JsonSchema ) ]
@@ -283,6 +287,10 @@ impl BitcoinChainhookFullSpecification {
283
287
expire_after_occurrence : spec. expire_after_occurrence ,
284
288
predicate : spec. predicate ,
285
289
action : spec. action ,
290
+ include_proof : spec. include_proof . unwrap_or ( false ) ,
291
+ include_inputs : spec. include_inputs . unwrap_or ( false ) ,
292
+ include_outputs : spec. include_outputs . unwrap_or ( false ) ,
293
+ include_witness : spec. include_witness . unwrap_or ( false ) ,
286
294
} )
287
295
}
288
296
}
@@ -295,6 +303,14 @@ pub struct BitcoinChainhookNetworkSpecification {
295
303
pub end_block : Option < u64 > ,
296
304
#[ serde( skip_serializing_if = "Option::is_none" ) ]
297
305
pub expire_after_occurrence : Option < u64 > ,
306
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
307
+ pub include_proof : Option < bool > ,
308
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
309
+ pub include_inputs : Option < bool > ,
310
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
311
+ pub include_outputs : Option < bool > ,
312
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
313
+ pub include_witness : Option < bool > ,
298
314
#[ serde( rename = "if_this" ) ]
299
315
pub predicate : BitcoinPredicateType ,
300
316
#[ serde( rename = "then_that" ) ]
@@ -456,40 +472,6 @@ pub enum BitcoinPredicateType {
456
472
Protocol ( Protocols ) ,
457
473
}
458
474
459
- impl BitcoinPredicateType {
460
- pub fn include_inputs ( & self ) -> bool {
461
- match & self {
462
- BitcoinPredicateType :: Block => true ,
463
- BitcoinPredicateType :: Txid ( _rules) => true ,
464
- BitcoinPredicateType :: Inputs ( _rules) => true ,
465
- BitcoinPredicateType :: Outputs ( _rules) => false ,
466
- BitcoinPredicateType :: Protocol ( Protocols :: Ordinal ( _) ) => false ,
467
- BitcoinPredicateType :: Protocol ( Protocols :: Stacks ( _) ) => false ,
468
- }
469
- }
470
-
471
- pub fn include_outputs ( & self ) -> bool {
472
- match & self {
473
- BitcoinPredicateType :: Block => true ,
474
- BitcoinPredicateType :: Txid ( _rules) => true ,
475
- BitcoinPredicateType :: Inputs ( _rules) => false ,
476
- BitcoinPredicateType :: Outputs ( _rules) => true ,
477
- BitcoinPredicateType :: Protocol ( Protocols :: Ordinal ( _) ) => true ,
478
- BitcoinPredicateType :: Protocol ( Protocols :: Stacks ( _) ) => false ,
479
- }
480
- }
481
-
482
- pub fn include_witness ( & self ) -> bool {
483
- match & self {
484
- BitcoinPredicateType :: Block => true ,
485
- BitcoinPredicateType :: Txid ( _rules) => true ,
486
- BitcoinPredicateType :: Inputs ( _rules) => false ,
487
- BitcoinPredicateType :: Outputs ( _rules) => false ,
488
- BitcoinPredicateType :: Protocol ( _rules) => false ,
489
- }
490
- }
491
- }
492
-
493
475
#[ derive( Clone , Debug , Serialize , Deserialize , PartialEq , JsonSchema ) ]
494
476
#[ serde( rename_all = "snake_case" ) ]
495
477
pub enum InputPredicate {
0 commit comments