mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
Improve single-node testnet support and Arc NetworkConfig/ChainSpec (#6396)
* Arc ChainSpec and NetworkConfig * Fix release tests * Fix lint * Merge remote-tracking branch 'origin/unstable' into single-node-testnet
This commit is contained in:
@@ -206,7 +206,7 @@ pub fn test_spec<E: EthSpec>() -> ChainSpec {
|
||||
|
||||
pub struct Builder<T: BeaconChainTypes> {
|
||||
eth_spec_instance: T::EthSpec,
|
||||
spec: Option<ChainSpec>,
|
||||
spec: Option<Arc<ChainSpec>>,
|
||||
validator_keypairs: Option<Vec<Keypair>>,
|
||||
withdrawal_keypairs: Vec<Option<Keypair>>,
|
||||
chain_config: Option<ChainConfig>,
|
||||
@@ -395,12 +395,12 @@ where
|
||||
self.spec_or_default(None)
|
||||
}
|
||||
|
||||
pub fn spec(self, spec: ChainSpec) -> Self {
|
||||
pub fn spec(self, spec: Arc<ChainSpec>) -> Self {
|
||||
self.spec_or_default(Some(spec))
|
||||
}
|
||||
|
||||
pub fn spec_or_default(mut self, spec: Option<ChainSpec>) -> Self {
|
||||
self.spec = Some(spec.unwrap_or_else(test_spec::<E>));
|
||||
pub fn spec_or_default(mut self, spec: Option<Arc<ChainSpec>>) -> Self {
|
||||
self.spec = Some(spec.unwrap_or_else(|| Arc::new(test_spec::<E>())));
|
||||
self
|
||||
}
|
||||
|
||||
@@ -648,7 +648,7 @@ pub struct BeaconChainHarness<T: BeaconChainTypes> {
|
||||
pub withdrawal_keypairs: Vec<Option<Keypair>>,
|
||||
|
||||
pub chain: Arc<BeaconChain<T>>,
|
||||
pub spec: ChainSpec,
|
||||
pub spec: Arc<ChainSpec>,
|
||||
pub shutdown_receiver: Arc<Mutex<Receiver<ShutdownReason>>>,
|
||||
pub runtime: TestRuntime,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user