mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Only load Kzg in tests if necessary and only load it once (#5555)
* Only load KZG once if necessary in tests.
This commit is contained in:
@@ -155,7 +155,7 @@ impl<E: EthSpec> ExecutionBlockGenerator<E> {
|
||||
shanghai_time: Option<u64>,
|
||||
cancun_time: Option<u64>,
|
||||
prague_time: Option<u64>,
|
||||
kzg: Option<Kzg>,
|
||||
kzg: Option<Arc<Kzg>>,
|
||||
) -> Self {
|
||||
let mut gen = Self {
|
||||
head_block: <_>::default(),
|
||||
@@ -172,7 +172,7 @@ impl<E: EthSpec> ExecutionBlockGenerator<E> {
|
||||
cancun_time,
|
||||
prague_time,
|
||||
blobs_bundles: <_>::default(),
|
||||
kzg: kzg.map(Arc::new),
|
||||
kzg,
|
||||
rng: make_rng(),
|
||||
};
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ impl<E: EthSpec> MockExecutionLayer<E> {
|
||||
prague_time: Option<u64>,
|
||||
jwt_key: Option<JwtKey>,
|
||||
spec: ChainSpec,
|
||||
kzg: Option<Kzg>,
|
||||
kzg: Option<Arc<Kzg>>,
|
||||
) -> Self {
|
||||
let handle = executor.handle().unwrap();
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ impl<E: EthSpec> MockServer<E> {
|
||||
pub fn new_with_config(
|
||||
handle: &runtime::Handle,
|
||||
config: MockExecutionConfig,
|
||||
kzg: Option<Kzg>,
|
||||
kzg: Option<Arc<Kzg>>,
|
||||
) -> Self {
|
||||
let MockExecutionConfig {
|
||||
jwt_key,
|
||||
@@ -193,7 +193,7 @@ impl<E: EthSpec> MockServer<E> {
|
||||
shanghai_time: Option<u64>,
|
||||
cancun_time: Option<u64>,
|
||||
prague_time: Option<u64>,
|
||||
kzg: Option<Kzg>,
|
||||
kzg: Option<Arc<Kzg>>,
|
||||
) -> Self {
|
||||
Self::new_with_config(
|
||||
handle,
|
||||
|
||||
Reference in New Issue
Block a user