Add HistoricalBatch type
This commit is contained in:
parent
142aaae8ce
commit
15c3e5eab5
22
eth2/types/src/historical_batch.rs
Normal file
22
eth2/types/src/historical_batch.rs
Normal 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);
|
||||||
|
}
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user