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

[Rewards] max limit parameter has no effect on fixed tax #214

Open
dkijania opened this issue Dec 9, 2019 · 3 comments
Open

[Rewards] max limit parameter has no effect on fixed tax #214

dkijania opened this issue Dec 9, 2019 · 3 comments
Labels

Comments

@dkijania
Copy link
Contributor

dkijania commented Dec 9, 2019

When using max_limit parameter along with fixed tax, reward mechanism does not take max_limit parameter value into account.

Example:
Given stake pool registration:

StakePool { ..., 
     rewards: TaxType { 
          fixed: Value(100), 
          ratio: Ratio { numerator: 0, denominator: 1 }, 
          max_limit: Some(30) 
     }, ....
 }

Actual reward: 100
Expected reward: 30

@dkijania dkijania added the test label Dec 9, 2019
@rinor
Copy link
Contributor

rinor commented Dec 9, 2019

In some earlier conversations was pointed out that max_limit does not apply to the whole amount of the tax, but only to the ratio value. So the max expected total tax amount is fixed+max_limit and the min is fixed

@dkijania
Copy link
Contributor Author

dkijania commented Dec 9, 2019

thanks, probably i missed that information. However, based on my tests i think min is not fixed it's: min(fixed,max_limit)

@dkijania
Copy link
Contributor Author

dkijania commented Dec 9, 2019

If i have test like below:

let total_reward = 100;
let expected_stake_pool_reward = 10;
verify_distribute_rewards(
    total_reward,
    stake_pool("stake_pool").fixed_tax(10).tax_limit(5),
    expected_stake_pool_reward,
);

it fails due to assertion:
expected_stake_pool_reward != 5 (actual)

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

No branches or pull requests

2 participants