Fix execution layer redundancy (#5588)

* remove execution layer url redundancy

* fix typo

* fix tests

* fix formatting
This commit is contained in:
AMIT SINGH
2024-04-18 12:44:56 +05:30
committed by GitHub
parent 49617f3e82
commit 62e4abfbff
9 changed files with 46 additions and 52 deletions

View File

@@ -121,11 +121,11 @@ impl<Engine: GenericExecutionEngine> TestRig<Engine> {
let ee_a = {
let execution_engine = ExecutionEngine::new(generic_engine.clone());
let urls = vec![execution_engine.http_auth_url()];
let url = Some(execution_engine.http_auth_url());
let config = execution_layer::Config {
execution_endpoints: urls,
secret_files: vec![],
execution_endpoint: url,
secret_file: None,
suggested_fee_recipient: Some(Address::repeat_byte(42)),
default_datadir: execution_engine.datadir(),
..Default::default()
@@ -140,11 +140,11 @@ impl<Engine: GenericExecutionEngine> TestRig<Engine> {
let ee_b = {
let execution_engine = ExecutionEngine::new(generic_engine);
let urls = vec![execution_engine.http_auth_url()];
let url = Some(execution_engine.http_auth_url());
let config = execution_layer::Config {
execution_endpoints: urls,
secret_files: vec![],
execution_endpoint: url,
secret_file: None,
suggested_fee_recipient: fee_recipient,
default_datadir: execution_engine.datadir(),
..Default::default()

View File

@@ -395,11 +395,9 @@ async fn create_local_network<E: EthSpec>(
if post_merge_sim {
let el_config = execution_layer::Config {
execution_endpoints: vec![SensitiveUrl::parse(&format!(
"http://localhost:{}",
EXECUTION_PORT
))
.unwrap()],
execution_endpoint: Some(
SensitiveUrl::parse(&format!("http://localhost:{}", EXECUTION_PORT)).unwrap(),
),
..Default::default()
};

View File

@@ -85,9 +85,9 @@ impl<E: EthSpec> LocalNetwork<E> {
mock_execution_config,
);
el_config.default_datadir = execution_node.datadir.path().to_path_buf();
el_config.secret_files = vec![execution_node.datadir.path().join("jwt.hex")];
el_config.execution_endpoints =
vec![SensitiveUrl::parse(&execution_node.server.url()).unwrap()];
el_config.secret_file = Some(execution_node.datadir.path().join("jwt.hex"));
el_config.execution_endpoint =
Some(SensitiveUrl::parse(&execution_node.server.url()).unwrap());
vec![execution_node]
} else {
vec![]
@@ -180,9 +180,9 @@ impl<E: EthSpec> LocalNetwork<E> {
config,
);
el_config.default_datadir = execution_node.datadir.path().to_path_buf();
el_config.secret_files = vec![execution_node.datadir.path().join("jwt.hex")];
el_config.execution_endpoints =
vec![SensitiveUrl::parse(&execution_node.server.url()).unwrap()];
el_config.secret_file = Some(execution_node.datadir.path().join("jwt.hex"));
el_config.execution_endpoint =
Some(SensitiveUrl::parse(&execution_node.server.url()).unwrap());
self.execution_nodes.write().push(execution_node);
}