for vote in votes:
                #should be 0 for all
                assert vote == 0, "All votes should be equal to 0"

            logger.info("Balances for accounts after creating proposals")
            balances = test_utils.print_balance(node_client, accounts)
            for balance in balances:
                #should be 390.000 TBD for all
                assert balance == '390.000 TBD', "All balances should be equal to 390.000 TBD"
            test_utils.print_balance(node_client, [{'name' : args.treasury}])

            # move forward in time to see if proposals are paid
            # moving is made in 1h increments at a time, after each 
            # increment balance is printed
            logger.info("Moving to date: {}".format(test_start_date_iso))
            node_client.debug_generate_blocks_until(wif, test_start_date_iso, False)
            current_date = test_start_date
            while current_date < test_end_date:
                current_date = current_date + datetime.timedelta(hours = 1)
                current_date_iso = test_utils.date_to_iso(current_date)

                logger.info("Moving to date: {}".format(current_date_iso))
                node_client.debug_generate_blocks_until(wif, current_date_iso, False)

                logger.info("Balances for accounts at time: {}".format(current_date_iso))
                test_utils.print_balance(node_client, accounts)
                test_utils.print_balance(node_client, [{'name' : args.treasury}])

                votes = test_utils.list_proposals(node_client, test_start_date_iso, "active")
                votes = test_utils.list_proposals(node_client, test_start_date_iso, "expired")
                votes = test_utils.list_proposals(node_client, test_start_date_iso, "all")
示例#2
0
            for vote in votes:
                #should be 0 for all
                assert vote == 0, "All votes should be equal to 0"

            logger.info("Balances for accounts after creating proposals")
            balances = test_utils.print_balance(node_client, accounts)
            for balance in balances:
                #should be 390.000 TBD for all
                assert balance == '390.000 TBD', "All balances should be equal to 390.000 TBD"
            test_utils.print_balance(node_client, [{'name': args.treasury}])

            # move forward in time to see if proposals are paid
            # moving is made in 1h increments at a time, after each
            # increment balance is printed
            logger.info("Moving to date: {}".format(test_start_date_iso))
            node_client.debug_generate_blocks_until(wif, test_start_date_iso,
                                                    False)
            current_date = test_start_date
            while current_date < test_end_date:
                current_date = current_date + datetime.timedelta(hours=1)
                current_date_iso = test_utils.date_to_iso(current_date)

                logger.info("Moving to date: {}".format(current_date_iso))
                node_client.debug_generate_blocks_until(
                    wif, current_date_iso, False)

                logger.info("Balances for accounts at time: {}".format(
                    current_date_iso))
                test_utils.print_balance(node_client, accounts)
                test_utils.print_balance(node_client, [{
                    'name': args.treasury
                }])
            for vote in votes:
                #should be 0 for all
                assert vote == 0, "All votes should be equal to 0"

            logger.info("Balances for accounts after creating proposals")
            balances = test_utils.print_balance(node_client, accounts)
            for balance in balances:
                #should be 390.000 TBD for all
                assert balance == '390.000 TBD', "All balances should be equal to 390.000 TBD"
            test_utils.print_balance(node_client, [{'name' : args.treasury}])

            # move forward in time to see if proposals are paid
            # moving is made in 1h increments at a time, after each 
            # increment balance is printed
            logger.info("Moving to date: {}".format(start_date_str))
            node_client.debug_generate_blocks_until(wif, start_date_str, False)
            current_date = start_date
            while current_date < end_date:
                current_date = current_date + datetime.timedelta(hours = 1)
                current_date_str = current_date.replace(microsecond=0).isoformat()
                logger.info("Moving to date: {}".format(current_date_str))
                node_client.debug_generate_blocks_until(wif, current_date_str, False)

                logger.info("Balances for accounts at time: {}".format(current_date_str))
                test_utils.print_balance(node_client, accounts)
                test_utils.print_balance(node_client, [{'name' : args.treasury}])
                votes = test_utils.list_proposals(node_client, start_date_str, "active")
                for vote in votes:
                    # should be > 0 for all
                    assert vote > 0, "All votes counts shoud be greater than 0"