Skip to content

Commit cc7e57a

Browse files
committed
chore: add reset body
1 parent 1422e3b commit cc7e57a

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/sinks/webhook.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,24 @@ impl gasket::framework::Worker<Stage> for Worker {
6464
.header("x-oura-chainsync-point", point_header)
6565
.json(&body)
6666
}
67+
ChainEvent::Reset(_) => {
68+
let body = serde_json::json!({
69+
"event": "reset",
70+
"point": match &point {
71+
Point::Origin => serde_json::Value::from("origin"),
72+
Point::Specific(slot, hash) => serde_json::json!({
73+
"slot": slot,
74+
"hash": hex::encode(hash),
75+
}),
76+
}
77+
});
6778

68-
ChainEvent::Reset(_) => self
69-
.client
70-
.post(&stage.config.url)
71-
.header("x-oura-chainsync-action", "reset")
72-
.header("x-oura-chainsync-point", point_header),
79+
self.client
80+
.post(&stage.config.url)
81+
.header("x-oura-chainsync-action", "reset")
82+
.header("x-oura-chainsync-point", point_header)
83+
.json(&body)
84+
}
7385
}
7486
.build()
7587
.or_panic()?;

0 commit comments

Comments
 (0)