Skip to content

Commit a25ad92

Browse files
committed
add a few more test cases
1 parent 3f10962 commit a25ad92

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

tests/core/utilities/test_abi_is_encodable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
('all-TLDs-valid-now.test', 'address', True),
3737
('ff', 'address', True), # this could theoretically be a top-level domain (TLD)
3838
('0xname.eth', 'address', True), # 0x in name is fine, if it is not a TLD
39+
('rejects_invalid_names.eth', 'address', False), # no underscore in domain names
3940
4041
# Special bytes<M> behavior
4142
('12', 'bytes2', True), # undersize OK
@@ -65,6 +66,7 @@
6566
(('1', 0), '(bytes,int128)', False),
6667
6768
(('dennisthepeasant.eth', 0), '(address,int128)', True),
69+
(('rejects_invalid_domains.eth', 0), '(address,int128)', False),
6870
6971
((b'anything', 0), '(string,int128)', True),
7072
((b'\x80', 0), '(string,int128)', False),

tests/ens/test_nameprep.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ def test_nameprep_basic_unicode(ens):
1919
assert ens.nameprep("√.com") == "√.com"
2020
assert ens.nameprep("ԛәлп.com") == "ԛәлп.com"
2121
assert ens.nameprep("test\u200btest.com") == "testtest.com"
22+
assert ens.nameprep("-test.com") == "-test.com"
23+
assert ens.nameprep("1test.com") == "1test.com"
24+
assert ens.nameprep("test.1com") == "test.1com"
2225

2326

2427
@pytest.mark.parametrize(
2528
'url', [
2629
('not=std3'),
27-
('not_std3.eth'),
30+
('not_std3.eth'), #underscores not allowed
2831
]
2932
)
3033
def test_nameprep_std3_rules(ens, url):

0 commit comments

Comments
 (0)