Skip to content

Commit

Permalink
dusk-core: added serde support
Browse files Browse the repository at this point in the history
  • Loading branch information
d-sonuga committed Dec 30, 2024
1 parent 9a47c2d commit be97d5f
Show file tree
Hide file tree
Showing 5 changed files with 1,779 additions and 1 deletion.
17 changes: 17 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ ark-bn254 = { workspace = true, features = ["curve"], optional = true }
ark-relations = { workspace = true, optional = true }
ark-serialize = { workspace = true, optional = true }

# serde support dependencies
serde = { workspace = true, features = ["derive"], optional = true }
serde_json = { workspace = true, optional = true }
hex = { workspace = true, optional = true }
base64 = { workspace = true, optional = true }

[dev-dependencies]
rand = { workspace = true, features = ["std", "std_rng"] }

Expand Down Expand Up @@ -63,3 +69,14 @@ groth16 = [

# Enables std feature for dusk-plonk
std = ["dusk-plonk/std"]

serde = [
"dep:serde",
"serde_json",
"hex",
"base64",
"piecrust-uplink/serde",
"bls12_381-bls/serde",
"phoenix-core/serde",
"dusk-jubjub/serde",
]
2 changes: 1 addition & 1 deletion core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

test:
cargo test --release --features zk
cargo test --release --features zk,serde
cargo test --release --no-run

clippy: ## Run clippy
Expand Down
3 changes: 3 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ pub use error::Error;
mod dusk;
pub use dusk::{dusk, from_dusk, Dusk, LUX};

#[cfg(feature = "serde")]
mod serde_support;

// elliptic curve types
pub use dusk_bls12_381::BlsScalar;
pub use dusk_jubjub::{
Expand Down
Loading

0 comments on commit be97d5f

Please sign in to comment.