Skip to content

Commit

Permalink
chore: hashmap macro
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Oct 22, 2023
1 parent af36ad9 commit f0b5dfa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/stages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ serde_json.workspace = true

async-trait = "0.1.73"
project-root = "0.2.2"
maplit = "1.0.2"
32 changes: 11 additions & 21 deletions crates/stages/src/stages/l1_exec.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use eyre::Result;
use maplit::hashmap;
use op_primitives::L1Client;
use std::collections::HashMap;
use std::sync::Arc;

use async_trait::async_trait;
Expand Down Expand Up @@ -73,26 +73,16 @@ impl Executor {
let config = ContainerConfig {
image: Some(image_name),
working_dir: Some(working_dir.to_string_lossy().to_string()),
volumes: Some(HashMap::from([
// TODO: double check source/destination of volumes
("l1_data:/db".to_string(), HashMap::new()),
(
format!("{}:/genesis.json", l1_genesis.to_string_lossy()),
HashMap::new(),
),
(
format!(
"{}:/config/test-jwt-secret.txt",
jwt_secret.to_string_lossy()
),
HashMap::new(),
),
])),
exposed_ports: Some(HashMap::from([
("8545:8545".to_string(), HashMap::new()),
("8546:8546".to_string(), HashMap::new()),
("7060:6060".to_string(), HashMap::new()),
])),
volumes: Some(hashmap! {
"l1_data:/db".to_string() => hashmap! {},
format!("{}:/genesis.json", l1_genesis.to_string_lossy()) => hashmap! {},
format!("{}:/config/test-jwt-secret.txt", jwt_secret.to_string_lossy()) => hashmap! {}
}),
exposed_ports: Some(hashmap! {
"8545:8545".to_string() => hashmap! {},
"8546:8546".to_string() => hashmap! {},
"7060:6060".to_string() => hashmap! {},
}),
..Default::default()
};

Expand Down

0 comments on commit f0b5dfa

Please sign in to comment.