mirror of
git://holbrook.no/erc20-demurrage-token
synced 2026-04-27 10:31:04 +02:00
Rehabilitate change period
This commit is contained in:
@@ -19,9 +19,10 @@ from chainlib.eth.contract import (
|
||||
|
||||
# local imports
|
||||
from erc20_demurrage_token import DemurrageToken
|
||||
from erc20_demurrage_token.token import DemurrageRedistribution
|
||||
|
||||
# test imports
|
||||
from erc20_demurrage_token.unittest.base import TestDemurrageDefault
|
||||
from erc20_demurrage_token.unittest import TestDemurrageDefault
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logg = logging.getLogger()
|
||||
@@ -57,15 +58,6 @@ class TestPeriod(TestDemurrageDefault):
|
||||
period = c.parse_to_redistribution_period(r)
|
||||
self.assertEqual(2, period)
|
||||
|
||||
o = c.redistributions(self.address, 1, sender_address=self.accounts[0])
|
||||
r = self.rpc.do(o)
|
||||
redistribution = c.parse_redistributions(r)
|
||||
|
||||
o = c.to_redistribution_period(self.address, redistribution, sender_address=self.accounts[0])
|
||||
r = self.rpc.do(o)
|
||||
period = c.parse_to_redistribution_period(r)
|
||||
self.assertEqual(2, period)
|
||||
|
||||
o = c.actual_period(self.address, sender_address=self.accounts[0])
|
||||
r = self.rpc.do(o)
|
||||
period = c.parse_actual_period(r)
|
||||
@@ -74,6 +66,7 @@ class TestPeriod(TestDemurrageDefault):
|
||||
o = c.to_redistribution_demurrage_modifier(self.address, redistribution, sender_address=self.accounts[0])
|
||||
r = self.rpc.do(o)
|
||||
period = c.parse_to_redistribution_item(r)
|
||||
redistro = DemurrageRedistribution(redistribution)
|
||||
|
||||
# allow test code float rounding error to billionth
|
||||
modifier = (1 - (self.tax_level / 1000000)) ** (self.period_seconds / 60)
|
||||
|
||||
@@ -18,7 +18,8 @@ from hexathon import (
|
||||
from erc20_demurrage_token import DemurrageToken
|
||||
|
||||
# test imports
|
||||
from erc20_demurrage_token.unittest.base import TestDemurrageSingle
|
||||
from erc20_demurrage_token.unittest import TestDemurrageDefault
|
||||
from erc20_demurrage_token.fixed import to_fixed
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logg = logging.getLogger()
|
||||
@@ -26,11 +27,9 @@ logg = logging.getLogger()
|
||||
testdir = os.path.dirname(__file__)
|
||||
|
||||
|
||||
class TestRedistributionSingle(TestDemurrageSingle):
|
||||
|
||||
class TestRedistributionSingle(TestDemurrageDefault):
|
||||
|
||||
def test_single_even_if_multiple(self):
|
||||
|
||||
mint_amount = 100000000
|
||||
|
||||
nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
|
||||
@@ -64,7 +63,7 @@ class TestRedistributionSingle(TestDemurrageSingle):
|
||||
r = self.rpc.do(o)
|
||||
self.assertEqual(r['status'], 1)
|
||||
|
||||
tax_modifier = (1 - (self.tax_level / 1000000)) ** 10
|
||||
tax_modifier = 0.98
|
||||
o = c.balance_of(self.address, self.accounts[1], sender_address=self.accounts[0])
|
||||
r = self.rpc.do(o)
|
||||
balance = c.parse_balance(r)
|
||||
|
||||
Reference in New Issue
Block a user