Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Implement Rewards API #6688

Closed
mehmetegemen opened this issue Aug 25, 2021 · 1 comment
Closed

Implement Rewards API #6688

mehmetegemen opened this issue Aug 25, 2021 · 1 comment

Comments

@mehmetegemen
Copy link
Contributor

mehmetegemen commented Aug 25, 2021

Description

Implement reward module API in api.ts for getBlockReward function and implement this API to reward module class as specified in https://research.lisk.com/t/define-state-transitions-of-reward-module/316#getblockreward-13

getBlockReward(blockHeader):
    if isValidSeedReveal(blockHeader.generatorAddress, blockHeader.seedReveal) == false:
        return 0

    defaultReward = getDefaultRewardAtHeight(blockHeader.height)
    if impliesMaximalPrevotes(blockHeader) == false: 
        return defaultReward / REWARD_REDUCTION_FACTOR_BFT

    return defaultReward

Acceptance Criteria

  • getBlockReward function must be implemented and unit tested

Related Issue

#6686

@mehmetegemen
Copy link
Contributor Author

Suspended until assets will be part of the context since we need seedReveal from the assets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants