Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#### Upcoming Changes

* fix: error mapping for fee_provision in excess_balance hint [#2236](https://github.com/lambdaclass/cairo-vm/pull/2236)

* fix: Remove unused dependency getrandom for cairo1-run, and serde_json for wasm-demo-cairo1 [#2238](https://github.com/lambdaclass/cairo-vm/pull/2238)

* chore: Unify deps makefile target [#2211](https://github.com/lambdaclass/cairo-vm/pull/2211)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,12 @@ pub fn excess_balance_hint(
.checked_add(unrealized_funding_pnl)
.and_then(|sum| sum.checked_add(token_assets_value_d))
.ok_or_else(|| HintError::ExcessBalanceCalculationFailed("account_value".into()))?;
let fee_provision = fees
let fee = fees
.get(&account)
.and_then(|fee| abs_balance_value.checked_mul(*fee))
.ok_or_else(|| HintError::ExcessBalanceKeyError("fees".into()))?;
let fee_provision = abs_balance_value
.checked_mul(*fee)
.ok_or_else(|| HintError::ExcessBalanceCalculationFailed("fee_provision".into()))?;
let margin_requirement = position_margin
.checked_add(fee_provision)
.ok_or_else(|| HintError::ExcessBalanceCalculationFailed("margin_requirements".into()))?;
Expand Down
Loading