Add HistoricalBatch type

This commit is contained in:
Paul Hauner 2019-03-15 15:52:17 +11:00
parent 142aaae8ce
commit 15c3e5eab5
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,22 @@
use crate::test_utils::TestRandom;
use crate::Hash256;
use rand::RngCore;
use serde_derive::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode, TreeHash};
use test_random_derive::TestRandom;
/// Historical block and state roots.
///
/// Spec v0.5.0
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Encode, Decode, TreeHash, TestRandom)]
pub struct HistoricalBatch {
pub block_roots: Vec<Hash256>,
pub state_roots: Vec<Hash256>,
}
#[cfg(test)]
mod tests {
use super::*;
ssz_tests!(HistoricalBatch);
}

View File

@ -20,6 +20,7 @@ pub mod eth1_data;
pub mod eth1_data_vote; pub mod eth1_data_vote;
pub mod fork; pub mod fork;
pub mod free_attestation; pub mod free_attestation;
pub mod historical_batch;
pub mod pending_attestation; pub mod pending_attestation;
pub mod proposal; pub mod proposal;
pub mod proposer_slashing; pub mod proposer_slashing;
@ -55,6 +56,7 @@ pub use crate::eth1_data::Eth1Data;
pub use crate::eth1_data_vote::Eth1DataVote; pub use crate::eth1_data_vote::Eth1DataVote;
pub use crate::fork::Fork; pub use crate::fork::Fork;
pub use crate::free_attestation::FreeAttestation; pub use crate::free_attestation::FreeAttestation;
pub use crate::historical_batch::HistoricalBatch;
pub use crate::pending_attestation::PendingAttestation; pub use crate::pending_attestation::PendingAttestation;
pub use crate::proposal::Proposal; pub use crate::proposal::Proposal;
pub use crate::proposer_slashing::ProposerSlashing; pub use crate::proposer_slashing::ProposerSlashing;