Skip to content
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
65 changes: 54 additions & 11 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [


[workspace.package]
version = "3.0.9"
version = "3.0.10"

[profile.release]
lto = true
Expand Down
3 changes: 3 additions & 0 deletions masp_primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ blake2s_simd = "1"
aes = "0.8"
fpe = "0.6"

serde = {version = "1.0.228", features = ["derive"], optional = true}
serde-hex = {version = "0.1.0", optional = true}
borsh = {version = "1.2.0", features = ["unstable__schema", "derive"]}
arbitrary = {version = "1.3", features = ["derive"], optional = true }

Expand All @@ -89,6 +91,7 @@ assert_matches = "1.3.0"
rand_xorshift = "0.3"

[features]
serde = ["dep:serde", "dep:serde-hex"]
transparent-inputs = []
test-dependencies = ["proptest"]
default = ["transparent-inputs"]
Expand Down
9 changes: 8 additions & 1 deletion masp_primitives/src/sapling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ use group::{Curve, Group, GroupEncoding, cofactor::CofactorGroup};
use incrementalmerkletree::{self, Level};
use lazy_static::lazy_static;
use rand_core::{CryptoRng, RngCore};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[cfg(feature = "serde")]
use serde_hex::{SerHex, Strict};
use std::{
array::TryFromSliceError,
cmp::Ordering,
Expand Down Expand Up @@ -85,9 +89,12 @@ pub fn merkle_hash(depth: usize, lhs: &[u8; 32], rhs: &[u8; 32]) -> [u8; 32] {
}

/// A node within the Sapling commitment tree.
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, BorshSerialize, BorshDeserialize, Default)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(transparent)]
pub struct Node {
#[cfg_attr(feature = "serde", serde(with = "SerHex::<Strict>"))]
repr: [u8; 32],
}

Expand Down
Loading