erc20-demurrage-token

ERC20 token with redistributed continual demurrage
Info | Log | Files | Refs | README

tests_sim_limit.py (949B)


      1 # standard imports
      2 import unittest
      3 import logging
      4 
      5 # local imports
      6 from erc20_demurrage_token import DemurrageTokenSettings
      7 from erc20_demurrage_token.sim import (
      8         DemurrageTokenSimulation,
      9         TxLimitException,
     10         )
     11 
     12 logging.basicConfig(level=logging.INFO)
     13 logg = logging.getLogger()
     14 
     15 class TestLimit(unittest.TestCase):
     16 
     17     def setUp(self):
     18         self.cap = 0
     19         settings = DemurrageTokenSettings()
     20         settings.name = 'Simulated Demurrage Token'
     21         settings.symbol = 'SIM'
     22         settings.decimals = 6
     23         settings.demurrage_level = 1
     24         settings.period_minutes = 1
     25         self.sim = DemurrageTokenSimulation('evm:foochain:42', settings, redistribute=True, cap=self.cap, actors=1)
     26 
     27 
     28     def test_limit(self):
     29         with self.assertRaises(TxLimitException):
     30             for i in range(60):
     31                 self.sim.mint(self.sim.actors[0], i)
     32         
     33 
     34 if __name__ == '__main__':
     35     unittest.main()