Skip to content

Commit 99f733d

Browse files
In case of non subscription on get quotas, return a 404 error
1 parent 582eda7 commit 99f733d

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

aggregation_mode/gateway/src/http.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,9 @@ impl GatewayServer {
392392
"quota_resets_in": formatted_time_left.as_str()
393393
})))
394394
} else {
395-
HttpResponse::Ok().json(AppResponse::new_sucessfull_with_message(
396-
serde_json::json!({
397-
"proofs_submitted": 0,
398-
"quota_limit": 0,
399-
"quota_remaining": 0,
400-
"quota_resets_in": formatted_time_left.as_str()
401-
}),
402-
"You have to pay before submitting a proof".to_string(),
395+
HttpResponse::Ok().json(AppResponse::new_unsucessfull(
396+
"The address doesn't have an active subscription",
397+
404,
403398
))
404399
}
405400
}

aggregation_mode/gateway/src/types.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ impl AppResponse {
2020
}
2121
}
2222

23-
pub(super) fn new_sucessfull_with_message(data: Value, message: String) -> Self {
24-
Self {
25-
status: 200,
26-
message,
27-
data,
28-
}
29-
}
30-
3123
pub(super) fn new_unsucessfull(message: &str, status: u16) -> Self {
3224
Self {
3325
status,

0 commit comments

Comments
 (0)