Skip to content

Commit

Permalink
Added serde feature
Browse files Browse the repository at this point in the history
  • Loading branch information
d-sonuga committed Dec 16, 2024
1 parent acbcd32 commit bd48bb6
Show file tree
Hide file tree
Showing 6 changed files with 817 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dusk_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
name: test core
uses: dusk-network/.github/.github/workflows/run-tests.yml@main
with:
test_flags: -p phoenix-core --features=alloc
test_flags: -p phoenix-core --features=alloc,serde

test_core_rkyv:
name: test core rkyv compiles
uses: dusk-network/.github/.github/workflows/run-tests.yml@main
with:
test_flags: -p phoenix-core --features=rkyv-impl,alloc --no-run
test_flags: -p phoenix-core --features=rkyv-impl,alloc,serde --no-run

test_circuits:
name: test cirucits
Expand Down
5 changes: 5 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Add jubjub-elgamal dependency [#255]
- Add serde `Serialize` and `Deserialize` implementations for `PublicKey`, `SecretKey`, `ViewKey`,
`NoteType`, `StealthAddress`, `Sender`, `Note` and `TxSkeleton` [#258]
- Add `serde`, `bs58`, `base64`, `hex` and `serde_json` optional dependencies [#258]
- Add `serde` feature [#258]

### Removed

Expand Down Expand Up @@ -396,6 +400,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Canonical implementation shielded by feature.

<!-- ISSUES -->
[#258]: https://github.com/dusk-network/phoenix/issues/258
[#255]: https://github.com/dusk-network/phoenix/issues/255
[#240]: https://github.com/dusk-network/phoenix/issues/240
[#222]: https://github.com/dusk-network/phoenix/issues/222
Expand Down
6 changes: 6 additions & 0 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ aes-gcm = { version = "0.10", default-features = false, features = ["aes", "allo
zeroize = { version = "1", default-features = false, features = ["derive"] }
rkyv = { version = "0.7", optional = true, default-features = false }
bytecheck = { version = "0.6", optional = true, default-features = false }
serde = { version = "1.0", optional = true }
bs58 = { version = "0.4" , optional = true }
base64 = { version = "0.22", optional = true }
serde_json = { version = "1.0", optional = true }
hex = { version = "0.4" , optional = true }

[dev-dependencies]
assert_matches = "1.3"
Expand All @@ -39,3 +44,4 @@ rkyv-impl = [
"rkyv",
"bytecheck"
]
serde = ["dep:serde", "dusk-bls12_381/serde", "bs58", "base64", "hex", "serde_json", "dusk-jubjub/serde"]
3 changes: 3 additions & 0 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ mod stealth_address;
#[cfg(feature = "alloc")]
mod transaction;

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

/// The number of output notes in a transaction
pub const OUTPUT_NOTES: usize = 2;

Expand Down
Loading

0 comments on commit bd48bb6

Please sign in to comment.