Use rocket 0.5-rc1, remove rocket-contrib (#672)
* Use rocket 0.5-rc1, remove rocket-contrib * Revert thread_rng * Continue on error for beta as well * Add Drazen to authors * Remain paranoid for unstable crates * fmt again :/ * Most paranoid versions
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
use crate::node::node_description::NodeDescription;
|
||||
use rocket::serde::json::Json;
|
||||
use rocket::State;
|
||||
use rocket_contrib::json::Json;
|
||||
|
||||
/// Returns a description of the node and why someone might want to delegate stake to it.
|
||||
#[get("/description")]
|
||||
pub(crate) fn description(description: State<NodeDescription>) -> Json<NodeDescription> {
|
||||
pub(crate) fn description(description: &State<NodeDescription>) -> Json<NodeDescription> {
|
||||
Json(description.inner().clone())
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::node::node_statistics::{NodeStats, NodeStatsSimple, NodeStatsWrapper};
|
||||
use rocket::serde::json::Json;
|
||||
use rocket::State;
|
||||
use rocket_contrib::json::Json;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize)]
|
||||
@@ -13,7 +13,7 @@ pub(crate) enum NodeStatsResponse {
|
||||
/// Returns a running stats of the node.
|
||||
#[get("/stats?<debug>")]
|
||||
pub(crate) async fn stats(
|
||||
stats: State<'_, NodeStatsWrapper>,
|
||||
stats: &State<NodeStatsWrapper>,
|
||||
debug: Option<bool>,
|
||||
) -> Json<NodeStatsResponse> {
|
||||
let snapshot_data = stats.clone_data().await;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use mixnode_common::verloc::{AtomicVerlocResult, VerlocResult};
|
||||
use rocket::serde::json::Json;
|
||||
use rocket::State;
|
||||
use rocket_contrib::json::Json;
|
||||
|
||||
pub(crate) struct VerlocState {
|
||||
shared: AtomicVerlocResult,
|
||||
@@ -17,7 +17,7 @@ impl VerlocState {
|
||||
/// Provides verifiable location (verloc) measurements for this mixnode - a list of the
|
||||
/// round-trip times, in milliseconds, for all other mixnodes that this node knows about.
|
||||
#[get("/verloc")]
|
||||
pub(crate) async fn verloc(state: State<'_, VerlocState>) -> Json<VerlocResult> {
|
||||
pub(crate) async fn verloc(state: &State<VerlocState>) -> Json<VerlocResult> {
|
||||
// since it's impossible to get a mutable reference to the state, we can't cache any results outside the lock : (
|
||||
Json(state.shared.clone_data().await)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user