Skip to content

Commit 5e91ebf

Browse files
author
Nikita P
committed
feat: less literals
1 parent b8c7d2b commit 5e91ebf

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tests/test_2024_11_26.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def test_vote(helpers, accounts, vote_ids_from_env, stranger):
4848
tmc_top_up_evm_script_factory = interface.TopUpAllowedRecipients("0x6e04aED774B7c89BB43721AcDD7D03C872a51B69")
4949
stETH_token = interface.ERC20("0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84")
5050
stonks_steth_contract = accounts.at("0x3e2D251275A92a8169A3B17A2C49016e2de492a7", force=True)
51+
tmcBudgetAfterExpected = 12_000 * 10**18
52+
tmcNewSpentAmountExpected = 0
5153

5254
# Item 5
5355
# NO's data indexes
@@ -125,22 +127,22 @@ def test_vote(helpers, accounts, vote_ids_from_env, stranger):
125127

126128
# Item 3
127129
tmcBudgetLimitAfter, tmcPeriodDurationMonthsAfter = interface.AllowedRecipientRegistry(tmc_allowed_recipients_registry).getLimitParameters()
128-
assert tmcBudgetLimitAfter == 12_000 * 10 ** 18
130+
assert tmcBudgetLimitAfter == tmcBudgetAfterExpected
129131
assert tmcPeriodDurationMonthsAfter == 6
130132

131133
# Item 4
132-
alreadySpentAmountAfter, spendableBalanceInPeriodAfter, periodStartTimestampAfter, periodEndTimestampAfter = tmc_allowed_recipients_registry.getPeriodState()
133-
assert alreadySpentAmountAfter == 0
134+
alreadySpentAmountAfter = tmc_allowed_recipients_registry.getPeriodState()[0]
135+
assert alreadySpentAmountAfter == tmcNewSpentAmountExpected
134136
tmcSpendableBalanceAfter = interface.AllowedRecipientRegistry(tmc_allowed_recipients_registry).spendableBalance()
135-
assert tmcSpendableBalanceAfter == 12_000 * 10 ** 18
137+
assert tmcSpendableBalanceAfter == tmcBudgetAfterExpected
136138
with reverts("SUM_EXCEEDS_SPENDABLE_BALANCE"):
137139
create_and_enact_payment_motion(
138140
easy_track,
139141
tmc_trusted_caller,
140142
tmc_top_up_evm_script_factory,
141143
stETH_token,
142144
[stonks_steth_contract],
143-
[12_000 * 10 ** 18 + 1],
145+
[tmcBudgetAfterExpected + 1],
144146
stranger,
145147
)
146148

@@ -193,13 +195,13 @@ def test_vote(helpers, accounts, vote_ids_from_env, stranger):
193195
)
194196
validate_set_limit_parameter_event(
195197
evs[2],
196-
limit=12_000 * 10 ** 18,
198+
limit=tmcBudgetAfterExpected,
197199
period_duration_month=6,
198200
period_start_timestamp=1719792000,
199201
)
200202
validate_set_spent_amount_event(
201203
evs[3],
202-
new_spent_amount=0,
204+
new_spent_amount=tmcNewSpentAmountExpected,
203205
)
204206
validate_node_operator_reward_address_set_event(
205207
evs[4],

0 commit comments

Comments
 (0)