Remove old DB crates, start fixing fork_choice

This commit is contained in:
Paul Hauner
2019-05-20 18:01:51 +10:00
parent 658b425cce
commit 182135b832
26 changed files with 291 additions and 1846 deletions

View File

@@ -0,0 +1,30 @@
use crate::*;
use ssz::{Decode, Encode};
impl StoreItem for BeaconBlock {
fn db_column() -> DBColumn {
DBColumn::BeaconBlock
}
fn as_store_bytes(&self) -> Vec<u8> {
self.as_ssz_bytes()
}
fn from_store_bytes(bytes: &mut [u8]) -> Result<Self, Error> {
Self::from_ssz_bytes(bytes).map_err(Into::into)
}
}
impl<T: EthSpec> StoreItem for BeaconState<T> {
fn db_column() -> DBColumn {
DBColumn::BeaconState
}
fn as_store_bytes(&self) -> Vec<u8> {
self.as_ssz_bytes()
}
fn from_store_bytes(bytes: &mut [u8]) -> Result<Self, Error> {
Self::from_ssz_bytes(bytes).map_err(Into::into)
}
}