Skip to content

Commit

Permalink
Merge pull request #261 from gobitfly/nobids/sync_committee_end_fix
Browse files Browse the repository at this point in the history
Fix end date of sync committee message
  • Loading branch information
manuelsc authored Nov 6, 2023
2 parents 4d9209b + b11d70f commit 50e3fe1
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 50e3fe1

Please sign in to comment.