예제 #1
0
    def test_initial_account_period_violation_cooldown(self):
        test_utils.create_posts(self.scrub, self.limit, bulk=True)
        new_created = timezone.now() - utils.get_config(
            'initial_account_period_width')
        self.scrub.post_set.update(created=new_created)

        # Post should be created
        self.assertEqual(self._attempt_new_post(), 1)
예제 #2
0
                                                   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:
                raise ValueError("Head time is None")
            now = test_utils.date_from_iso(now)

            proposal_data = [
                ['tester001', 1 + 0, 3,
                 '240000.000 TBD'],  # starts 1 day from now and lasts 3 days
                ['tester002', 1 + 0, 3,
                 '24.000 TBD'],  # starts 1 day from now and lasts 3 days
                ['tester003', 1 + 0, 3,
                 '24.000 TBD'],  # starts 1 days from now and lasts 3 day
                ['tester004', 1 + 0, 3,
                 '24.000 TBD']  # starts 1 days from now and lasts 3 day
예제 #3
0
            )

            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:
                raise ValueError("Head time is None")
            now = test_utils.date_from_iso(now)

            proposal_data = [
                ['tester001', 1 + 0, 5, '24.000 TBD'], # starts one day from now and lasts five days
                ['tester002', 1 + 0, 2, '24.000 TBD'], # starts one day from now and lasts two days
                ['tester003', 1 + 2, 1, '24.000 TBD'], # starts three days from now and lasts one day
                ['tester004', 1 + 4, 1, '24.000 TBD']  # starts four days from now and lasts one day
            ]

            proposals = [
                # pace proposals here in the format: {'creator' : creator, 'receiver' : receiver, 'start_date' : start-date, 'end_date' : end_date}
예제 #4
0
    def test_initial_account_period_done(self):
        # Create enough posts to get us out of the initial period
        count = utils.get_config('initial_account_period_total')
        test_utils.create_posts(self.scrub, count + 1, bulk=True)

        self.assertEqual(self._attempt_new_post(), 1)
예제 #5
0
 def test_initial_account_period_violation(self):
     test_utils.create_posts(self.scrub, self.limit, bulk=True)
     # Post should be rejected
     self.assertEqual(self._attempt_new_post(), 0)