Skip to content

Commit

Permalink
Update usage of soroban fixed point math
Browse files Browse the repository at this point in the history
  • Loading branch information
cptartur committed Jul 31, 2024
1 parent 96def17 commit 89452b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/governance/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn weigh_neuron_result(env: &Env, weight: &I256, result: Map<String, I256>) -> M
for (key, value) in result {
scaled.set(
key,
value.fixed_mul_floor(env, weight.clone(), I256::from_i128(env, DECIMALS)),
value.fixed_mul_floor(env, weight, &I256::from_i128(env, DECIMALS)),
);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/governance/src/neural_governance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub(crate) fn aggregate_result(
LayerAggregator::Sum => res.iter().reduce(|acc, e| acc.add(&e)),
LayerAggregator::Product => res
.iter()
.reduce(|acc, e| acc.fixed_mul_floor(env, e, decimals.clone())),
.reduce(|acc, e| acc.fixed_mul_floor(env, &e, &decimals)),
}
.unwrap_or_else(|| I256::from_i128(env, 0));
aggregated_result.set(user, res);
Expand Down

0 comments on commit 89452b0

Please sign in to comment.