def test_cdt(e, a):
"""
test cdt and the interest of DPT
:param e: instance of ERC20 Token
:param a: random action seed
:return:
"""
# The loan is concurrent with deposit and withdraw, but loan has a concrete period.
# assum very 50 DPT action per CDT action period
run_between = 50
# interest rate
interest = 0.08
# random loan amount
loan = random.randint(1, int(e.CDTS.real/1000)+1)
for i in range(run_between):
random_dpt(e, random.random(), 1/3)
# random CDT action
random_cdt(e, a, loan, interest)
# log CDT and DPT instance
log_cdt(e)
log_dpt(e)
# time.sleep(1)
评论列表
文章目录