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
def test_to_hex_cleanup_only(val, expected): assert Web3.toHex(hexstr=val) == expected
def test_to_hex_text(val, expected): assert Web3.toHex(text=val) == expected
def test_to_hex(val, expected): assert Web3.toHex(val) == expected