Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
saibatizoku committed Nov 1, 2023
1 parent 7c6a9aa commit 3e702e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion catalyst-gateway/bin/src/service/api/v0/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! `v0` Endpoints
use crate::service::common::tags::ApiTags;
use poem_openapi::{payload::Binary, OpenApi};

use crate::service::common::tags::ApiTags;

mod message_post;

/// `v0` API Endpoints
Expand Down
17 changes: 9 additions & 8 deletions catalyst-gateway/bin/src/service/api/v1/account_votes_get.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
//! Implementation of the `GET /v1/votes/plan/account-votes/:account_id` endpoint
use std::sync::Arc;

use poem::web::{Data, Path};
use poem_extensions::{response, UniResponse::T200};
use poem_openapi::payload::Json;

use crate::{
service::common::{
objects::account_votes::{AccountId, AccountVote},
Expand All @@ -10,11 +16,6 @@ use crate::{
},
state::State,
};
use poem::web::{Data, Path};
use poem_extensions::response;
use poem_extensions::UniResponse::T200;
use poem_openapi::payload::Json;
use std::sync::Arc;

/// All responses
pub(crate) type AllResponses = response! {
Expand All @@ -34,11 +35,11 @@ pub(crate) type AllResponses = response! {
/// ## Responses
///
/// * 200 with a JSON array of the number of voted proposals in a plan.
/// * 500 Server Error - If anything within this function fails unexpectedly. (Possible but unlikely)
/// * 500 Server Error - If anything within this function fails unexpectedly. (Possible
/// but unlikely)
/// * 503 Service Unavailable - Service has not started, do not send other requests.
pub(crate) async fn endpoint(
_state: Data<&Arc<State>>,
_account_id: Path<AccountId>,
_state: Data<&Arc<State>>, _account_id: Path<AccountId>,
) -> AllResponses {
// otherwise everything seems to be A-OK
T200(OK(Json(Vec::new())))
Expand Down
12 changes: 6 additions & 6 deletions catalyst-gateway/bin/src/service/api/v1/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
//! `v1` Endpoints
use std::sync::Arc;

use poem::web::{Data, Path};
use poem_openapi::OpenApi;

use crate::{
service::common::{objects::account_votes::AccountId, tags::ApiTags},
state::State,
};
use poem::web::{Data, Path};
use poem_openapi::OpenApi;
use std::sync::Arc;

mod account_votes_get;

Expand All @@ -22,9 +24,7 @@ impl V1Api {
)]
/// Votes for
async fn get_account_votes(
&self,
state: Data<&Arc<State>>,
account_id: Path<AccountId>,
&self, state: Data<&Arc<State>>, account_id: Path<AccountId>,
) -> account_votes_get::AllResponses {
account_votes_get::endpoint(state, account_id).await
}
Expand Down

0 comments on commit 3e702e5

Please sign in to comment.