TerminusTestCase now also deploys Moonstream token

pull/9/head
Neeraj Kashyap 2021-12-19 04:26:35 -08:00
rodzic aeb80d7857
commit 44aa774e5c
3 zmienionych plików z 13 dodań i 11 usunięć

Wyświetl plik

@ -9,7 +9,7 @@ from . import TerminusFacet
from . import TerminusInitializer
class MoonstreamDAOTestCase(unittest.TestCase):
class MoonstreamDAOSingleContractTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
try:
@ -19,7 +19,7 @@ class MoonstreamDAOTestCase(unittest.TestCase):
cls.contracts = gogogo(accounts[0], {"from": accounts[0]})
class MoonstreamTokenTestCase(MoonstreamDAOTestCase):
class MoonstreamTokenTestCase(MoonstreamDAOSingleContractTestCase):
@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
@ -45,11 +45,13 @@ class MoonstreamTokenTestCase(MoonstreamDAOTestCase):
cls.erc20_facet = erc20_facet.address
class TerminusTestCase(MoonstreamDAOTestCase):
class TerminusTestCase(MoonstreamDAOSingleContractTestCase):
@classmethod
def setUpClass(cls) -> None:
super().setUpClass()
cls.terminus_contracts = gogogo(accounts[0], {"from": accounts[0]})
# Deploy Terminus
initializer = TerminusInitializer.TerminusInitializer(None)
initializer.deploy({"from": accounts[0]})
@ -57,7 +59,7 @@ class TerminusTestCase(MoonstreamDAOTestCase):
terminus_facet = TerminusFacet.TerminusFacet(None)
terminus_facet.deploy({"from": accounts[0]})
diamond_address = cls.contracts["Diamond"]
diamond_address = cls.terminus_contracts["Diamond"]
facet_cut(
diamond_address,
"TerminusFacet",
@ -71,7 +73,7 @@ class TerminusTestCase(MoonstreamDAOTestCase):
cls.terminus_facet = terminus_facet.address
class TestCoreDeployment(MoonstreamDAOTestCase):
class TestCoreDeployment(MoonstreamDAOSingleContractTestCase):
def test_gogogo(self):
self.assertIn("DiamondCutFacet", self.contracts)
self.assertIn("Diamond", self.contracts)

Wyświetl plik

@ -5,10 +5,10 @@ import brownie
from . import ERC20Facet, ERC20Initializer
from .core import ZERO_ADDRESS, facet_cut
from .test_core import MoonstreamDAOTestCase, MoonstreamTokenTestCase
from .test_core import MoonstreamDAOSingleContractTestCase, MoonstreamTokenTestCase
class TestDeployment(MoonstreamDAOTestCase):
class TestDeployment(MoonstreamDAOSingleContractTestCase):
def test_add_and_replace(self):
initializer = ERC20Initializer.ERC20Initializer(None)
initializer.deploy({"from": accounts[0]})
@ -72,7 +72,7 @@ class TestDeployment(MoonstreamDAOTestCase):
self.assertEqual(symbol, expected_symbol)
class TestRemoveFacet(MoonstreamDAOTestCase):
class TestRemoveFacet(MoonstreamDAOSingleContractTestCase):
def test_remove_facet(self):
initializer = ERC20Initializer.ERC20Initializer(None)
initializer.deploy({"from": accounts[0]})

Wyświetl plik

@ -4,10 +4,10 @@ from brownie import accounts
from . import TerminusFacet, TerminusInitializer
from .core import facet_cut
from .test_core import MoonstreamDAOTestCase, TerminusTestCase
from .test_core import MoonstreamDAOSingleContractTestCase, TerminusTestCase
class TestDeployment(MoonstreamDAOTestCase):
class TestDeployment(MoonstreamDAOSingleContractTestCase):
def test_add_and_replace(self):
initializer = TerminusInitializer.TerminusInitializer(None)
initializer.deploy({"from": accounts[0]})
@ -33,7 +33,7 @@ class TestDeployment(MoonstreamDAOTestCase):
class TestPoolCreation(TerminusTestCase):
def test_create_pool(self):
diamond_address = self.contracts["Diamond"]
diamond_address = self.terminus_contracts["Diamond"]
diamond_terminus = TerminusFacet.TerminusFacet(diamond_address)
initial_total_pools = diamond_terminus.total_pools()