diff options
Diffstat (limited to 'src/routes.rs')
-rw-r--r-- | src/routes.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/routes.rs b/src/routes.rs index e4bdee4..0fb61c4 100644 --- a/src/routes.rs +++ b/src/routes.rs | |||
@@ -10,7 +10,7 @@ pub fn consensus_routes(db: Db) -> impl Filter<Extract = impl Reply, Error = Rej | |||
10 | transaction_list(db.clone()) | 10 | transaction_list(db.clone()) |
11 | .or(register_user(db.clone())) | 11 | .or(register_user(db.clone())) |
12 | .or(auth_transaction_propose(db.clone())) | 12 | .or(auth_transaction_propose(db.clone())) |
13 | .or(block_propose(db.clone())) | 13 | .or(auth_block_propose(db.clone())) |
14 | .or(block_list(db.clone())) | 14 | .or(block_list(db.clone())) |
15 | } | 15 | } |
16 | 16 | ||
@@ -52,11 +52,12 @@ pub fn auth_transaction_propose( | |||
52 | } | 52 | } |
53 | 53 | ||
54 | /// POST /block warp route | 54 | /// POST /block warp route |
55 | pub fn block_propose(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | 55 | pub fn auth_block_propose(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
56 | warp::path!("block") | 56 | warp::path!("block") |
57 | .and(warp::post()) | 57 | .and(warp::post()) |
58 | .and(custom_filters::block_json_body()) | 58 | .and(custom_filters::block_json_body()) |
59 | .and(custom_filters::auth_header()) | ||
59 | .and(custom_filters::with_db(db)) | 60 | .and(custom_filters::with_db(db)) |
60 | .and_then(handlers::propose_block) | 61 | .and_then(handlers::auth_propose_block) |
61 | } | 62 | } |
62 | 63 | ||