simulated.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:contracts 作者: DAB-Foundation 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号