Skip to content

Commit

Permalink
use serde_json
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Sep 24, 2024
1 parent ba279f3 commit bf5cd2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
24 changes: 1 addition & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/exex/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tokio.workspace = true
## misc
eyre.workspace = true
metrics.workspace = true
rmp-serde = "1.3"
serde_json.workspace = true
tracing.workspace = true

[dev-dependencies]
Expand Down
10 changes: 7 additions & 3 deletions crates/exex/exex/src/wal/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,18 @@ impl Storage {
}
}

fn write_notification(w: &mut impl Write, notification: &ExExNotification) -> eyre::Result<()> {
rmp_serde::encode::write(w, notification)?;
// TODO(alexey): use rmp-serde when Alloy and Reth serde issues are resolved

fn write_notification(mut w: &mut impl Write, notification: &ExExNotification) -> eyre::Result<()> {
// rmp_serde::encode::write(w, notification)?;
serde_json::to_writer(&mut w, notification)?;
w.flush()?;
Ok(())
}

fn read_notification(r: &mut impl Read) -> eyre::Result<ExExNotification> {
Ok(rmp_serde::from_read(r)?)
// Ok(rmp_serde::from_read(r)?)
Ok(serde_json::from_reader(r)?)
}

#[cfg(test)]
Expand Down

0 comments on commit bf5cd2b

Please sign in to comment.