Skip to content

Commit

Permalink
Merge pull request #3056 from autonomys/no_std-core-serde
Browse files Browse the repository at this point in the history
Remove `serde_arrays` to make `serde` support in `subspace-core-primitives` `no_std`-compatible
  • Loading branch information
nazar-pc authored Sep 24, 2024
2 parents 30c9a31 + 7f0881a commit 2c35fdf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
11 changes: 0 additions & 11 deletions Cargo.lock

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

5 changes: 0 additions & 5 deletions crates/subspace-core-primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ bench = false

[dependencies]
blake3 = { version = "1.5.3", default-features = false }
# TODO: Remove once we switch to big-endian
blst = "0.3.13"
bytes = { version = "1.7.1", default-features = false }
derive_more = { version = "1.0.0", default-features = false, features = ["full"] }
hex = { version = "0.4.3", default-features = false, features = ["alloc"] }
Expand All @@ -30,7 +28,6 @@ rayon = { version = "1.10.0", optional = true }
rust-kzg-blst = { git = "https://github.com/grandinetech/rust-kzg", rev = "6c8fcc623df3d7e8c0f30951a49bfea764f90bf4", default-features = false }
scale-info = { version = "2.11.2", default-features = false, features = ["derive"] }
serde = { version = "1.0.206", optional = true, features = ["alloc", "derive"] }
serde_arrays = { version = "0.1.0", optional = true }
# Replacement for `parking_lot` in `no_std` environment
spin = "0.9.7"
static_assertions = "1.1.0"
Expand Down Expand Up @@ -58,8 +55,6 @@ parallel = [
]
serde = [
"dep:serde",
# TODO: `serde_arrays` doesn't support `no_std` right now: https://github.com/Kromey/serde_arrays/issues/8
"dep:serde_arrays",
"hex/serde",
]
std = [
Expand Down
2 changes: 1 addition & 1 deletion crates/subspace-core-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ impl PublicKey {
)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct RewardSignature(
#[cfg_attr(feature = "serde", serde(with = "serde_arrays"))] [u8; REWARD_SIGNATURE_LENGTH],
#[cfg_attr(feature = "serde", serde(with = "hex"))] [u8; REWARD_SIGNATURE_LENGTH],
);

impl AsRef<[u8]> for RewardSignature {
Expand Down

0 comments on commit 2c35fdf

Please sign in to comment.