Skip to content

Commit

Permalink
fix: overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushtom committed Jan 26, 2024
1 parent e4c5860 commit 7e0995f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/endpoints/quest_boost/get_claim_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ pub async fn handler(
let boost: Document = res.unwrap();
let num_of_winners = boost.get("num_of_winners").unwrap().as_i32().unwrap();
let decimals = boost.get("token_decimals").unwrap().as_i32().unwrap();
let amount = boost.get("amount").unwrap().as_i32().unwrap() as u32 * 10u32.pow(decimals as u32);
let modified_amount = amount / num_of_winners as u32;
let amount: u128 = boost.get("amount").unwrap().as_i32().unwrap() as u128 * 10u128.pow(decimals as u32);
let modified_amount = amount / num_of_winners as u128;
let token = boost.get("token").unwrap().as_str().unwrap();

let winner_list = boost.get("winner").unwrap().as_array().unwrap();
let bson_value: Bson = Bson::String(address.clone());

Expand Down

0 comments on commit 7e0995f

Please sign in to comment.