fix: chain mixup, add logs

This commit is contained in:
Ludo Galabru
2023-06-09 09:17:34 -04:00
parent 879ed6775a
commit 0427a10a63
2 changed files with 4 additions and 4 deletions

View File

@@ -181,13 +181,13 @@ impl ChainhookSpecification {
pub fn into_serialized_json(&self) -> JsonValue {
match &self {
Self::Bitcoin(data) => json!({
Self::Stacks(data) => json!({
"chain": "stacks",
"uuid": data.uuid,
"network": data.network,
"predicate": data.predicate,
}),
Self::Stacks(data) => json!({
Self::Bitcoin(data) => json!({
"chain": "bitcoin",
"uuid": data.uuid,
"network": data.network,

View File

@@ -1208,12 +1208,12 @@ pub async fn start_observer_commands_handler(
if let Some(ref tx) = observer_events_tx {
let _ = tx.send(ObserverEvent::PredicateRegistered(spec));
} else {
ctx.try_log(|logger| slog::info!(logger, "Enabling Predicate"));
ctx.try_log(|logger| slog::info!(logger, "Enabling Predicate {}", spec.uuid()));
chainhook_store.predicates.enable_specification(&mut spec);
}
}
ObserverCommand::EnablePredicate(mut spec) => {
ctx.try_log(|logger| slog::info!(logger, "Enabling Predicate"));
ctx.try_log(|logger| slog::info!(logger, "Enabling Predicate {}", spec.uuid()));
chainhook_store.predicates.enable_specification(&mut spec);
if let Some(ref tx) = observer_events_tx {
let _ = tx.send(ObserverEvent::PredicateEnabled(spec));