-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
ef1rspb
commented
Jul 27, 2021
Codecov Report
@@ 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
|
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
.