logger.info("Wait 30 days for full voting power")
            hive_utils.debug_quick_block_skip(node_client, wif, (30 * 24 * 3600 / 3))
            hive_utils.debug_generate_blocks(node_client.rpc.url, wif, 10)

            # transfer assets to accounts
            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, 
                "400.000", "TESTS", wif
            )

            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, 
                "400.000", "TBD", wif
            )

            logger.info("Balances for accounts after initial transfer")
            test_utils.print_balance(node_client, accounts)
            # transfer assets to treasury
            test_utils.transfer_assets_to_treasury(node_client, args.creator, args.treasury, 
                "1000000.000", "TBD", wif
            )
            test_utils.print_balance(node_client, [{'name' : args.treasury}])

            # create post for valid permlinks
            test_utils.create_posts(node_client, accounts, wif)

            now = node_client.get_dynamic_global_properties(False).get('time', None)
            if now is None:
                raise ValueError("Head time is None")
            now = test_utils.date_from_iso(now)

            proposal_data = [
            test_utils.create_accounts(node_client, args.creator, accounts)
            # tranfer to vesting
            test_utils.transfer_to_vesting(node_client, args.creator, accounts, "300.000", 
                "TESTS"
            )
            # transfer assets to accounts
            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, 
                "400.000", "TESTS"
            )

            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, 
                "400.000", "TBD"
            )

            logger.info("Balances for accounts after initial transfer")
            test_utils.print_balance(node_client, accounts)
            # transfer assets to treasury
            test_utils.transfer_assets_to_treasury(node_client, args.creator, args.treasury, 
                "1000000.000", "TESTS"
            )

            test_utils.transfer_assets_to_treasury(node_client, args.creator, args.treasury, 
                "1000000.000", "TBD"
            )
            test_utils.print_balance(node_client, [{'name' : args.treasury}])

            # create post for valid permlinks
            test_utils.create_posts(node_client, accounts)

            now = node_client.get_dynamic_global_properties().get('time', None)
            if now is None:
Beispiel #3
0
            w.feed_publish(1000.000, account="initminer")
            hive_utils.common.wait_n_blocks(node_client.rpc.url, 5)

            logger.info("Chain prefix is: {}".format(node_client.prefix))
            logger.info("Chain ID is: {}".format(node_client.get_config()["HIVE_CHAIN_ID"]))

            # create accounts
            test_utils.create_accounts(node_client, args.creator, accounts)
            # tranfer to vesting
            test_utils.transfer_to_vesting(node_client, args.creator, accounts, "3000000.000", "TESTS")
            # transfer assets to accounts
            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, "10000.000", "TESTS")
            test_utils.transfer_assets_to_accounts(node_client, args.creator, accounts, "10000.000", "TBD")

            logger.info("Balances for accounts after initial transfer")
            test_utils.print_balance(node_client, accounts)

            # create post for valid permlinks
            from beem.account import Account
            test_utils.create_posts(node_client, accounts)
            logger.info("Voting...")
            for account in accounts[1:]:
                acc = Account(account["name"], hive_instance=node_client)
                node_client.vote(100., "@{}/{}".format("tester001", test_utils.get_post_permlink("tester001")),account=acc)
            hive_utils.common.wait_n_blocks(node_client.rpc.url, 10)

            last_cashout_time, _ = print_comment_rewards(node_client, accounts)
            logger.info("Last block number: {}".format(node_client.get_dynamic_global_properties(False)['head_block_number']))
            logger.info("Accelerating time...")
            hive_utils.debug_generate_blocks_until(node_client.rpc.url, wif, last_cashout_time, False)
            hive_utils.debug_generate_blocks(node_client.rpc.url, wif, 100)