Skip to content

Commit

Permalink
Implement Zcash(De)serialize traits specifically for MerkleTree<Trans…
Browse files Browse the repository at this point in the history
…action>

This is a general placeholder for now.
  • Loading branch information
dconnolly committed Sep 25, 2019
1 parent d8dac15 commit 7f5846b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
12 changes: 12 additions & 0 deletions zebra-chain/src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ impl From<BlockHeader> for BlockHash {
/// hashed transactions in a block.
pub struct MerkleRootHash([u8; 32]);

impl<Transaction> ZcashSerialize for MerkleTree<Transaction> {
fn zcash_serialize<W: io::Write>(&self, writer: W) -> Result<(), SerializationError> {
unimplemented!();
}
}

impl<Transaction> ZcashDeserialize for MerkleTree<Transaction> {
fn zcash_deserialize<R: io::Read>(reader: R) -> Result<Self, SerializationError> {
unimplemented!();
}
}

impl From<MerkleTree<Transaction>> for MerkleRootHash {
fn from(merkle_tree: MerkleTree<Transaction>) -> Self {
let mut hash_writer = Sha256dWriter::default();
Expand Down
15 changes: 1 addition & 14 deletions zebra-chain/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
//! node values.
use std::io;
use std::io::prelude::*;

use sha2::{Digest, Sha256};
use sha2::Sha256;

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

Expand All @@ -20,15 +19,3 @@ impl<T> MerkleTree<T> {
unimplemented!();
}
}

impl<T> ZcashSerialize for MerkleTree<T> {
fn zcash_serialize<W: io::Write>(&self, writer: W) -> Result<(), SerializationError> {
unimplemented!();
}
}

impl<T> ZcashDeserialize for MerkleTree<T> {
fn zcash_deserialize<R: io::Read>(reader: R) -> Result<Self, SerializationError> {
unimplemented!();
}
}

0 comments on commit 7f5846b

Please sign in to comment.