Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added serde support #257

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dusk_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ 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
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", "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