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

Remove finalization checkpoint #40

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatusKysel
Copy link
Collaborator

No description provided.

@MatusKysel MatusKysel requested a review from kstdl July 24, 2024 12:23
Comment on lines +58 to +75
switch slot := subscriptionData["slot"].(type) {
case float64:
// JSON numbers are decoded into float64 by default
r.onFinalizedEpoch <- common.GetEpochFromSlot(int64(slot))
case int:
// Handle int if by any chance it's parsed as such
r.onFinalizedEpoch <- common.GetEpochFromSlot(int64(slot))
case string:
// If "epoch" is provided as a string, parse it to an integer
if slotVal, err := strconv.ParseUint(slot, 10, 64); err == nil {
r.onFinalizedEpoch <- common.GetEpochFromSlot(int64(slotVal))
r.log.WithField("slot", slotVal).Debug("Slot value")
} else {
r.log.WithError(err).Error("Error converting epoch from string to uint64")
}
default:
r.log.WithField("data", subscriptionData).Warn("Epoch value is of an unrecognized type")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this convertion to a separate method and leave something like r.onFinalizedEpoch <- common.ToInt64(slot) here?

@kstdl kstdl marked this pull request as draft July 29, 2024 11:18
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.

2 participants