Skip to content

Develop - #45

Merged
cristibleotiu merged 1 commit into
mainfrom
develop
May 26, 2026
Merged

Develop#45
cristibleotiu merged 1 commit into
mainfrom
develop

Conversation

@aledefra

Copy link
Copy Markdown
Collaborator

Fix MND reward display

Copilot AI review requested due to automatic review settings May 26, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the MND/GND rewards calculation path to match an updated calculateRewards contract interface, fixing reward display by sending a contiguous epoch range plus packed availability bytes rather than per-epoch arrays.

Changes:

  • Replace epochs[]/availabilies[] compute params with fromEpoch, toEpoch, and packedAvailabilities.
  • Add stricter validation that the oracle-provided epochs fully cover a contiguous [firstEpochToClaim..currentEpoch-1] range before attempting reward calculation.
  • Update the MND contract ABI typings to reflect the new struct field layout and types.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
typedefs/blockchain.ts Updates ComputeParam to the new range + packed-bytes availability shape.
lib/api/blockchain.ts Packs epochs_vals into a hex-bytes payload and calls calculateRewards with fromEpoch/toEpoch, with added contiguity/range guards.
blockchain/MNDContract.ts Updates calculateRewards (and related struct usage) ABI input types to uint256 fromEpoch, uint256 toEpoch, bytes packedAvailabilities.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cristibleotiu
cristibleotiu merged commit 7a0420e into main May 26, 2026
4 checks passed
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.

3 participants