Skip to content

Commit

Permalink
iOS-8075 [Staking] Vote after lock (#3977)
Browse files Browse the repository at this point in the history
  • Loading branch information
fedorov-d authored Oct 2, 2024
1 parent e7ca9b5 commit 2ad8a27
Show file tree
Hide file tree
Showing 13 changed files with 715 additions and 7 deletions.
15 changes: 13 additions & 2 deletions Tangem/App/Services/Staking/PendingActionMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,19 @@ struct PendingActionMapper {
throw PendingActionMapperError.notFound("Pending unlockLocked action")
}

let type: StakingAction.PendingActionType = .unlockLocked(passthrough: unlockLockedAction.passthrough)
return .single(stakingAction(type: .pending(type)))
let unlockLocked: StakingAction = stakingAction(
type: .pending(.unlockLocked(passthrough: unlockLockedAction.passthrough))
)

if let voteLockedAction = balance.actions.first(where: { $0.type == .voteLocked }) {
let voteLocked = stakingAction(
type: .pending(.voteLocked(passthrough: voteLockedAction.passthrough))
)

return .multiple([unlockLocked, voteLocked])
}

return .single(unlockLocked)
case .rewards:
guard let claimRewardsAction = balance.actions.first(where: { $0.type == .claimRewards }) else {
throw PendingActionMapperError.notFound("Pending claimRewards action")
Expand Down
Loading

0 comments on commit 2ad8a27

Please sign in to comment.