def test_invalid_coeffs(wallet_3hf: Wallet, budget_type, coeffs):
    response = wallet_3hf.development_committee_change_budgets_auction_properties(
        DEFAULT_WITNESS, coeffs, 86400, budget_type
    )
    validate_error_response(response, wallet_3hf.development_committee_change_budgets_auction_properties.__name__)
    proposals = wallet_3hf.list_proposals()
    assert len(proposals) == 0, "Was created %d proposals, expected only one: %s" % (len(proposals), proposals)
    assert coeffs != wallet_3hf.get_auction_coefficients(budget_type), "Coefficients was changed, but they shouldn't."
Example #2
0
def test_budget_creation_influence_on_pending(wallet_3hf: Wallet, budget, count):
    coeffs = wallet_3hf.get_auction_coefficients()
    budgets = []
    for i in range(1, count + 1):
        budgets_before = get_sorted_budgets(wallet_3hf, budgets)
        budget_cp = copy(budget)
        update_budget_time(wallet_3hf, budget_cp, start=1, deadline=300)
        budget_cp.update({
            "owner": "test.test%d" % i,
            'balance': str(Amount(budget['balance']) * i),
            'uuid': gen_uid()
        })
        wallet_3hf.create_budget(**budget_cp)
        budgets.append(budget_cp)
        budgets_after = get_sorted_budgets(wallet_3hf, budgets)
        check_budgets_delta_pending_calc(get_pending_delta(budgets_before, budgets_after), coeffs)
def test_proposal_creation_and_vote(wallet_3hf: Wallet, budget_type, coeffs):
    change_auction_coeffs(wallet_3hf, coeffs, budget_type)
    assert coeffs == wallet_3hf.get_auction_coefficients(budget_type), "Coefficients wasn't set properly."