Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Mar 18, 2024
1 parent 3309fb3 commit 5b7629f
Showing 1 changed file with 30 additions and 48 deletions.
78 changes: 30 additions & 48 deletions tests/unitary/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
"tests.fixtures.functions",
]


@pytest.fixture(scope="module")
def metaregistry(ng_owner):
return deploy_contract("MetaRegistry", sender=ng_owner)


@pytest.fixture(scope="module")
def base_pool_registry(ng_owner):
return deploy_contract(
Expand All @@ -39,70 +33,58 @@ def populated_base_pool_registry(base_pool_registry, ng_owner, base_pools):


@pytest.fixture(scope="module")
def stable_factory_handler(
populated_base_pool_registry, stableswap_ng_factory, owner
def stable_ng_factory_handler(
populated_base_pool_registry, stableswap_ng_factory, ng_owner
):
return deploy_contract(
"StableFactoryHandler",
with boa.env.prank(ng_owner):
return boa.load(
"contracts/mainnet/registry_handlers/ng/CurveStableSwapFactoryNGHandler.vy",
stableswap_ng_factory.address,
populated_base_pool_registry.address,
sender=owner,
directory="registry_handlers",
)


@pytest.fixture(scope="module")
def crypto_registry_handler(owner, crypto_registry):
return deploy_contract(
"CryptoRegistryHandler",
crypto_registry.address,
sender=owner,
directory="registry_handlers",
def twocrypto_ng_factory_handler(twocrypto_ng_factory, ng_owner):
with boa.env.prank(ng_owner):
return boa.load(
"contracts/mainnet/registry_handlers/ng/CurveTwocryptoFactoryHandler.vy",
twocrypto_ng_factory.address,
)


@pytest.fixture(scope="module")
def crypto_factory_handler(
populated_base_pool_registry, crypto_factory, owner
):
return deploy_contract(
"CryptoFactoryHandler",
crypto_factory.address,
populated_base_pool_registry.address,
sender=owner,
directory="registry_handlers",
def tricrypto_ng_factory_handler(tricrypto_ng_factory, ng_owner):
with boa.env.prank(ng_owner):
return boa.load(
"contracts/mainnet/registry_handlers/ng/CurveTricryptoFactoryHandler.vy",
tricrypto_ng_factory.address,
)


@pytest.fixture(scope="module")
def registries(
stable_registry, stable_factory, crypto_registry, crypto_factory
):
return [stable_registry, stable_factory, crypto_registry, crypto_factory]


@pytest.fixture(scope="module")
def handlers(
stable_registry_handler,
stable_factory_handler,
crypto_registry_handler,
crypto_factory_handler,
stable_ng_factory_handler, twocrypto_ng_factory_handler, tricrypto_ng_factory_handler
):
return [
stable_registry_handler,
stable_factory_handler,
crypto_registry_handler,
crypto_factory_handler,
stable_ng_factory_handler,
twocrypto_ng_factory_handler,
tricrypto_ng_factory_handler
]


@pytest.fixture(scope="module")
def populated_metaregistry(metaregistry, handlers, owner):
def registries(handlers):
registries = []
for handler in handlers:
metaregistry.add_registry_handler(handler.address, sender=owner)
return metaregistry
registries.append(handler.base_registry())
return registries


@pytest.fixture(scope="module")
def stable_registry_handler_index():
return 0
def metaregistry(handlers, ng_owner):

metaregistry_contract = deploy_contract("MetaRegistry", sender=ng_owner)
for handler in handlers:
metaregistry_contract.add_registry_handler(handler.address, sender=ng_owner)
return metaregistry_contract

0 comments on commit 5b7629f

Please sign in to comment.