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

feat: Bug of not showing the correct amount in today's rewards when staking later during epoch #749

Open
wants to merge 9 commits into
base: staging
Choose a base branch
from

Conversation

mohandast52
Copy link
Collaborator

@mohandast52 mohandast52 commented Feb 7, 2025

Proposed changes

  • Rewards should be calculated based on when the agent was started. If it hasn’t started, the default will display the full rewards for today’s epoch.
  • NOTE: Tested using mocks, but I’ll ask @iasonrovis to test it from a user perspective.

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@mohandast52 mohandast52 added the bug Something isn't working label Feb 7, 2025
@mohandast52 mohandast52 self-assigned this Feb 7, 2025
@mohandast52 mohandast52 marked this pull request as ready for review February 7, 2025 10:28
// if agent is not staked, return the available rewards for the epoch
// i.e, agent has not yet started staking
if (isNil(serviceStakingStartTime) || serviceStakingStartTime === 0) {
return parseFloat(formatUnits(`${availableRewardsForEpoch}`));
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't understand why if not staked return full amount, but if staked but not yet eligible return undefined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

where are we returning undefined?

Copy link
Collaborator

Choose a reason for hiding this comment

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

here for example
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah ok, removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants