Conversation
theotniel
suggested changes
Jun 5, 2018
Contributor
theotniel
left a comment
There was a problem hiding this comment.
Under current circumstances, we are always around 4h behind, because of how the API returns chainBestBlock and NetworkBestBlock
We should ask Yao about the expected return values and why is there such a great difference
| public static final int MINUTES_IN_AN_HOUR = 60; | ||
| public static final int SYNC_STATUS_DISPLAY_UNIT_LIMIT = 2; | ||
|
|
||
| public static String formatSyncStatus(SyncInfoDTO syncInfo) { |
| return UNDEFINED; | ||
| } | ||
|
|
||
| private static String getSyncStatusBySeconds(long seconds) { |
| private static final int SECONDS_IN_A_DAY = 86400; | ||
| private static final String UNDEFINED = "Undefined"; | ||
| private static final String UP_TO_DATE = "Up to date"; | ||
| public static final int HOURS_IN_A_DAY = 24; |
Contributor
There was a problem hiding this comment.
these 3 constants can be private
| int days = (int) seconds / SECONDS_IN_A_DAY; | ||
| String syncStatus = ""; | ||
| int unitsDisplayed = 0; | ||
| if(days > 0 && unitsDisplayed < SYNC_STATUS_DISPLAY_UNIT_LIMIT) { |
Contributor
There was a problem hiding this comment.
unitsDisplayed < SYNC_STATUS_DISPLAY_UNIT_LIMIT is always true when reaching this point
| } | ||
| if((int) seconds > 0 && unitsDisplayed < SYNC_STATUS_DISPLAY_UNIT_LIMIT) { | ||
| syncStatus += (seconds - minutes * SECONDS_IN_A_MINUTE) + " seconds"; | ||
| unitsDisplayed++; |
Contributor
There was a problem hiding this comment.
incrementation of value is not required
Contributor
|
This issue will be merged after the following API issue is resolved: |
19d8418 to
c976380
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.