Skip to content

Commit

Permalink
update e2e tests and fix dependency (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
bh2smith authored Oct 18, 2022
1 parent eb8175a commit f44162c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PROPOSER_PK=

# Slack Bot Credentials
SLACK_TOKEN=
SLACK_ALERT_CHANNEL=
SLACK_CHANNEL=

# Orderbook DB Credentials
PROD_ORDERBOOK_HOST=
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ black==22.6.0
certifi==2022.6.15
duneapi==6.0.0
mypy==0.961
psycopg2==2.9.3
psycopg2-binary==2.9.3
pylint==2.14.4
pytest==7.1.2
python-dotenv>=0.20.0
Expand Down
17 changes: 6 additions & 11 deletions tests/e2e/test_token_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@


class TestTokenDecimals(unittest.TestCase):
def setUp(self) -> None:
self.cow = "0xDEf1CA1fb7FBcDC777520aa7f396b4E015F497aB"
self.usdc = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"

def test_token_decimals(self):
self.assertEqual(get_token_decimals(self.cow), 18)
self.assertEqual(get_token_decimals(self.usdc), 6)

self.assertEqual(get_token_decimals(duneapi.types.Address(self.usdc)), 6)
self.assertEqual(get_token_decimals(duneapi.types.Address(self.cow)), 18)
# Goerli doesn't seem to have tokens with anything other than 18 decimals.
cow = "0x3430d04E42a722c5Ae52C5Bffbf1F230C2677600"
self.assertEqual(get_token_decimals(cow), 18)
self.assertEqual(get_token_decimals(duneapi.types.Address(cow)), 18)

def test_token_decimals_cache(self):
NEW_TOKEN = "0x10245515d35BC525e3C0977412322BFF32382EF1"
new_token = "0x10245515d35BC525e3C0977412322BFF32382EF1"
with self.assertLogs("src.utils.token_details", level="INFO"):
get_token_decimals(NEW_TOKEN)
get_token_decimals(new_token)

with self.assertNoLogs("src.utils.token_details", level="INFO"):
get_token_decimals(new_token)
Expand Down

0 comments on commit f44162c

Please sign in to comment.