corrected the input error

This commit is contained in:
aaravm
2024-06-21 18:09:04 +05:30
parent 5ae28c9866
commit 3b43f8476d
2 changed files with 4 additions and 7 deletions

View File

@ -21,7 +21,7 @@ pub struct BondRequirementResponse {
// maker step 2
// (submission of signed bond and other data neccessary to coordinate the trade)
#[derive(Serialize, Debug)]
#[derive(Deserialize, Serialize, Debug)]
pub struct BondSubmissionRequest {
pub robohash_hex: String,
pub signed_bond_hex: String, // signed bond transaction, hex encoded
@ -31,7 +31,7 @@ pub struct BondSubmissionRequest {
}
// Response after step2 if offer creation was successful and the offer is now online in the orderbook
#[derive(Debug, Deserialize)]
#[derive(Serialize)]
pub struct OrderActivatedResponse {
pub order_id_hex: String,
pub bond_locked_until_timestamp: u128, // unix timestamp. Do not touch bond till then unless offer gets taken.

View File

@ -36,7 +36,7 @@ async fn receive_order(Json(order): Json<OrderRequest>)-> Json<BondRequirementRe
async fn submit_maker_bond(
Json(payload): Json<BondSubmissionRequest>,
) -> Response {
) -> Json<OrderActivatedResponse> {
// Process the payload
// For now, we'll just return a dummy success response
let response = OrderActivatedResponse {
@ -45,10 +45,7 @@ async fn submit_maker_bond(
};
// Create the JSON response
let json = Json(response);
// Create the full response with status code
(StatusCode::OK, json).into_response()
Json(response)
}
#[tokio::main]