diff --git a/components/chainhook-cli/src/service/tests/observer_tests.rs b/components/chainhook-cli/src/service/tests/observer_tests.rs index 449ee137..e06df1d8 100644 --- a/components/chainhook-cli/src/service/tests/observer_tests.rs +++ b/components/chainhook-cli/src/service/tests/observer_tests.rs @@ -170,8 +170,8 @@ async fn start_and_ping_event_observer(config: EventObserverConfig, ingestion_po .unwrap(); await_observer_started(ingestion_port).await; } -#[test_case("/drop_mempool_tx", Method::POST, None)] -#[test_case("/attachments/new", Method::POST, None)] +#[test_case("/drop_mempool_tx", Method::POST, Some(&json!({})))] +#[test_case("/attachments/new", Method::POST, Some(&json!({})))] #[test_case("/mined_block", Method::POST, Some(&json!({})))] #[test_case("/mined_microblock", Method::POST, Some(&json!({})))] #[tokio::test] diff --git a/components/chainhook-sdk/src/observer/http.rs b/components/chainhook-sdk/src/observer/http.rs index 5a5938f5..8f0cbc76 100644 --- a/components/chainhook-sdk/src/observer/http.rs +++ b/components/chainhook-sdk/src/observer/http.rs @@ -301,9 +301,9 @@ pub fn handle_new_mempool_tx( success_response() } -#[post("/drop_mempool_tx", format = "application/json")] -pub fn handle_drop_mempool_tx(ctx: &State) -> Json { - ctx.try_log(|logger| slog::debug!(logger, "POST /drop_mempool_tx")); +#[post("/drop_mempool_tx", format = "application/json", data = "")] +pub fn handle_drop_mempool_tx(payload: Json, ctx: &State) -> Json { + ctx.try_log(|logger| slog::debug!(logger, "POST /drop_mempool_tx {:?}", payload)); // TODO(lgalabru): use propagate mempool events Json(json!({ "status": 200, @@ -311,9 +311,9 @@ pub fn handle_drop_mempool_tx(ctx: &State) -> Json { })) } -#[post("/attachments/new", format = "application/json")] -pub fn handle_new_attachement(ctx: &State) -> Json { - ctx.try_log(|logger| slog::debug!(logger, "POST /attachments/new")); +#[post("/attachments/new", format = "application/json", data = "")] +pub fn handle_new_attachement(payload: Json, ctx: &State) -> Json { + ctx.try_log(|logger| slog::debug!(logger, "POST /attachments/new {:?}", payload)); Json(json!({ "status": 200, "result": "Ok",