forked from BowTiedDevil/degenbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoken_test.py
43 lines (33 loc) · 1.25 KB
/
token_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import pytest
import web3
from degenbot.token import Erc20Token
class MockErc20Token(Erc20Token):
def __init__(self):
pass
def test_erc20token_comparisons():
token0 = MockErc20Token()
token0.address = web3.Web3.toChecksumAddress(
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
)
token1 = MockErc20Token()
token1.address = web3.Web3.toChecksumAddress(
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
)
assert token0 == "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
assert token0 == "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2".lower()
assert token0 == web3.Web3.toChecksumAddress(
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
)
assert token0 != token1
assert token0 > token1
assert token0 > "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
assert token0 > "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599".lower()
assert token0 > web3.Web3.toChecksumAddress(
"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599"
)
assert token1 < token0
assert token1 < "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
assert token1 < "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2".lower()
assert token1 < web3.Web3.toChecksumAddress(
"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
)