mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 00:42:42 +00:00
Fix more broken tests
This commit is contained in:
@@ -1,12 +1,25 @@
|
|||||||
#![cfg(test)]
|
#![cfg(test)]
|
||||||
|
|
||||||
use node_test_rig::{environment::EnvironmentBuilder, testing_client_config, LocalBeaconNode};
|
use node_test_rig::{
|
||||||
use types::{MinimalEthSpec, Slot};
|
environment::{Environment, EnvironmentBuilder},
|
||||||
|
testing_client_config, LocalBeaconNode,
|
||||||
|
};
|
||||||
|
use types::{EthSpec, MinimalEthSpec, Slot};
|
||||||
|
|
||||||
fn env_builder() -> EnvironmentBuilder<MinimalEthSpec> {
|
fn env_builder() -> EnvironmentBuilder<MinimalEthSpec> {
|
||||||
EnvironmentBuilder::minimal()
|
EnvironmentBuilder::minimal()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn build_node<E: EthSpec>(env: &mut Environment<E>) -> LocalBeaconNode<E> {
|
||||||
|
let context = env.core_context();
|
||||||
|
env.runtime()
|
||||||
|
.block_on(LocalBeaconNode::production(
|
||||||
|
context,
|
||||||
|
testing_client_config(),
|
||||||
|
))
|
||||||
|
.expect("should block until node created")
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn http_server_genesis_state() {
|
fn http_server_genesis_state() {
|
||||||
let mut env = env_builder()
|
let mut env = env_builder()
|
||||||
@@ -17,7 +30,7 @@ fn http_server_genesis_state() {
|
|||||||
.build()
|
.build()
|
||||||
.expect("environment should build");
|
.expect("environment should build");
|
||||||
|
|
||||||
let node = LocalBeaconNode::production(env.core_context(), testing_client_config());
|
let node = build_node(&mut env);
|
||||||
let remote_node = node.remote_node().expect("should produce remote node");
|
let remote_node = node.remote_node().expect("should produce remote node");
|
||||||
|
|
||||||
let (api_state, _root) = env
|
let (api_state, _root) = env
|
||||||
|
|||||||
Reference in New Issue
Block a user