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/routes.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/routes.rs') diff --git a/src/routes.rs b/src/routes.rs index 871fd9c..b389919 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -8,7 +8,8 @@ use crate::schema::{Db, Transaction}; /// Root, all routes combined pub fn consensus_routes(db: Db) -> impl Filter + Clone { transaction_list(db.clone()) - .or(transaction_propose(db.clone())) + // .or(transaction_propose(db.clone())) + .or(authenticated_transaction_propose(db.clone())) .or(block_propose(db.clone())) .or(block_list(db.clone())) } @@ -51,16 +52,16 @@ pub fn authenticated_transaction_propose( // // header/jwt logic to propose_transaction but that doesn't feel right either // // good luck <10-04-21, yigit> // + let db1 = db.clone(); warp::path("transaction") .and(warp::path::end()) .and(warp::post()) .and(custom_filters::transaction_json_body()) // returns transaction - .map(|t: Transaction| { - // what do these do? - with_auth(db.clone(), t) + .map(move |t: Transaction| { + with_auth(db1.clone(), t).boxed() }) .and(custom_filters::transaction_json_body()) // returns transaction - .and(custom_filters::with_db(db)) // wraps db + .and(custom_filters::with_db(db.clone())) // wraps db .and_then(handlers::propose_authenticated_transaction) // uses db, transaction and authenticated } -- cgit v1.2.3-70-g09d2