diff --git a/contracts/Registry.vy b/contracts/Registry.vy index 3e45e875e..429daed89 100644 --- a/contracts/Registry.vy +++ b/contracts/Registry.vy @@ -166,7 +166,6 @@ def newRelease(vault: address): assert Vault(vault).governance() == msg.sender # dev: not governed self._registerRelease(vault) - self._registerDeployment(Vault(vault).token(), vault) # NOTE: Should never throw @internal diff --git a/tests/functional/registry/test_deployment.py b/tests/functional/registry/test_deployment.py index d87a30bd4..d59db43ed 100644 --- a/tests/functional/registry/test_deployment.py +++ b/tests/functional/registry/test_deployment.py @@ -13,6 +13,7 @@ def test_deployment_management( # Creating the first deployment makes `latestVault()` work v1_vault = create_vault(token, version="1.0.0") registry.newRelease(v1_vault, {"from": gov}) + registry.endorseVault(v1_vault, {"from": gov}) assert registry.latestVault(token) == v1_vault assert registry.latestRelease() == v1_vault.apiVersion() == "1.0.0" diff --git a/tests/functional/wrappers/test_affliate.py b/tests/functional/wrappers/test_affliate.py index ded05f5bf..427a36a11 100644 --- a/tests/functional/wrappers/test_affliate.py +++ b/tests/functional/wrappers/test_affliate.py @@ -23,6 +23,7 @@ def test_config(gov, token, vault, registry, affiliate_token): # Now they work when we have a Vault registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) assert affiliate_token.bestVault() == vault assert affiliate_token.allVaults() == [vault] @@ -62,6 +63,7 @@ def test_setRegistry(rando, affiliate, gov, affiliate_token): def test_deposit(token, registry, vault, affiliate_token, gov, rando): registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) assert affiliate_token.balanceOf(rando) == vault.balanceOf(rando) == 0 @@ -75,6 +77,7 @@ def test_deposit(token, registry, vault, affiliate_token, gov, rando): def test_migrate(token, registry, create_vault, affiliate_token, gov, rando, affiliate): vault1 = create_vault(version="1.0.0", token=token) registry.newRelease(vault1, {"from": gov}) + registry.endorseVault(vault1, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) token.approve(affiliate_token, 10000, {"from": rando}) affiliate_token.deposit(10000, {"from": rando}) @@ -83,6 +86,7 @@ def test_migrate(token, registry, create_vault, affiliate_token, gov, rando, aff vault2 = create_vault(version="2.0.0", token=token) registry.newRelease(vault2, {"from": gov}) + registry.endorseVault(vault2, {"from": gov}) with brownie.reverts(): affiliate_token.migrate({"from": rando}) @@ -96,6 +100,7 @@ def test_migrate(token, registry, create_vault, affiliate_token, gov, rando, aff def test_transfer(token, registry, vault, affiliate_token, gov, rando, affiliate): registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) token.approve(affiliate_token, 10000, {"from": rando}) affiliate_token.deposit(10000, {"from": rando}) @@ -109,6 +114,7 @@ def test_transfer(token, registry, vault, affiliate_token, gov, rando, affiliate def test_withdraw(token, registry, vault, affiliate_token, gov, rando): registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) token.approve(affiliate_token, 10000, {"from": rando}) affiliate_token.deposit(10000, {"from": rando}) diff --git a/tests/functional/wrappers/test_ytoken.py b/tests/functional/wrappers/test_ytoken.py index d668888d6..0af556827 100644 --- a/tests/functional/wrappers/test_ytoken.py +++ b/tests/functional/wrappers/test_ytoken.py @@ -26,6 +26,7 @@ def test_config(gov, token, vault, registry, ytoken): # Now they work when we have a Vault registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) assert ytoken.bestVault() == vault assert ytoken.name() == vault.name() assert ytoken.symbol() == vault.symbol() @@ -43,6 +44,7 @@ def test_setRegistry(rando, gov, ytoken): def test_deposit(token, registry, vault, ytoken, gov, rando): registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) assert ytoken.balanceOf(rando) == vault.balanceOf(rando) == 0 @@ -54,6 +56,7 @@ def test_deposit(token, registry, vault, ytoken, gov, rando): def test_transfer(token, registry, vault, ytoken, gov, rando, affiliate): registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) token.approve(ytoken, 10000, {"from": rando}) ytoken.deposit(10000, {"from": rando}) @@ -69,6 +72,7 @@ def test_transfer(token, registry, vault, ytoken, gov, rando, affiliate): def test_withdraw(token, registry, vault, ytoken, gov, rando): registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) token.transfer(rando, 10000, {"from": gov}) token.approve(ytoken, 10000, {"from": rando}) ytoken.deposit(10000, {"from": rando}) @@ -87,6 +91,8 @@ def test_migrate(token, registry, create_vault, sign_vault_permit, ytoken, gov): vault1 = create_vault(version="1.0.0", token=token) registry.newRelease(vault1, {"from": gov}) + registry.endorseVault(vault1, {"from": gov}) + assert registry.latestVault(token) == vault1 ytoken.deposit(5000, {"from": rando.address}) @@ -94,6 +100,7 @@ def test_migrate(token, registry, create_vault, sign_vault_permit, ytoken, gov): vault2 = create_vault(version="2.0.0", token=token) registry.newRelease(vault2, {"from": gov}) + registry.endorseVault(vault2, {"from": gov}) assert registry.latestVault(token) == vault2 ytoken.deposit(5000, {"from": rando.address}) @@ -120,6 +127,7 @@ def test_migrate(token, registry, create_vault, sign_vault_permit, ytoken, gov): def test_yweth_wrapper(gov, rando, registry, create_vault, weth, yWETH): vault1 = create_vault(version="1.0.0", token=weth) registry.newRelease(vault1, {"from": gov}) + registry.endorseVault(vault1, {"from": gov}) assert registry.latestVault(weth) == vault1 yweth = yWETH.deploy(weth, registry, {"from": gov}) assert yweth.token() == weth @@ -131,6 +139,7 @@ def test_yweth_wrapper(gov, rando, registry, create_vault, weth, yWETH): vault2 = create_vault(version="2.0.0", token=weth) registry.newRelease(vault2, {"from": gov}) + registry.endorseVault(vault2, {"from": gov}) assert registry.latestVault(weth) == vault2 # Migrations work just fine diff --git a/tests/integration/test_wrapper.py b/tests/integration/test_wrapper.py index 6f2f3aeba..535f6ed50 100644 --- a/tests/integration/test_wrapper.py +++ b/tests/integration/test_wrapper.py @@ -42,6 +42,7 @@ def rule_new_release(self): print(f" Registry.newRelease({vault})") self.registry.newRelease(vault, {"from": self.gov}) + self.registry.endorseVault(vault, {"from": self.gov}) # NOTE: yToken's are non-custodial, so you need to authorize them if self.wrapper._name == "yToken": @@ -105,6 +106,7 @@ def test_migration_wrapper( # NOTE: Must start with at least one vault in registry (for token) vault = create_vault(token=token, version="1.0.0") registry.newRelease(vault, {"from": gov}) + registry.endorseVault(vault, {"from": gov}) # NOTE: yToken's are non-custodial, so you need to authorize them if wrapper._name == "yToken":