From 001a9ac21c29af53d31e9710d12e37d565880207 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Sat, 10 Apr 2021 16:56:00 +0300 Subject: giving up with style --- src/handlers.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/handlers.rs') diff --git a/src/handlers.rs b/src/handlers.rs index 0bcbd49..a9c0315 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -1,10 +1,11 @@ +use crate::auth::Pubkey; /// API handlers, the ends of each filter chain use log::debug; // this is more useful than debug! learn how to use this use parking_lot::RwLockUpgradableReadGuard; use std::convert::Infallible; -use warp::{http::StatusCode, reply}; +use warp::filters::BoxedFilter; use warp::reject::Rejection; -use crate::auth::Pubkey; +use warp::{http::StatusCode, reply}; use crate::schema::{Block, Db, Transaction}; @@ -63,11 +64,10 @@ pub async fn propose_transaction( /// POST /transaction, authenticated /// The transaction arrived in this method has been authored by the public key in the source pub async fn propose_authenticated_transaction( - pubkey: Pubkey, + pubkey: BoxedFilter<(Pubkey,)>, new_transaction: Transaction, db: Db, ) -> Result { - // auth logic debug!("new transaction request {:?}", new_transaction); @@ -79,7 +79,6 @@ pub async fn propose_authenticated_transaction( Ok(StatusCode::CREATED) } - /// POST /block /// Proposes a new block for the next round /// Can reject the block -- cgit v1.2.3-70-g09d2