Exemplo n.º 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
Exemplo n.º 2
0
def test_to_hex_cleanup_only(val, expected):
    assert Web3.toHex(hexstr=val) == expected
Exemplo n.º 3
0
def test_to_hex_text(val, expected):
    assert Web3.toHex(text=val) == expected
Exemplo n.º 4
0
def test_to_hex(val, expected):
    assert Web3.toHex(val) == expected