mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-18 12:22:51 +00:00
Payload envelope db operations (#8717)
Adds support for payload envelopes in the db. This is the minimum we'll need to store and fetch payloads. Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
use ssz::{Decode, Encode};
|
||||
use types::{EthSpec, SignedExecutionPayloadEnvelope};
|
||||
|
||||
use crate::{DBColumn, Error, StoreItem};
|
||||
|
||||
impl<E: EthSpec> StoreItem for SignedExecutionPayloadEnvelope<E> {
|
||||
fn db_column() -> DBColumn {
|
||||
DBColumn::PayloadEnvelope
|
||||
}
|
||||
|
||||
fn as_store_bytes(&self) -> Vec<u8> {
|
||||
self.as_ssz_bytes()
|
||||
}
|
||||
|
||||
fn from_store_bytes(bytes: &[u8]) -> Result<Self, Error> {
|
||||
Ok(Self::from_ssz_bytes(bytes)?)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user