Skip to content

Commit

Permalink
feat: force registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Feb 21, 2024
1 parent dcaf70c commit 0391fdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
6 changes: 5 additions & 1 deletion contracts/Managers/RoleManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ contract RoleManager is Governance2Step {
address _brain,
address _security,
address _keeper,
address _strategyManager
address _strategyManager,
address _registry
) Governance2Step(_governance) {
require(_daddy != address(0), "ZERO ADDRESS");
// Set the immutable address that will take over role manager
Expand Down Expand Up @@ -178,6 +179,9 @@ contract RoleManager is Governance2Step {
Roles.ADD_STRATEGY_MANAGER | Roles.REVOKE_STRATEGY_MANAGER
)
});

// Set the registry
_positions[REGISTRY].holder = _registry;
}

/*//////////////////////////////////////////////////////////////
Expand Down
15 changes: 6 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,19 @@ def debt_allocator(debt_allocator_factory, project, vault, daddy):


@pytest.fixture(scope="session")
def deploy_role_manager(project, daddy, brain, security, keeper, strategy_manager):
def deploy_role_manager(
project, daddy, brain, security, keeper, strategy_manager, registry
):
def deploy_role_manager(
gov=daddy,
sms=brain,
sec=security,
keep=keeper,
strategy_manage=strategy_manager,
reg=registry,
):
role_manager = daddy.deploy(
project.RoleManager, gov, daddy, sms, sec, keep, strategy_manage
project.RoleManager, gov, daddy, sms, sec, keep, strategy_manage, reg
)

return role_manager
Expand All @@ -437,19 +440,13 @@ def deploy_role_manager(

@pytest.fixture(scope="session")
def role_manager(
deploy_role_manager,
daddy,
brain,
healthcheck_accountant,
debt_allocator_factory,
registry,
deploy_role_manager, daddy, brain, healthcheck_accountant, debt_allocator_factory
):
role_manager = deploy_role_manager()

role_manager.setPositionHolder(
role_manager.ACCOUNTANT(), healthcheck_accountant, sender=daddy
)
role_manager.setPositionHolder(role_manager.REGISTRY(), registry, sender=daddy)
role_manager.setPositionHolder(
role_manager.ALLOCATOR_FACTORY(), debt_allocator_factory, sender=daddy
)
Expand Down

0 comments on commit 0391fdd

Please sign in to comment.