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

Fix end date of sync committee message #261

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/app/components/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,15 @@ export class DashboardComponent implements OnInit {

updateActiveSyncCommitteeMessage(committee: SyncCommitteeResponse) {
if (committee) {
const endTs = this.epochToTimestamp(committee.end_epoch)
const endTs = this.epochToTimestamp(committee.end_epoch + 1)
const startTs = this.epochToTimestamp(committee.start_epoch)
this.currentSyncCommitteeMessage = {
title: 'Sync Committee',
text: `Your validator${committee.validators.length > 1 ? 's' : ''} ${committee.validators.toString()} ${
committee.validators.length > 1 ? 'are' : 'is'
} currently part of the active sync committee.
<br/><br/>This duty started at epoch ${committee.start_epoch} at ${new Date(startTs).toLocaleString()} and
will end at epoch ${committee.end_epoch} at ${new Date(endTs).toLocaleString()}.
will end after epoch ${committee.end_epoch} at ${new Date(endTs).toLocaleString()}.
<br/><br/>You'll earn extra rewards during this period.
`,
} as SyncCommitteeMessage
Expand All @@ -241,15 +241,15 @@ export class DashboardComponent implements OnInit {

updateNextSyncCommitteeMessage(committee: SyncCommitteeResponse) {
if (committee) {
const endTs = this.epochToTimestamp(committee.end_epoch)
const endTs = this.epochToTimestamp(committee.end_epoch + 1)
const startTs = this.epochToTimestamp(committee.start_epoch)
this.nextSyncCommitteeMessage = {
title: 'Sync Committee Soon',
text: `Your validator${committee.validators.length > 1 ? 's' : ''} ${committee.validators.toString()} ${
committee.validators.length > 1 ? 'are' : 'is'
} part of the <strong>next</strong> sync committee.
<br/><br/>This duty starts at epoch ${committee.start_epoch} at ${new Date(startTs).toLocaleString()} and
will end at epoch ${committee.end_epoch} at ${new Date(endTs).toLocaleString()}.
will end after epoch ${committee.end_epoch} at ${new Date(endTs).toLocaleString()}.
<br/><br/>You'll earn extra rewards during this period.
`,
} as SyncCommitteeMessage
Expand Down