mirror of
git://holbrook.no/erc20-demurrage-token
synced 2024-12-22 20:07:32 +01:00
36 lines
949 B
Python
36 lines
949 B
Python
# standard imports
|
|
import unittest
|
|
import logging
|
|
|
|
# local imports
|
|
from erc20_demurrage_token import DemurrageTokenSettings
|
|
from erc20_demurrage_token.sim import (
|
|
DemurrageTokenSimulation,
|
|
TxLimitException,
|
|
)
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
logg = logging.getLogger()
|
|
|
|
class TestLimit(unittest.TestCase):
|
|
|
|
def setUp(self):
|
|
self.cap = 0
|
|
settings = DemurrageTokenSettings()
|
|
settings.name = 'Simulated Demurrage Token'
|
|
settings.symbol = 'SIM'
|
|
settings.decimals = 6
|
|
settings.demurrage_level = 1
|
|
settings.period_minutes = 1
|
|
self.sim = DemurrageTokenSimulation('evm:foochain:42', settings, redistribute=True, cap=self.cap, actors=1)
|
|
|
|
|
|
def test_limit(self):
|
|
with self.assertRaises(TxLimitException):
|
|
for i in range(60):
|
|
self.sim.mint(self.sim.actors[0], i)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|