2019-05-20 08:01:51 +00:00
|
|
|
use crate::*;
|
2021-07-09 06:15:32 +00:00
|
|
|
use ssz::Encode;
|
2019-05-20 08:01:51 +00:00
|
|
|
|
2019-11-26 23:54:46 +00:00
|
|
|
pub mod beacon_state;
|
2019-06-04 03:13:58 +00:00
|
|
|
|
2021-07-09 06:15:32 +00:00
|
|
|
/// Prepare a signed beacon block for storage in the database.
|
|
|
|
#[must_use]
|
|
|
|
pub fn beacon_block_as_kv_store_op<T: EthSpec>(
|
|
|
|
key: &Hash256,
|
|
|
|
block: &SignedBeaconBlock<T>,
|
|
|
|
) -> KeyValueStoreOp {
|
|
|
|
// FIXME(altair): re-add block write/overhead metrics, or remove them
|
|
|
|
let db_key = get_key_for_col(DBColumn::BeaconBlock.into(), key.as_bytes());
|
|
|
|
KeyValueStoreOp::PutKeyValue(db_key, block.as_ssz_bytes())
|
2019-05-20 08:01:51 +00:00
|
|
|
}
|