Skip to content

Commit 149290e

Browse files
committed
set locked_amount to unvested_amount if none
1 parent aa89ce8 commit 149290e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

api/src/router.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ async fn get_eligibility(
361361
err
362362
})?;
363363

364+
let unvested_amount = state.cache.get_unvested_amount(user_pubkey.clone());
364365
Ok(Json(EligibilityResp {
365366
claimant: user_pubkey.clone(),
366367
merkle_tree: proof.merkle_tree,
@@ -370,9 +371,13 @@ async fn get_eligibility(
370371
proof: proof.proof,
371372
start_amount,
372373
end_amount: proof.amount as u128,
373-
locked_amount: proof.locked_amount as u128,
374+
locked_amount: if proof.locked_amount as u128 > 0 {
375+
proof.locked_amount as u128
376+
} else {
377+
unvested_amount
378+
},
374379
claimable_amount: claimable_amount as u128,
375-
unvested_amount: state.cache.get_unvested_amount(user_pubkey),
380+
unvested_amount,
376381
claimed_amount: (unlocked_amount_claimed + locked_amount_withdrawn) as u128,
377382
unlocked_amount_claimed: unlocked_amount_claimed as u128,
378383
locked_amount_withdrawn: locked_amount_withdrawn as u128,

0 commit comments

Comments
 (0)