complete match for has_context_bytes
This commit is contained in:
parent
fc2d07b4e3
commit
ad9af6d8b1
@ -32,8 +32,16 @@ fn get_store(db_path: &TempDir) -> Arc<HotColdDB> {
|
||||
let cold_path = db_path.path().join("cold_db");
|
||||
let config = StoreConfig::default();
|
||||
let log = NullLoggerBuilder.build().expect("logger should build");
|
||||
HotColdDB::open(&hot_path, &cold_path,None, |_, _, _| Ok(()), config, spec, log)
|
||||
.expect("disk store should initialize")
|
||||
HotColdDB::open(
|
||||
&hot_path,
|
||||
&cold_path,
|
||||
None,
|
||||
|_, _, _| Ok(()),
|
||||
config,
|
||||
spec,
|
||||
log,
|
||||
)
|
||||
.expect("disk store should initialize")
|
||||
}
|
||||
|
||||
fn get_harness(store: Arc<HotColdDB>, validator_count: usize) -> TestHarness {
|
||||
|
@ -60,8 +60,16 @@ fn get_store_with_spec(
|
||||
let config = StoreConfig::default();
|
||||
let log = test_logger();
|
||||
|
||||
HotColdDB::open(&hot_path, &cold_path, None, |_, _, _| Ok(()), config, spec, log)
|
||||
.expect("disk store should initialize")
|
||||
HotColdDB::open(
|
||||
&hot_path,
|
||||
&cold_path,
|
||||
None,
|
||||
|_, _, _| Ok(()),
|
||||
config,
|
||||
spec,
|
||||
log,
|
||||
)
|
||||
.expect("disk store should initialize")
|
||||
}
|
||||
|
||||
fn get_harness(
|
||||
|
@ -41,14 +41,12 @@ use tokio::{
|
||||
};
|
||||
use tokio_stream::wrappers::WatchStream;
|
||||
use types::consts::eip4844::BLOB_TX_TYPE;
|
||||
use types::transaction::{AccessTuple, BlobTransaction, EcdsaSignature, SignedBlobTransaction};
|
||||
use types::{
|
||||
blobs_sidecar::{Blobs, KzgCommitments},
|
||||
ExecutionPayload, ExecutionPayloadCapella, ExecutionPayloadEip4844, ExecutionPayloadMerge,
|
||||
};
|
||||
use types::transaction::{AccessTuple, BlobTransaction, EcdsaSignature, SignedBlobTransaction};
|
||||
use types::{
|
||||
AbstractExecPayload, BeaconStateError, ExecPayload, VersionedHash,
|
||||
};
|
||||
use types::{AbstractExecPayload, BeaconStateError, ExecPayload, VersionedHash};
|
||||
use types::{
|
||||
BlindedPayload, BlockType, ChainSpec, Epoch, ExecutionBlockHash, ForkName,
|
||||
ProposerPreparationData, PublicKeyBytes, Signature, SignedBeaconBlock, Slot, Transaction,
|
||||
|
@ -408,15 +408,12 @@ impl ProtocolId {
|
||||
/// Returns `true` if the given `ProtocolId` should expect `context_bytes` in the
|
||||
/// beginning of the stream, else returns `false`.
|
||||
pub fn has_context_bytes(&self) -> bool {
|
||||
match self.version {
|
||||
Version::V2 => matches!(
|
||||
self.message_name,
|
||||
Protocol::BlocksByRange | Protocol::BlocksByRoot
|
||||
),
|
||||
Version::V1 => matches!(
|
||||
self.message_name,
|
||||
Protocol::BlobsByRange | Protocol::BlobsByRoot
|
||||
),
|
||||
match self.message_name {
|
||||
Protocol::BlocksByRange | Protocol::BlocksByRoot => {
|
||||
!matches!(self.version, Version::V1)
|
||||
}
|
||||
Protocol::BlobsByRange | Protocol::BlobsByRoot | Protocol::LightClientBootstrap => true,
|
||||
Protocol::Goodbye | Protocol::Ping | Protocol::Status | Protocol::MetaData => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user