File tree 2 files changed +11
-1
lines changed
chainhook-cli/src/service
chainhook-sdk/src/chainhooks
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,12 @@ impl Service {
253
253
ObserverEvent :: PredicateEnabled ( spec) => {
254
254
if let Some ( ref mut predicates_db_conn) = predicates_db_conn {
255
255
update_predicate_spec ( & spec. key ( ) , & spec, predicates_db_conn, & self . ctx ) ;
256
+ update_predicate_status (
257
+ & spec. key ( ) ,
258
+ PredicateStatus :: InitialScanCompleted ,
259
+ predicates_db_conn,
260
+ & self . ctx ,
261
+ ) ;
256
262
}
257
263
}
258
264
ObserverEvent :: PredicateDeregistered ( chainhook) => {
@@ -311,6 +317,7 @@ impl Service {
311
317
} ;
312
318
313
319
for ( predicate_uuid, blocks_ids) in report. predicates_evaluated . iter ( ) { }
320
+
314
321
for ( predicate_uuid, blocks_ids) in report. predicates_triggered . iter ( ) { }
315
322
// Every 32 blocks, we will check if there's a new Stacks file archive to ingest
316
323
if stacks_event > 32 {
@@ -338,6 +345,7 @@ impl Service {
338
345
pub enum PredicateStatus {
339
346
Scanning ( ScanningData ) ,
340
347
Streaming ( StreamingData ) ,
348
+ InitialScanCompleted ,
341
349
Interrupted ( String ) ,
342
350
Disabled ,
343
351
}
Original file line number Diff line number Diff line change @@ -64,12 +64,13 @@ impl ChainhookConfig {
64
64
Ok ( spec)
65
65
}
66
66
67
- pub fn enable_specification ( & mut self , predicate_spec : & ChainhookSpecification ) {
67
+ pub fn enable_specification ( & mut self , predicate_spec : & mut ChainhookSpecification ) {
68
68
match predicate_spec {
69
69
ChainhookSpecification :: Stacks ( spec_to_enable) => {
70
70
for spec in self . stacks_chainhooks . iter_mut ( ) {
71
71
if spec. uuid . eq ( & spec_to_enable. uuid ) {
72
72
spec. enabled = true ;
73
+ spec_to_enable. enabled = true ;
73
74
break ;
74
75
}
75
76
}
@@ -78,6 +79,7 @@ impl ChainhookConfig {
78
79
for spec in self . bitcoin_chainhooks . iter_mut ( ) {
79
80
if spec. uuid . eq ( & spec_to_enable. uuid ) {
80
81
spec. enabled = true ;
82
+ spec_to_enable. enabled = true ;
81
83
break ;
82
84
}
83
85
}
You can’t perform that action at this time.
0 commit comments