Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLW-1106 Calculate completion time for targetEra #334

Merged
merged 3 commits into from
Jul 27, 2021
Merged

Conversation

ef1rspb
Copy link
Contributor

@ef1rspb ef1rspb commented Jul 27, 2021

@ef1rspb ef1rspb requested a review from ERussel July 27, 2021 11:36
@codecov-commenter
Copy link

Codecov Report

Merging #334 (9ba2f02) into develop (7920849) will increase coverage by 3.24%.
The diff coverage is 39.83%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #334      +/-   ##
===========================================
+ Coverage    31.43%   34.68%   +3.24%     
===========================================
  Files          462      524      +62     
  Lines        19656    23967    +4311     
===========================================
+ Hits          6179     8312    +2133     
- Misses       13477    15655    +2178     
Impacted Files Coverage Δ
...ataProvider/Sources/JsonSingleProviderSource.swift 0.00% <0.00%> (ø)
...DataProvider/Sources/WebSocketProviderSource.swift 0.00% <0.00%> (ø)
.../Subscription/SingleValueSubscriptionHandler.swift 8.33% <0.00%> (-2.78%) ⬇️
...ion/FearlessUtils/StorageKeyFactory+Implicit.swift 0.00% <ø> (ø)
...s/Common/Extension/Model/WalletAssetId+Chain.swift 0.00% <0.00%> (ø)
...peration/CompoundOperationWrapper+Dependency.swift 0.00% <0.00%> (ø)
...e/CDTransactionHistoryItem+CoreDataDecodable.swift 0.00% <0.00%> (ø)
.../Common/Extension/UIKit/GradientButton+Style.swift 0.00% <0.00%> (ø)
...mon/Extension/UIKit/TriangularedButton+Style.swift 0.00% <0.00%> (ø)
...ss/Common/Extension/UIKit/UIStackView+Manage.swift 0.00% <0.00%> (ø)
... and 244 more

@@ -110,13 +110,14 @@ final class StakingPayoutViewModelFactory: StakingPayoutViewModelFactoryProtocol
activeEra: EraIndex,
payoutEra: EraIndex,
historyDepth: UInt32,
eraCompletionTime: TimeInterval?,
eraCountdown: EraCountdown?,
locale: Locale
) -> NSAttributedString {
let eraDistance = historyDepth - (activeEra - payoutEra)
let daysLeft = Int(eraDistance) / chain.erasPerDay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably now we don't need erasPerDay because we can pass target era to eraCompletionTime

@@ -179,13 +179,14 @@ struct StakingBalanceViewModelFactory: StakingBalanceViewModelFactoryProtocol {
private func timeLeftAttributedString(
activeEra: EraIndex,
unbondingEra: EraIndex,
eraCompletionTime: TimeInterval?,
eraCountdown: EraCountdown?,
locale: Locale
) -> NSAttributedString {
let eraDistance = unbondingEra - activeEra
let daysLeft = Int(eraDistance) / chain.erasPerDay
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably now we don't need erasPerDay because we can pass target era to eraCompletionTime.

@ef1rspb ef1rspb merged commit 53fe8d0 into develop Jul 27, 2021
@ef1rspb ef1rspb deleted the feature/FLW-1106 branch July 27, 2021 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants