Skip to content

Commit

Permalink
replace += with checked_add for neutron voting registry
Browse files Browse the repository at this point in the history
  • Loading branch information
sotnikov-s committed Mar 14, 2023
1 parent caa9706 commit 68abb6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/dao/voting/neutron-voting-registry/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ pub fn query_voting_power_at_height(
address: address.clone(),
},
)?;
total_power.power += total_power_single_vault.power;
total_power
.power
.checked_add(total_power_single_vault.power)?;
total_power.height = total_power_single_vault.height;
}

Expand All @@ -242,7 +244,9 @@ pub fn query_total_power_at_height(
let total_power_single_vault: TotalPowerAtHeightResponse = deps
.querier
.query_wasm_smart(vault, &voting::Query::TotalPowerAtHeight { height })?;
total_power.power += total_power_single_vault.power;
total_power
.power
.checked_add(total_power_single_vault.power)?;
total_power.height = total_power_single_vault.height;
}

Expand Down

0 comments on commit 68abb6f

Please sign in to comment.