mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Clear out old v2.0 objects
This commit is contained in:
@@ -2,9 +2,6 @@ extern crate ethereum_types;
|
||||
extern crate blake2;
|
||||
extern crate crypto_mac;
|
||||
|
||||
use super::state::active_state;
|
||||
use super::state::crystallized_state;
|
||||
|
||||
pub mod types;
|
||||
pub mod bls;
|
||||
pub mod test_helpers;
|
||||
|
||||
@@ -1,39 +1,11 @@
|
||||
use super::ethereum_types::{ H256, H160 };
|
||||
use super::active_state::ActiveState;
|
||||
use super::crystallized_state::CrystallizedState;
|
||||
use super::boolean_bitfield::BooleanBitfield;
|
||||
|
||||
pub use super::blake2::Blake2s;
|
||||
pub use super::ethereum_types::U256;
|
||||
|
||||
// TODO: presently the compiler accepts these two types
|
||||
// as interchangable. This is somewhat loose typing,
|
||||
// which is bad. Make the compiler think they're incompatible.
|
||||
pub type Sha256Digest = H256;
|
||||
pub type Blake2sDigest = H256;
|
||||
pub type Hash256 = H256;
|
||||
|
||||
pub type Address = H160;
|
||||
|
||||
pub struct StateHash {
|
||||
pub active_state: Blake2sDigest,
|
||||
pub crystallized_state: Blake2sDigest
|
||||
}
|
||||
|
||||
impl StateHash {
|
||||
pub fn zero() -> Self {
|
||||
Self {
|
||||
active_state: Blake2sDigest::zero(),
|
||||
crystallized_state: Blake2sDigest::zero()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_states(active: &ActiveState, crystal: &CrystallizedState) -> Self {
|
||||
Self {
|
||||
active_state: active.blake2s_hash(),
|
||||
crystallized_state: crystal.blake2s_hash()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub type Bitfield = BooleanBitfield;
|
||||
|
||||
Reference in New Issue
Block a user