Skip to content

Commit

Permalink
Update tests for daily reward
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar committed Jun 1, 2021
1 parent 1b3fed3 commit ed8a68e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/functional/feature_poolswap_mechanism.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def run_test(self):
assert(self.nodes[0].getblockcount() == 120) # eunos

self.LP_DAILY_DFI_REWARD = self.nodes[0].getgov("LP_DAILY_DFI_REWARD")['LP_DAILY_DFI_REWARD']
assert_equal(self.LP_DAILY_DFI_REWARD, Decimal('103.08268000'))
assert_equal(self.LP_DAILY_DFI_REWARD, Decimal('14843.90592000')) # 144 blocks a day times 103.08268000

print("Swapping tokens after eunos height...")
self.poolswap(self.nodes)
Expand Down
6 changes: 3 additions & 3 deletions test/functional/feature_setgov.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def run_test(self):
assert("Cannot be set manually after Eunos hard fork" in errorString)

# Check new subsidy
assert_equal(self.nodes[0].getgov('LP_DAILY_DFI_REWARD')['LP_DAILY_DFI_REWARD'], Decimal('103.08268000'))
assert_equal(self.nodes[0].getgov('LP_DAILY_DFI_REWARD')['LP_DAILY_DFI_REWARD'], Decimal('14843.90592000')) # 144 blocks a day times 103.08268000

# Roll back
self.nodes[0].invalidateblock(self.nodes[0].getblockhash(self.nodes[0].getblockcount()))
Expand All @@ -217,13 +217,13 @@ def run_test(self):

# Move to second reduction and check reward
self.nodes[0].generate(151)
assert_equal(self.nodes[0].getgov('LP_DAILY_DFI_REWARD')['LP_DAILY_DFI_REWARD'], Decimal('101.37356916'))
assert_equal(self.nodes[0].getgov('LP_DAILY_DFI_REWARD')['LP_DAILY_DFI_REWARD'], Decimal('14597.79395904')) # 144 blocks a day times 101.37356916

# Rollback from second reduction
self.nodes[0].invalidateblock(self.nodes[0].getblockhash(self.nodes[0].getblockcount()))

# Check subsidy restored
assert_equal(self.nodes[0].getgov('LP_DAILY_DFI_REWARD')['LP_DAILY_DFI_REWARD'], Decimal('103.08268000'))
assert_equal(self.nodes[0].getgov('LP_DAILY_DFI_REWARD')['LP_DAILY_DFI_REWARD'], Decimal('14843.90592000'))

if __name__ == '__main__':
GovsetTest ().main ()

0 comments on commit ed8a68e

Please sign in to comment.