Skip to content

Commit

Permalink
chore: fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrovalido committed Oct 6, 2024
1 parent 14a7663 commit f67efa0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def main():
os.getenv(f'VOTER_{chain_id}'),
{'from': account}
)

if 'registry' in contract_name:
FactoryRegistry.deploy(
account,
Expand Down
2 changes: 1 addition & 1 deletion tests/base/test_ve_sugar.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def VeNFTStruct(sugar_contract):


def test_initial_state(sugar_contract):
assert sugar_contract.voter() == os.getenv('VOTER_8453'))
assert sugar_contract.voter() == os.getenv('VOTER_8453')
assert sugar_contract.dist() == \
os.getenv('DIST_8453')
assert sugar_contract.ve() is not None
Expand Down
11 changes: 7 additions & 4 deletions tests/test_factory_registry.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
import os
import pytest

from brownie import accounts, FactoryRegistry, reverts
from web3.constants import ADDRESS_ZERO


@pytest.fixture
def factory_registry(FactoryRegistry, accounts):
# Deploy the contract using the first test account as the owner
yield FactoryRegistry.at(os.getenv('REGISTRY_34443'))


def test_initial_state(factory_registry):
assert factory_registry.owner() == "0xd42C7914cF8dc24a1075E29C283C581bd1b0d3D3"
assert factory_registry.owner() ==\
"0xd42C7914cF8dc24a1075E29C283C581bd1b0d3D3"


def test_approve(factory_registry, accounts):
owner = factory_registry.owner()
non_owner = "0x9999999999999999999999999999999999999999"
pool_factory = "0x1111111111111111111111111111111111111111"
pool_factory_count = factory_registry.pool_factory_count()

Expand All @@ -25,6 +26,7 @@ def test_approve(factory_registry, accounts):
assert factory_registry.poolFactories(0) == pool_factory
assert factory_registry.pool_factory_exists(pool_factory)


def test_unapprove(factory_registry, accounts):
owner = factory_registry.owner()
pool_factory = "0x1111111111111111111111111111111111111111"
Expand All @@ -40,7 +42,8 @@ def test_unapprove(factory_registry, accounts):
assert factory_registry.pool_factory_count() == pool_factory_count
assert not factory_registry.pool_factory_exists(pool_factory)


def test_factories_to_pool_factory(factory_registry):
pool_factory = "0x1111111111111111111111111111111111111111"
result = factory_registry.factoriesToPoolFactory(pool_factory)
assert result == ("0x0000000000000000000000000000000000000000", pool_factory)
assert result == [ADDRESS_ZERO, pool_factory]

0 comments on commit f67efa0

Please sign in to comment.