Clear out old v2.0 objects

This commit is contained in:
Paul Hauner
2018-08-10 11:22:15 +10:00
parent 123c6d7088
commit c36e00a1f6
14 changed files with 20 additions and 385 deletions

View File

@@ -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;

View File

@@ -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;