Skip to content

Commit

Permalink
Merge of #4693
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 27, 2022
2 parents d9df790 + 1a4e8d7 commit 195abfb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion zebra-chain/src/serialization/error.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Errors for transaction serialization.
//! Errors for Zcash consensus-critical serialization.
use std::{array::TryFromSliceError, io, num::TryFromIntError, str::Utf8Error};

Expand Down
18 changes: 8 additions & 10 deletions zebra-chain/src/serialization/zcash_deserialize.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
use std::{
convert::{TryFrom, TryInto},
io,
net::Ipv6Addr,
sync::Arc,
};
//! Converting bytes into Zcash consensus-critical data structures.
use std::{io, net::Ipv6Addr, sync::Arc};

use super::{AtLeastOne, CompactSizeMessage, SerializationError, MAX_PROTOCOL_MESSAGE_LEN};

/// Consensus-critical serialization for Zcash.
/// Consensus-critical deserialization for Zcash.
///
/// This trait provides a generic deserialization for consensus-critical
/// formats, such as network messages, transactions, blocks, etc. It is intended
/// for use only in consensus-critical contexts; in other contexts, such as
/// internal storage, it would be preferable to use Serde.
/// formats, such as network messages, transactions, blocks, etc.
///
/// It is intended for use only for consensus-critical formats.
/// Internal deserialization can freely use `serde`, or any other format.
pub trait ZcashDeserialize: Sized {
/// Try to read `self` from the given `reader`.
///
Expand Down
11 changes: 7 additions & 4 deletions zebra-chain/src/serialization/zcash_serialize.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::{convert::TryInto, io, net::Ipv6Addr};
//! Converting Zcash consensus-critical data structures into bytes.
use std::{io, net::Ipv6Addr};

use super::{AtLeastOne, CompactSizeMessage};

Expand All @@ -10,9 +12,10 @@ pub const MAX_PROTOCOL_MESSAGE_LEN: usize = 2 * 1024 * 1024;
/// Consensus-critical serialization for Zcash.
///
/// This trait provides a generic serialization for consensus-critical
/// formats, such as network messages, transactions, blocks, etc. It is intended
/// for use only in consensus-critical contexts; in other contexts, such as
/// internal storage, it would be preferable to use Serde.
/// formats, such as network messages, transactions, blocks, etc.
///
/// It is intended for use only for consensus-critical formats.
/// Internal serialization can freely use `serde`, or any other format.
pub trait ZcashSerialize: Sized {
/// Write `self` to the given `writer` using the canonical format.
///
Expand Down

0 comments on commit 195abfb

Please sign in to comment.