From 7aa672ecc091dcf518b386afca28264ceb2556f7 Mon Sep 17 00:00:00 2001 From: Schlagonia Date: Wed, 7 Feb 2024 17:34:31 -0700 Subject: [PATCH] chore: update roles and name --- contracts/Managers/RoleManager.sol | 14 ++++++++++---- tests/manager/test_role_manager.py | 13 +++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/contracts/Managers/RoleManager.sol b/contracts/Managers/RoleManager.sol index 23a63ee..3b84b31 100644 --- a/contracts/Managers/RoleManager.sol +++ b/contracts/Managers/RoleManager.sol @@ -149,7 +149,8 @@ contract RoleManager is Governance2Step { roles: uint96( Roles.REPORTING_MANAGER | Roles.DEBT_MANAGER | - Roles.QUEUE_MANAGER + Roles.QUEUE_MANAGER | + Roles.DEBT_PURCHASER ) }); @@ -162,7 +163,7 @@ contract RoleManager is Governance2Step { // The keeper can process reports and update debt. _positions[KEEPER] = Position({ holder: _keeper, - roles: uint96(Roles.REPORTING_MANAGER | Roles.DEBT_MANAGER) + roles: uint96(Roles.REPORTING_MANAGER) }); // Set just the roles for a debt allocator. @@ -255,9 +256,14 @@ contract RoleManager is Governance2Step { // Create the name and symbol to be standardized based on rating. string memory ratingString = ratingToString[_rating]; - // Name is "{SYMBOL} yVault-{RATING}" + // Name is "{SYMBOL}-{RATING} yVault" string memory _name = string( - abi.encodePacked(ERC20(_asset).symbol(), " yVault-", ratingString) + abi.encodePacked( + ERC20(_asset).symbol(), + "-", + ratingString, + " yVault" + ) ); // Symbol is "yv{SYMBOL}-{RATING}". string memory _symbol = string( diff --git a/tests/manager/test_role_manager.py b/tests/manager/test_role_manager.py index 785b3cd..b5ea725 100644 --- a/tests/manager/test_role_manager.py +++ b/tests/manager/test_role_manager.py @@ -5,9 +5,14 @@ from utils.helpers import to_bytes32 daddy_roles = ROLES.ALL -brain_roles = ROLES.REPORTING_MANAGER | ROLES.DEBT_MANAGER | ROLES.QUEUE_MANAGER +brain_roles = ( + ROLES.REPORTING_MANAGER + | ROLES.DEBT_MANAGER + | ROLES.QUEUE_MANAGER + | ROLES.DEBT_PURCHASER +) security_roles = ROLES.MAX_DEBT_MANAGER -keeper_roles = ROLES.REPORTING_MANAGER | ROLES.DEBT_MANAGER +keeper_roles = ROLES.REPORTING_MANAGER debt_allocator_roles = ROLES.REPORTING_MANAGER | ROLES.DEBT_MANAGER strategy_manager_roles = ROLES.ADD_STRATEGY_MANAGER | ROLES.REVOKE_STRATEGY_MANAGER @@ -366,7 +371,7 @@ def test_deploy_new_vault( symbol = asset.symbol() assert vault.symbol() == f"yv{symbol}-A" - assert vault.name() == f"{symbol} yVault-A" + assert vault.name() == f"{symbol}-A yVault" # Check debt allocator assert debt_allocator.vault() == vault @@ -543,7 +548,7 @@ def test_deploy_new_vault__default_values( symbol = asset.symbol() assert vault.symbol() == f"yv{symbol}-B" - assert vault.name() == f"{symbol} yVault-B" + assert vault.name() == f"{symbol}-B yVault" # Check debt allocator assert debt_allocator.vault() == vault