diff --git a/vesting-backend/src/main.rs b/vesting-backend/src/main.rs index 7fb7410..4e1c534 100644 --- a/vesting-backend/src/main.rs +++ b/vesting-backend/src/main.rs @@ -34,7 +34,7 @@ pub struct VestingResp { pub is_success: bool, pub error_message: Option, pub page_index: Option, - pub amount_unlocked: u64, + pub amount_unlocked: u64, pub amount_locked: u64, } @@ -198,7 +198,7 @@ pub async fn submit_signature( dropped_item.signature = Some(result.1); update_data_in_file(path_to_drop_file, dropped_item); return HttpResponse::Ok().body(serde_json::to_string(&ret).unwrap()); - // } + // } } else if post_params.network == 1 { let cosmos_public_without_prefix = post_params.cosmos_public_without_prefix.clone().unwrap(); @@ -261,7 +261,7 @@ pub async fn submit_signature( } } else if post_params.network == 2 { - let result = verify::verify_polkadot_signature(post_params.message_bytes.unwrap().as_slice(), post_params.signatures_bytes.unwrap().as_slice(), &post_params.pubkey); + let result = verify::verify_polkadot_signature(post_params.message.as_bytes(), post_params.signatures_bytes.unwrap().as_slice(), &post_params.pubkey); if result { let mut dropped_item = DroppedItem{ address: post_params.pubkey.clone(), @@ -383,7 +383,7 @@ pub async fn get_submit_signature( // return HttpResponse::Ok().body(serde_json::to_string(&ret).unwrap()); // } - + // //read data from json file // let json_data_from_file = std::fs::read_to_string(path_to_drop_file).expect("Unable to read file"); @@ -411,7 +411,7 @@ pub async fn get_submit_signature( // let amount_unlocked = ui_amount_to_token_amount(claimant_entity.unwrap().amount_unlocked); // let amount_locked = ui_amount_to_token_amount(claimant_entity.unwrap().amount_locked); - + // std::fs::write(path_to_drop_file, json_data).expect("Unable to write file"); // let result = call_process_admin_claim(claimant, amount_unlocked, amount_locked, 1); // if !result{ @@ -443,7 +443,7 @@ pub async fn get_submit_signature( // }; // return HttpResponse::Ok().body(serde_json::to_string(&ret).unwrap()); // } - // } + // } // // else if post_params.network == 2 { // // let result = verify::verify_polkadot_signature(&post_params.message.as_bytes(), &post_params.signatures.as_bytes(), &post_params.pubkey); // // let result2 = verify::verify_polkadot_signature_ed25519(&post_params.message.as_bytes(), &post_params.signatures.as_bytes(), &post_params.pubkey); @@ -558,26 +558,26 @@ pub async fn get_submit_signature( get, path = "/vesting/domain/status", params( - + ), responses( - + ) )] pub async fn status( ) -> impl Responder { return HttpResponse::Ok().body("Vesting Service are active and ready to accept requests"); - + } #[utoipa::path( get, path = "/vesting/domain/settestvesting", params( - + ), responses( - + ) )] pub async fn set_test_vesting(