Skip to content

Commit

Permalink
Update to current chia_rs
Browse files Browse the repository at this point in the history
  • Loading branch information
xearl4 committed Jul 10, 2024
1 parent 3a35c95 commit 08960ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ name = "chia"
[dependencies]
anyhow = "1.0.54"
bech32 = "0.8.1"
# Needed until std::error (PR#123) and serde (PR#) PRs are merged.
chia-protocol = { git = "https://github.com/xchdata/chia_rs", branch = "main", features = ["serde"] }
# Needed until serde (PR127#) is merged.
chia-protocol = { git = "https://github.com/xchdata/chia_rs", branch = "serde-2024", features = ["serde"] }
chia-traits = { git = "https://github.com/xchdata/chia_rs", branch = "serde-2024" }
serde_json = "1.0.91"
zstd = "0.12.2"
sha2 = "0.10.2"
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ fn chia_amount_int<'a>(ctx: &Context) -> anyhow::Result<ToSqlOutput<'a>> {
}

fn chia_fullblock_json<'a>(ctx: &Context) -> anyhow::Result<ToSqlOutput<'a>> {
use chia_protocol::Streamable;
use chia_traits::streamable::Streamable;
let blob = ctx.get::<Vec<u8>>(0)?;
let block = chia_protocol::FullBlock::parse(&mut Cursor::new(&blob))?;
let block = chia_protocol::FullBlock::parse::<true>(&mut Cursor::new(&blob))?;
let json: String = serde_json::to_string(&block)?;
Ok(ToSqlOutput::Owned(Value::Text(json)))
}
Expand Down

0 comments on commit 08960ed

Please sign in to comment.