Skip to content

Commit

Permalink
refactor(state-server): update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
GMKrieger committed Aug 1, 2023
1 parent 049f0d5 commit e46c994
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 3 additions & 5 deletions offchain/state-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ path = "src/main.rs"

[dependencies]
types = { path = "../types" }
state-fold = { path = "../state-fold" }
state-fold-types = { path = "../state-fold-types"}

block-history.workspace = true
serde.workspace = true
snafu.workspace = true
state-fold.workspace = true
state-fold-types.workspace = true
state-server-lib.workspace = true
tokio = { workspace = true, features = ["macros", "sync", "rt-multi-thread"] }
tonic = "0.8" # TODO: the state-fold still uses this version
tonic.workspace = true
tracing-subscriber = { workspace = true, features = ["env-filter"] }
tracing.workspace = true
url.workspace = true
2 changes: 1 addition & 1 deletion offchain/state-server/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// (c) Cartesi and individual authors (see AUTHORS)
// SPDX-License-Identifier: Apache-2.0 (see LICENSE)

use block_history::BlockArchiveError;
use snafu::Snafu;
use state_fold::block_history::BlockArchiveError;
use state_fold_types::ethers::providers::{Http, RetryClient};
use tonic::transport::Error as TonicError;
use url::ParseError;
Expand Down
20 changes: 11 additions & 9 deletions offchain/state-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// SPDX-License-Identifier: Apache-2.0 (see LICENSE)

use snafu::ResultExt;
use state_fold::{Foldable, StateFoldEnvironment};
use state_fold_types::ethers::providers::{
Http, HttpRateLimitRetryPolicy, Provider, RetryClient,
};
use state_server_lib::{
use state_fold::state_fold::{Foldable, StateFoldEnvironment};
use state_fold::state_server_lib::{
config,
grpc_server::StateServer,
utils::{start_server, wait_for_signal},
};
use state_fold_types::ethers::providers::{
Http, HttpRateLimitRetryPolicy, Provider, RetryClient,
};
use std::sync::{Arc, Mutex};
use tokio::sync::oneshot;
use types::UserData;
Expand Down Expand Up @@ -80,7 +80,7 @@ fn create_provider(
fn create_env(
config: &config::StateServerConfig,
provider: Arc<ServerProvider>,
block_archive: Arc<block_history::BlockArchive<ServerProvider>>,
block_archive: Arc<state_fold::block_history::BlockArchive<ServerProvider>>,
) -> Result<
Arc<StateFoldEnvironment<ServerProvider, Mutex<UserData>>>,
StateServerError,
Expand All @@ -102,9 +102,11 @@ fn create_env(
async fn create_block_subscriber(
config: &config::StateServerConfig,
provider: Arc<ServerProvider>,
) -> Result<Arc<block_history::BlockSubscriber<ServerProvider>>, StateServerError>
{
let block_subscriber = block_history::BlockSubscriber::start(
) -> Result<
Arc<state_fold::block_history::BlockSubscriber<ServerProvider>>,
StateServerError,
> {
let block_subscriber = state_fold::block_history::BlockSubscriber::start(
Arc::clone(&provider),
config.block_history.ws_endpoint.to_owned(),
config.block_history.block_timeout,
Expand Down
2 changes: 1 addition & 1 deletion offchain/state-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt().with_env_filter(filter).init();

let config =
state_server_lib::config::StateServerConfig::initialize_from_args()?;
state_fold::state_server_lib::config::StateServerConfig::initialize_from_args()?;

tracing::info!(?config, "starting state server");

Expand Down

0 comments on commit e46c994

Please sign in to comment.