Skip to content

Commit

Permalink
fix: remove unwrap from funds manager
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayerAnsh committed Dec 12, 2024
1 parent 90a4b9d commit 53d37ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/liquidity/factory/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn query_all_pools(deps: Deps) -> Result<Binary, ContractError> {
let pools = PAIR_TO_VLP
.range(deps.storage, None, None, cosmwasm_std::Order::Ascending)
.flat_map(|item| -> Result<_, ContractError> {
let item = item.unwrap();
let item = item?;
Ok(PoolVlpResponse {
pair: Pair::new(item.0 .0, item.0 .1)?,
vlp: item.1,
Expand Down
5 changes: 4 additions & 1 deletion packages/euclid/src/utils/fund_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ impl FundManager {
self.get(denom).ge(&amount),
ContractError::InsufficientFunds {}
);
*self.funds.get_mut(denom).unwrap() -= amount;
*self
.funds
.get_mut(denom)
.ok_or(ContractError::new("Denom not found"))? -= amount;
Ok(())
}

Expand Down

0 comments on commit 53d37ef

Please sign in to comment.