Exemple #1
0
def test_labelhash(ens, label, expected_hash):
    if isinstance(expected_hash, type):
        with pytest.raises(expected_hash):
            ens.labelhash(label)
    else:
        labelhash = ens.labelhash(label)
        assert isinstance(labelhash, bytes)
        hash_hex = Web3.toHex(labelhash)
        assert hash_hex == expected_hash
Exemple #2
0
def test_to_hex_cleanup_only(val, expected):
    assert Web3.toHex(hexstr=val) == expected
Exemple #3
0
def test_to_hex_text(val, expected):
    assert Web3.toHex(text=val) == expected
Exemple #4
0
def test_to_hex(val, expected):
    assert Web3.toHex(val) == expected