Skip to content

Commit

Permalink
fix workflow and make config fields private
Browse files Browse the repository at this point in the history
  • Loading branch information
apoorvsadana committed May 24, 2024
1 parent 7a311cc commit c2cd2df
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
coverage:
# sadly, for now we have to "rebuild" for the coverage
runs-on: self-hosted
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 14 additions & 4 deletions crates/orchestrator/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ use tokio::sync::OnceCell;
/// by calling `config` function.
pub struct Config {
/// The starknet client to get data from the node
pub starknet_client: Arc<JsonRpcClient<HttpTransport>>,
starknet_client: Arc<JsonRpcClient<HttpTransport>>,
/// The DA client to interact with the DA layer
pub da_client: Box<dyn DaClient>,
da_client: Box<dyn DaClient>,
/// The database client
pub database: Box<dyn Database>,
database: Box<dyn Database>,
/// The queue provider
pub queue: Box<dyn QueueProvider>,
queue: Box<dyn QueueProvider>,
}

/// Initializes the app config
Expand All @@ -46,6 +46,16 @@ pub async fn init_config() -> Config {
}

impl Config {
/// Create a new config
pub fn new(
starknet_client: Arc<JsonRpcClient<HttpTransport>>,
da_client: Box<dyn DaClient>,
database: Box<dyn Database>,
queue: Box<dyn QueueProvider>,
) -> Self {
Self { starknet_client, da_client, database, queue }
}

/// Returns the starknet client
pub fn starknet_client(&self) -> &Arc<JsonRpcClient<HttpTransport>> {
&self.starknet_client
Expand Down
7 changes: 1 addition & 6 deletions crates/orchestrator/src/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ pub async fn init_config(
// init starknet client
let provider = JsonRpcClient::new(HttpTransport::new(Url::parse(rpc_url.as_str()).expect("Failed to parse URL")));

Config {
starknet_client: Arc::new(provider),
da_client: Box::new(da_client),
database: Box::new(database),
queue: Box::new(queue),
}
Config::new(Arc::new(provider), Box::new(da_client), Box::new(database), Box::new(queue))
}

#[fixture]
Expand Down

0 comments on commit c2cd2df

Please sign in to comment.