Skip to content

Commit cf720d0

Browse files
committed
ignore .env_dev file. add validation to not link solana twice.
1 parent 3b301c8 commit cf720d0

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ target/
44
cli/.env_prod
55

66
solana/staking/script/.env_dev
7+
8+
cli/.env_dev

vesting-backend/src/main.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,20 @@ pub async fn submit_signature(
130130
return HttpResponse::Ok().body(serde_json::to_string(&ret).unwrap());
131131
}
132132

133+
let dropped_entity = dropped_data.iter().find(|x| x.solana_address == post_params.message);
134+
if dropped_entity.is_some() && (dropped_entity.unwrap().success || dropped_entity.unwrap().signature.is_some() ){
135+
let error = format!("This solana wallet already linked to this address: {}. Please use another solana wallet", dropped_entity.unwrap().address);
136+
println!("{}", error.clone());
137+
let ret = VestingResp {
138+
is_success: false,
139+
error_message: Some(error),
140+
page_index: Some(1),
141+
amount_locked: amount_locked,
142+
amount_unlocked: amount_unlocked,
143+
};
144+
return HttpResponse::Ok().body(serde_json::to_string(&ret).unwrap());
145+
}
146+
133147
if post_params.network == 0 {
134148
let address_str: H160 = post_params.pubkey.parse().unwrap();
135149
let signed_message = get_signed_message(post_params.message.clone());

0 commit comments

Comments
 (0)