Skip to content

Commit

Permalink
remove config, update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mshrieve committed Nov 15, 2023
1 parent 0a916c3 commit 5bf397a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 90 deletions.
42 changes: 0 additions & 42 deletions py_order_utils/config.py

This file was deleted.

22 changes: 0 additions & 22 deletions py_order_utils/model/contract_config.py

This file was deleted.

19 changes: 0 additions & 19 deletions tests/test_config.py

This file was deleted.

17 changes: 10 additions & 7 deletions tests/test_order_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from py_order_utils.builders import OrderBuilder
from py_order_utils.model.signatures import EOA
from py_order_utils.signer import Signer
from py_order_utils.config import get_contract_config
from py_order_utils.constants import ZERO_ADDRESS

# publicly known private key
Expand All @@ -14,7 +13,11 @@
maker_address = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
salt = 479249096354
chain_id = 80001
mumbai_contracts = get_contract_config(chain_id)
mumbai_contracts = {
"exchange": "0x4bFb41d5B3570DeFd03C39a9A4D8dE6Bd8B8982E",
"collateral": "0x2E8DCfE708D44ae2e406a1c02DFE2Fa13012f961",
"conditional": "0x7D8610E9567d2a6C9FBf66a5A13E9Ba8bb120d43",
}


def mock_salt_generator():
Expand All @@ -23,7 +26,7 @@ def mock_salt_generator():

class TestOrderBuilder(TestCase):
def test_validate_order(self):
builder = OrderBuilder(mumbai_contracts.exchange, chain_id, signer)
builder = OrderBuilder(mumbai_contracts["exchange"], chain_id, signer)

# Valid order
data = self.generate_data()
Expand All @@ -49,7 +52,7 @@ def test_validate_order(self):
self.assertFalse(builder._validate_inputs(data))

def test_build_order(self):
builder = OrderBuilder(mumbai_contracts.exchange, chain_id, signer)
builder = OrderBuilder(mumbai_contracts["exchange"], chain_id, signer)

invalid_data_input = self.generate_data()
invalid_data_input.tokenId = None
Expand Down Expand Up @@ -83,7 +86,7 @@ def test_build_order(self):

# specific salt
builder = OrderBuilder(
mumbai_contracts.exchange, chain_id, signer, mock_salt_generator
mumbai_contracts["exchange"], chain_id, signer, mock_salt_generator
)

_order = builder.build_order(self.generate_data())
Expand All @@ -105,7 +108,7 @@ def test_build_order(self):

def test_build_prder_signature(self):
builder = OrderBuilder(
mumbai_contracts.exchange, chain_id, signer, mock_salt_generator
mumbai_contracts["exchange"], chain_id, signer, mock_salt_generator
)

_order = builder.build_order(self.generate_data())
Expand All @@ -123,7 +126,7 @@ def test_build_prder_signature(self):

def test_build_signed_order(self):
builder = OrderBuilder(
mumbai_contracts.exchange, chain_id, signer, mock_salt_generator
mumbai_contracts["exchange"], chain_id, signer, mock_salt_generator
)

signed_order = builder.build_signed_order(self.generate_data())
Expand Down

0 comments on commit 5bf397a

Please sign in to comment.