Skip to content

Commit

Permalink
IOS-8181 Update StakeKitMapper.swift
Browse files Browse the repository at this point in the history
IOS-8181 Update StakeKitMapper.swift
  • Loading branch information
Balashov152 committed Oct 4, 2024
1 parent 5d1e173 commit 0ae8f11
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion TangemStaking/Services/StakeKitMapper/StakeKitMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,13 @@ struct StakeKitMapper {

let validators = response.validators
.map(mapToValidatorInfo)
.sorted(by: { $0.apr ?? 0 > $1.apr ?? 0 })
.sorted(by: { lhs, rhs in
if lhs.apr == rhs.apr {
return lhs.partner
}

return lhs.apr ?? 0 > rhs.apr ?? 0
})

let rewardRateValues = RewardRateValues(
aprs: validators.filter { $0.preferred }.compactMap(\.apr),
Expand Down

0 comments on commit 0ae8f11

Please sign in to comment.