You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
got a bunch of else clauses that translate essentially to:
if we already have a value c inside minGasPrices sharing the same denomination as the current fee, and if that value is greater than the current fee use c else just use fee
However, that expression is in a long winded check and makes code much harder to read unnecessarily
Suggestion
Just simply do
for_, fee:=rangeglobalFees {
// Check if there is already a global fee value denominated// in min_gas_price and greater than the current fee.ok, c:=minGasPrices.Find(fee.Denom)
ifok&&c.Amount.GT(fee.Amount) {
allFees=append(allFees, c)
} else {
allFees=append(allFees, fee)
}
}
Type
Impact
Less complex code, much easier to read, understand and maintain code
Summary
Noticed during an audit that this code
gaia/x/globalfee/ante/fee_utils.go
Lines 135 to 147 in 44ca2bb
However, that expression is in a long winded check and makes code much harder to read unnecessarily

Suggestion
Just simply do
Type
Impact
Less complex code, much easier to read, understand and maintain code
/cc @elias-orijtech
For Admin Use
The text was updated successfully, but these errors were encountered: