Skip to content

Commit

Permalink
fix: fix some issues interfacing with go
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Gellis <simongellis@gmail.com>
  • Loading branch information
SupernaviX committed Feb 7, 2025
1 parent ab9acd3 commit da51af6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion firefly-cardanoconnect/src/routes/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ async fn send_batch(socket: &mut WebSocket, topic: &str, batch: Batch) -> Result
}
error!("client couldn't process batch: {}", err.message);
}
IncomingMessage::ListenReplies => {
// do nothing, we already send replies whether they ask or not
}
other => {
bail!("unexpected response to batch! {:?}", other);
}
Expand Down Expand Up @@ -135,9 +138,10 @@ struct ErrorMessage {
}

#[derive(Debug, Deserialize)]
#[serde(tag = "type", rename_all = "camelCase")]
#[serde(tag = "type", rename_all = "lowercase")]
enum IncomingMessage {
Listen(ListenMessage),
ListenReplies,
Ack(AckMessage),
Error(ErrorMessage),
}
Expand Down
2 changes: 1 addition & 1 deletion firefly-cardanoconnect/src/streams/mux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ impl StreamDispatcher {
stream_id: stream.id,
batch_size: stream.batch_size,
batch_timeout: stream.batch_timeout,
batch_number: 0,
batch_number: 1,
listeners,
hwms,
persistence,
Expand Down
1 change: 1 addition & 0 deletions firefly-cardanoconnect/src/streams/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub enum ListenerType {
#[serde(rename_all = "camelCase")]
pub enum ListenerFilter {
TransactionId(String),
#[serde(rename_all = "camelCase")]
Event {
contract: String,
event_path: String,
Expand Down
1 change: 1 addition & 0 deletions scripts/demo/src/firefly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pub enum ListenerType {
#[serde(rename_all = "camelCase")]
pub enum ListenerFilter {
TransactionId(String),
#[serde(rename_all = "camelCase")]
Event {
contract: String,
event_path: String,
Expand Down

0 comments on commit da51af6

Please sign in to comment.