@@ -330,14 +330,19 @@ def test_vote(helpers, accounts, ldo_holder, vote_ids_from_env, stranger, dual_g
330330 assert buyback_executor .stonks () == ZERO_ADDRESS , "BuybackExecutor stonks already set"
331331 # vote item 4
332332 assert not buyback_executor .hasRole (ALLOCATOR_ROLE , BUYBACK_ALLOCATOR )
333+ assert buyback_executor .getRoleMemberCount (ALLOCATOR_ROLE ) == 0
333334 # vote item 5
334335 assert not buyback_executor .hasRole (MANAGER_ROLE , TMC )
336+ assert buyback_executor .getRoleMemberCount (MANAGER_ROLE ) == 0
335337 # vote item 6
336338 assert not buyback_executor .hasRole (EMERGENCY_ROLE , TMC )
337339 # vote item 7
338340 assert not buyback_executor .hasRole (EMERGENCY_ROLE , EMERGENCY_COMMITTEE )
341+ # vote items 6-7 grant the same role, so its holders are counted once for both
342+ assert buyback_executor .getRoleMemberCount (EMERGENCY_ROLE ) == 0
339343 # vote item 8
340344 assert not buyback_allocator .hasRole (MANAGER_ROLE , TMC )
345+ assert buyback_allocator .getRoleMemberCount (MANAGER_ROLE ) == 0
341346 # vote item 9
342347 assert buyback_allocator .activationTS () == 0 , "BuybackAllocator already activated"
343348 # vote items 10-11
@@ -402,14 +407,24 @@ def test_vote(helpers, accounts, ldo_holder, vote_ids_from_env, stranger, dual_g
402407 assert buyback_executor .stonks () == BUYBACK_STONKS_TREASURY , "BuybackExecutor stonks not set"
403408 # vote item 4
404409 assert buyback_executor .hasRole (ALLOCATOR_ROLE , BUYBACK_ALLOCATOR ), "ALLOCATOR_ROLE not granted to allocator"
410+ assert buyback_executor .getRoleMemberCount (ALLOCATOR_ROLE ) == 1 , "extra ALLOCATOR_ROLE holder on the executor"
405411 # vote item 5
406412 assert buyback_executor .hasRole (MANAGER_ROLE , TMC ), "executor MANAGER_ROLE not granted to TMC"
413+ assert buyback_executor .getRoleMemberCount (MANAGER_ROLE ) == 1 , "extra MANAGER_ROLE holder on the executor"
407414 # vote item 6
408415 assert buyback_executor .hasRole (EMERGENCY_ROLE , TMC ), "executor EMERGENCY_ROLE not granted to TMC"
409416 # vote item 7
410417 assert buyback_executor .hasRole (EMERGENCY_ROLE , EMERGENCY_COMMITTEE ), "executor EMERGENCY_ROLE not granted to EC"
418+ # vote items 6-7 grant the same role, so TMC and the emergency committee are its only holders
419+ assert buyback_executor .getRoleMemberCount (EMERGENCY_ROLE ) == 2 , "extra EMERGENCY_ROLE holder on the executor"
411420 # vote item 8
412421 assert buyback_allocator .hasRole (MANAGER_ROLE , TMC ), "allocator MANAGER_ROLE not granted to TMC"
422+ assert buyback_allocator .getRoleMemberCount (MANAGER_ROLE ) == 1 , "extra MANAGER_ROLE holder on the allocator"
423+ # the role admin is untouched by the vote: still Voting alone on both contracts
424+ assert buyback_executor .hasRole (DEFAULT_ADMIN_ROLE , VOTING )
425+ assert buyback_executor .getRoleMemberCount (DEFAULT_ADMIN_ROLE ) == 1
426+ assert buyback_allocator .hasRole (DEFAULT_ADMIN_ROLE , VOTING )
427+ assert buyback_allocator .getRoleMemberCount (DEFAULT_ADMIN_ROLE ) == 1
413428 # vote item 9: activate() records activationTS as midnight UTC of the execution day
414429 assert buyback_allocator .activationTS () == vote_tx .timestamp - (vote_tx .timestamp % ONE_DAY ), \
415430 "BuybackAllocator not activated at the vote-execution day's midnight UTC"
0 commit comments