Skip to content

Commit

Permalink
fix: remove snapshot endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kukkok3 committed Oct 10, 2023
1 parent d86dab9 commit 9ff72ee
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 184 deletions.
13 changes: 1 addition & 12 deletions vit-servicing-station-lib/src/v0/endpoints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod genesis;
mod health;
pub mod proposals;
pub mod service_version;
mod snapshot;

use crate::v0::context::SharedContext;

Expand All @@ -16,8 +15,6 @@ use warp::{Filter, Rejection, Reply};
pub async fn filter(
root: BoxedFilter<()>,
context: SharedContext,
snapshot_rx: snapshot_service::SharedContext,
snapshot_tx: snapshot_service::UpdateHandle,
enable_api_tokens: bool,
) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
// mount health endpoint
Expand All @@ -43,18 +40,11 @@ pub async fn filter(
let reviews_root = warp::path!("reviews" / ..);
let reviews_filter = advisor_reviews::filter(reviews_root.boxed(), context.clone()).await;

let snapshot_root = warp::path!("snapshot" / ..);
let snapshot_rx_filter = snapshot_service::filter(snapshot_root.boxed(), snapshot_rx.clone());

let admin_filter = {
let base = warp::path!("admin" / ..);

let snapshot_tx_filter =
warp::path!("snapshot" / ..).and(snapshot_service::update_filter(snapshot_tx).boxed());

let fund_filter = warp::path!("fund" / ..).and(funds::admin_filter(context.clone()));

base.and(snapshot_tx_filter.or(fund_filter))
base.and(fund_filter)
};

let api_token_filter = if enable_api_tokens {
Expand All @@ -71,7 +61,6 @@ pub async fn filter(
.or(funds_filter)
.or(challenges_filter)
.or(reviews_filter)
.or(snapshot_rx_filter)
.or(admin_filter),
),
)
Expand Down
133 changes: 0 additions & 133 deletions vit-servicing-station-lib/src/v0/endpoints/snapshot/mod.rs

This file was deleted.

25 changes: 0 additions & 25 deletions vit-servicing-station-lib/src/v0/endpoints/snapshot/routes.rs

This file was deleted.

4 changes: 0 additions & 4 deletions vit-servicing-station-lib/src/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ const V0_REQUEST_TRACE_NAME: &str = "v0_request";

pub async fn filter(
ctx: context::SharedContext,
snapshot_rx: snapshot_service::SharedContext,
snapshot_tx: snapshot_service::UpdateHandle,
enable_api_tokens: bool,
) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
let api_root = warp::path!("api" / ..);
Expand Down Expand Up @@ -49,8 +47,6 @@ pub async fn filter(
let v0 = endpoints::filter(
v0_root.boxed(),
ctx.clone(),
snapshot_rx,
snapshot_tx,
enable_api_tokens,
)
.await;
Expand Down
10 changes: 0 additions & 10 deletions vit-servicing-station-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,8 @@ async fn main() {
let context =
v0::context::new_shared_context(db_pool, &settings.block0_path, &settings.service_version);

let (snapshot_rx, snapshot_tx) = match snapshot_service::new_context() {
Ok(ctx) => ctx,
Err(e) => {
error!("Failed to setup snapshot watcher service {}", e);
std::process::exit(ApplicationExitCode::SnapshotWatcherError.into());
}
};

let app = v0::filter(
context,
snapshot_rx,
snapshot_tx,
settings.enable_api_tokens,
)
.await;
Expand Down

0 comments on commit 9ff72ee

Please sign in to comment.