def test_basic():
    zk = ZKProof(None)

    g = zk.get(ConstGen, "g")

    # Test: ok to call twice
    g2 = zk.get(ConstGen, "g")
    # return same object
    assert g == g2

    # Test: need to be of same type!
    with pytest.raises(Exception) as excinfo:
        zk.get(Pub, "g")
    assert "isinstance" in str(excinfo.value)


    h = zk.get(ConstGen, "h")
    Gone = zk.get(ConstGen, "d1")
    x = zk.get(Sec, "x")
    o = zk.get(Sec, "o")
    y = zk.get(Pub, "y")
    one = zk.get(ConstPub, "d1g")

    Cx = zk.get(Gen, "Cx")

    Cxp =  x*g + o*(y * h)

    zk.add_proof(Cx, Cxp)

    print(zk.Const.keys())
    print(zk.Pub.keys())
    print(zk.Sec.keys())
dataset/ETHPy150Open gdanezis/petlib/examples/genzkp.py/test_basic/original