Feature/validator api update (#402)

* Updated validator API routes

* missing comment
This commit is contained in:
Jędrzej Stuczyński
2020-10-29 16:10:59 +00:00
committed by GitHub
parent 12584749c8
commit 0f0a428142
6 changed files with 8 additions and 8 deletions
@@ -31,7 +31,7 @@ pub(crate) enum Response {
impl RESTRequest for Request {
const METHOD: Method = Method::GET;
const RELATIVE_PATH: &'static str = "/api/presence/topology/active";
const RELATIVE_PATH: &'static str = "/api/mixmining/topology/active";
type JsonPayload = ();
type ExpectedJsonResponse = Response;
@@ -24,7 +24,7 @@ pub struct Request {
impl RESTRequest for Request {
const METHOD: Method = Method::POST;
const RELATIVE_PATH: &'static str = "/api/presence/gateway";
const RELATIVE_PATH: &'static str = "/api/mixmining/register/gateway";
type JsonPayload = GatewayRegistrationInfo;
type ExpectedJsonResponse = DefaultRESTResponse;
@@ -24,7 +24,7 @@ pub struct Request {
impl RESTRequest for Request {
const METHOD: Method = Method::POST;
const RELATIVE_PATH: &'static str = "/api/presence/mix";
const RELATIVE_PATH: &'static str = "/api/mixmining/register/mix";
type JsonPayload = MixRegistrationInfo;
type ExpectedJsonResponse = DefaultRESTResponse;
@@ -22,7 +22,7 @@ pub struct Request {
impl RESTRequest for Request {
const METHOD: Method = Method::DELETE;
const RELATIVE_PATH: &'static str = "/api/presence";
const RELATIVE_PATH: &'static str = "/api/mixmining/register";
type JsonPayload = ();
type ExpectedJsonResponse = DefaultRESTResponse;
@@ -37,7 +37,7 @@ impl RESTRequest for Request {
if path_params.len() != 1 {
return Err(RESTRequestError::InvalidPathParams);
}
// <base_url>/api/presence/{id}
// <base_url>/api/mixmining/register/{id}
let base = format!("{}{}/{}", base_url, Self::RELATIVE_PATH, path_params[0]);
let url =
@@ -22,7 +22,7 @@ pub struct Request {
impl RESTRequest for Request {
const METHOD: Method = Method::PATCH;
const RELATIVE_PATH: &'static str = "/api/presence/reputation";
const RELATIVE_PATH: &'static str = "/api/mixmining/reputation";
type JsonPayload = ();
type ExpectedJsonResponse = DefaultRESTResponse;
@@ -44,7 +44,7 @@ impl RESTRequest for Request {
return Err(RESTRequestError::InvalidQueryParams);
}
// <base_url>/api/presence/reputation/{id}
// <base_url>/api/mixmining/reputation/{id}
let base = format!("{}{}/{}", base_url, Self::RELATIVE_PATH, path_params[0]);
let url = Url::parse_with_params(&base, query_params)
@@ -31,7 +31,7 @@ pub(crate) enum Response {
impl RESTRequest for Request {
const METHOD: Method = Method::GET;
const RELATIVE_PATH: &'static str = "/api/presence/topology";
const RELATIVE_PATH: &'static str = "/api/mixmining/topology";
type JsonPayload = ();
type ExpectedJsonResponse = Response;