Delegate Block Encoding to Store (#44)

Builds codecs to encode and decode blocks, block headers, transactions, kernels, etc. Will be used by the store and peer-to-peer layer for serialization, but also to compute hashes. Separates out serialization from core.
This commit is contained in:
Jacob Payne
2017-05-03 10:27:38 -07:00
committed by Ignotus Peverell
parent 2787d4259a
commit 8ffc0c6f8e
7 changed files with 962 additions and 1 deletions
+2
View File
@@ -36,6 +36,7 @@ bitflags! {
}
/// Block header, fairly standard compared to other blockchains.
#[derive(Clone, Debug)]
pub struct BlockHeader {
/// Height of this block since the genesis block (height 0)
pub height: u64,
@@ -138,6 +139,7 @@ impl Readable for BlockHeader {
/// non-explicit, assumed to be deducible from block height (similar to
/// bitcoin's schedule) and expressed as a global transaction fee (added v.H),
/// additive to the total of fees ever collected.
#[derive(Clone, Debug)]
pub struct Block {
/// The header with metadata and commitments to the rest of the data
pub header: BlockHeader,