Skip to content

Commit

Permalink
test: correct calculation of coinbasevalue in feature_asset_locks.py (
Browse files Browse the repository at this point in the history
#5603)

## Issue being fixed or feature implemented
Fixed a problem forgotten in #5588 in feature_asset_locks.py.

## What was done?
Avoid floating operations when calculating `coinbasevalue`

## How Has This Been Tested?

## Breaking Changes

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone _(for repository
code-owners and collaborators only)_

---------

Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
  • Loading branch information
ogabrielides and UdjinM6 authored Oct 11, 2023
1 parent bf84e37 commit 5ca6382
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/functional/feature_asset_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ def run_test(self):
owner_reward = bt['masternode'][1]['amount']
operator_reward = bt['masternode'][2]['amount'] if len(bt['masternode']) == 3 else 0
all_mn_rewards = platform_reward + owner_reward + operator_reward
all_mn_rewards += 1 * 0.75
assert_equal(all_mn_rewards, bt['coinbasevalue'] * 0.75) # 75/25 mn/miner reward split
assert_equal(all_mn_rewards, bt['coinbasevalue'] * 3 // 4) # 75/25 mn/miner reward split
assert_equal(platform_reward, all_mn_rewards * 375 // 1000) # 0.375 platform share
assert_equal(platform_reward, 2555399792)
assert_equal(new_total, self.get_credit_pool_balance())
Expand Down

0 comments on commit 5ca6382

Please sign in to comment.