Skip to content

Commit

Permalink
build(deps): bump serde-big-array from 0.3.2 to 0.4.1 (ZcashFoundatio…
Browse files Browse the repository at this point in the history
…n#4004)

Bumps [serde-big-array](https://github.com/est31/serde-big-array) from 0.3.2 to 0.4.1.
- [Release notes](https://github.com/est31/serde-big-array/releases)
- [Commits](est31/serde-big-array@v0.3.2...v0.4.1)

---
updated-dependencies:
- dependency-name: serde-big-array
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
conradoplg and mergify[bot] authored Mar 31, 2022
1 parent 2ecb773 commit ee6a38d
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 36 deletions.
5 changes: 2 additions & 3 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 zebra-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ rand_core = "0.6.3"
ripemd160 = "0.9"
serde = { version = "1.0.136", features = ["serde_derive", "rc"] }
secp256k1 = { version = "0.21.3", features = ["serde"] }
serde-big-array = "0.3.2"
serde-big-array = "0.4.1"
sha2 = { version = "0.9.9", features=["compress"] }
static_assertions = "1.1.0"
subtle = "2.4.1"
Expand Down
2 changes: 0 additions & 2 deletions zebra-chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

#[macro_use]
extern crate serde;
#[macro_use]
extern crate serde_big_array;

#[macro_use]
extern crate bitflags;
Expand Down
8 changes: 5 additions & 3 deletions zebra-chain/src/orchard/note/ciphertexts.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::{fmt, io};

use crate::serialization::{serde_helpers, SerializationError, ZcashDeserialize, ZcashSerialize};
use serde_big_array::BigArray;

use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};

/// A ciphertext component for encrypted output notes.
///
/// Corresponds to the Orchard 'encCiphertext's
#[derive(Deserialize, Serialize)]
pub struct EncryptedNote(#[serde(with = "serde_helpers::BigArray")] pub(crate) [u8; 580]);
pub struct EncryptedNote(#[serde(with = "BigArray")] pub(crate) [u8; 580]);

// These impls all only exist because of array length restrictions.
// TODO: use const generics https://github.com/ZcashFoundation/zebra/issues/2042
Expand Down Expand Up @@ -68,7 +70,7 @@ impl ZcashDeserialize for EncryptedNote {
///
/// Corresponds to Orchard's 'outCiphertext'
#[derive(Deserialize, Serialize)]
pub struct WrappedNoteKey(#[serde(with = "serde_helpers::BigArray")] pub(crate) [u8; 80]);
pub struct WrappedNoteKey(#[serde(with = "BigArray")] pub(crate) [u8; 80]);

impl fmt::Debug for WrappedNoteKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
5 changes: 3 additions & 2 deletions zebra-chain/src/primitives/proofs/bctv14.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use std::{fmt, io};

use serde::{Deserialize, Serialize};
use serde_big_array::BigArray;

use crate::serialization::{serde_helpers, SerializationError, ZcashDeserialize, ZcashSerialize};
use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};

/// An encoding of a BCTV14 proof, as used in Zcash.
#[derive(Serialize, Deserialize)]
pub struct Bctv14Proof(#[serde(with = "serde_helpers::BigArray")] pub [u8; 296]);
pub struct Bctv14Proof(#[serde(with = "BigArray")] pub [u8; 296]);

impl fmt::Debug for Bctv14Proof {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
8 changes: 5 additions & 3 deletions zebra-chain/src/primitives/proofs/groth16.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use serde::{Deserialize, Serialize};
use std::{fmt, io};

use crate::serialization::{serde_helpers, SerializationError, ZcashDeserialize, ZcashSerialize};
use serde::{Deserialize, Serialize};
use serde_big_array::BigArray;

use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};

/// An encoding of a Groth16 proof, as used in Zcash.
#[derive(Serialize, Deserialize)]
pub struct Groth16Proof(#[serde(with = "serde_helpers::BigArray")] pub [u8; 192]);
pub struct Groth16Proof(#[serde(with = "BigArray")] pub [u8; 192]);

impl fmt::Debug for Groth16Proof {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions zebra-chain/src/primitives/zcash_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod tests;

use std::{collections::BTreeMap, convert::TryInto, io, sync::Arc};

use serde_big_array::BigArray;
pub use zcash_history::{V1, V2};

use crate::{
Expand All @@ -18,8 +19,6 @@ use crate::{
sapling,
};

big_array! { BigArray; zcash_history::MAX_ENTRY_SIZE }

/// A trait to represent a version of `Tree`.
pub trait Version: zcash_history::Version {
/// Convert a Block into the NodeData for this version.
Expand Down
8 changes: 5 additions & 3 deletions zebra-chain/src/sapling/note/ciphertexts.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::{fmt, io};

use crate::serialization::{serde_helpers, SerializationError, ZcashDeserialize, ZcashSerialize};
use serde_big_array::BigArray;

use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};

/// A ciphertext component for encrypted output notes.
///
/// Corresponds to the Sapling 'encCiphertext's
#[derive(Deserialize, Serialize)]
pub struct EncryptedNote(#[serde(with = "serde_helpers::BigArray")] pub(crate) [u8; 580]);
pub struct EncryptedNote(#[serde(with = "BigArray")] pub(crate) [u8; 580]);

impl fmt::Debug for EncryptedNote {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down Expand Up @@ -55,7 +57,7 @@ impl ZcashDeserialize for EncryptedNote {
///
/// Corresponds to Sapling's 'outCiphertext'
#[derive(Deserialize, Serialize)]
pub struct WrappedNoteKey(#[serde(with = "serde_helpers::BigArray")] pub(crate) [u8; 80]);
pub struct WrappedNoteKey(#[serde(with = "BigArray")] pub(crate) [u8; 80]);

impl fmt::Debug for WrappedNoteKey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
12 changes: 0 additions & 12 deletions zebra-chain/src/serialization/serde_helpers.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
use group::GroupEncoding;
use halo2::{arithmetic::FieldExt, pasta::pallas};
use serde_big_array::big_array;

big_array! {
BigArray;
+ 1344, // `EquihashSolution`
80, // `sapling::OutCiphertext`
580, // `sapling::EncryptedCiphertext`
601, // `sprout::EncryptedCiphertext`
296, // `Bctv14Proof`
196, // `Groth16Proof`
}

#[derive(Deserialize, Serialize)]
#[serde(remote = "jubjub::AffinePoint")]
pub struct AffinePoint {
Expand Down
5 changes: 3 additions & 2 deletions zebra-chain/src/sprout/note/ciphertexts.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use std::{fmt, io};

use serde::{Deserialize, Serialize};
use serde_big_array::BigArray;

use crate::serialization::{serde_helpers, SerializationError, ZcashDeserialize, ZcashSerialize};
use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};

/// A ciphertext component for encrypted output notes.
///
/// Corresponds to the Sprout 'encCiphertext's
#[derive(Serialize, Deserialize)]
pub struct EncryptedNote(#[serde(with = "serde_helpers::BigArray")] pub [u8; 601]);
pub struct EncryptedNote(#[serde(with = "BigArray")] pub [u8; 601]);

impl fmt::Debug for EncryptedNote {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
8 changes: 5 additions & 3 deletions zebra-chain/src/work/equihash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
use std::{fmt, io};

use serde_big_array::BigArray;

use crate::{
block::Header,
serialization::{
serde_helpers, zcash_serialize_bytes, SerializationError, ZcashDeserialize,
ZcashDeserializeInto, ZcashSerialize,
zcash_serialize_bytes, SerializationError, ZcashDeserialize, ZcashDeserializeInto,
ZcashSerialize,
},
};

Expand All @@ -28,7 +30,7 @@ pub(crate) const SOLUTION_SIZE: usize = 1344;
/// The size of an Equihash solution in bytes is always 1344 so the
/// length of this type is fixed.
#[derive(Deserialize, Serialize)]
pub struct Solution(#[serde(with = "serde_helpers::BigArray")] pub [u8; SOLUTION_SIZE]);
pub struct Solution(#[serde(with = "BigArray")] pub [u8; SOLUTION_SIZE]);

impl Solution {
/// The length of the portion of the header used as input when verifying
Expand Down

0 comments on commit ee6a38d

Please sign in to comment.