Skip to content

Commit

Permalink
fix: move chain modifications after the vote
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita P committed Nov 25, 2024
1 parent a020b63 commit f80dc12
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions tests/test_2024_11_26.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,6 @@ def test_vote(helpers, accounts, vote_ids_from_env, stranger):
# misc
easy_track = interface.EasyTrack("0xF0211b7660680B49De1A7E9f25C65660F0a13Fea")
nor = interface.NodeOperatorsRegistry("0x55032650b14df07b85bF18A3a3eC8E0Af2e028d5")
prepare_agent_for_usdc_payment(15_000_000 * (10**6))
prepare_agent_for_steth_payment(20_000 * 10**18)

# elevate permissions for the amount of max stETH transfer at once
# this is required in order to create and enact fewer motions to transfer a huge amount stETH
EVM_SCRIPT_EXECUTOR = "0xFE5986E06210aC1eCC1aDCafc0cc7f8D63B3F977"
perm_manager = contracts.acl.getPermissionManager(contracts.finance, convert.to_uint(Web3.keccak(text="CREATE_PAYMENTS_ROLE")))
contracts.acl.grantPermissionP(
EVM_SCRIPT_EXECUTOR,
contracts.finance,
convert.to_uint(Web3.keccak(text="CREATE_PAYMENTS_ROLE")),
encode_permission_params(amount_limits()),
{"from": perm_manager}
)

# Item 1
atc_allowed_recipients_registry = interface.AllowedRecipientRegistry("0xe07305F43B11F230EaA951002F6a55a16419B707")
Expand Down Expand Up @@ -217,6 +203,23 @@ def test_vote(helpers, accounts, vote_ids_from_env, stranger):
print(f"voteId = {vote_id}, gasUsed = {vote_tx.gas_used}")


# ensure agent balance
prepare_agent_for_usdc_payment(15_000_000 * (10**6))
prepare_agent_for_steth_payment(20_000 * 10**18)

# elevate permissions for the amount of max stETH transfer at once
# this is required in order to create and enact fewer motions to transfer a huge amount stETH
EVM_SCRIPT_EXECUTOR = "0xFE5986E06210aC1eCC1aDCafc0cc7f8D63B3F977"
perm_manager = contracts.acl.getPermissionManager(contracts.finance, convert.to_uint(Web3.keccak(text="CREATE_PAYMENTS_ROLE")))
contracts.acl.grantPermissionP(
EVM_SCRIPT_EXECUTOR,
contracts.finance,
convert.to_uint(Web3.keccak(text="CREATE_PAYMENTS_ROLE")),
encode_permission_params(amount_limits()),
{"from": perm_manager}
)


# Item 1
atc_budget_limit_after, atc_period_duration_months_after = interface.AllowedRecipientRegistry(atc_allowed_recipients_registry).getLimitParameters()
_, atc_spend_limit_after, atc_period_start_after, atc_period_end_after = interface.AllowedRecipientRegistry(atc_allowed_recipients_registry).getPeriodState()
Expand Down

0 comments on commit f80dc12

Please sign in to comment.