def test_edit_attrib(sdk_pool_handle, sdk_user_wallet_a, sdk_wallet_endorser,
                     attributeData, looper, attributeName):
    _, did_cl = sdk_user_wallet_a

    sdk_add_attribute_and_check(looper, sdk_pool_handle, sdk_wallet_endorser,
                                attributeData, did_cl)
    res1 = sdk_get_attribute_and_check(looper, sdk_pool_handle,
                                       sdk_wallet_endorser, did_cl,
                                       attributeName)
    assert serialize_msg_for_signing(json.loads(
        res1[0][1]['result']['data'])) == serialize_msg_for_signing(
            json.loads(attributeData.replace(' ', '')))

    data = json.loads(attributeData)
    data[attributeName] = {'John': 'Snow'}
    data = json.dumps(data)

    sdk_add_attribute_and_check(looper, sdk_pool_handle, sdk_wallet_endorser,
                                data, did_cl)
    res2 = sdk_get_attribute_and_check(looper, sdk_pool_handle,
                                       sdk_wallet_endorser, did_cl,
                                       attributeName)
    assert serialize_msg_for_signing(json.loads(
        res2[0][1]['result']['data'])) == serialize_msg_for_signing(
            json.loads(data.replace(' ', '')))
Example #2
0
def testTrustAnchorGetAttrsForUser(looper,
                                   sdk_user_wallet_a,
                                   sdk_wallet_trust_anchor,
                                   sdk_pool_handle,
                                   attributeName,
                                   sdk_added_raw_attribute):
    _, dest = sdk_user_wallet_a
    sdk_get_attribute_and_check(looper, sdk_pool_handle,
                                sdk_wallet_trust_anchor, dest, attributeName)
Example #3
0
def test_user_add_attrs_for_herself_and_get_it(
        looper,
        nodeSet,
        sdk_wallet_trustee,
        sdk_pool_handle):
    wallet_client = sdk_add_new_nym(looper, sdk_pool_handle, sdk_wallet_trustee, role=None)
    _, dest = wallet_client
    attr = json.dumps({'name': 'Albus'})
    sdk_add_attribute_and_check(looper, sdk_pool_handle,
                                wallet_client, attr, dest)
    sdk_get_attribute_and_check(looper, sdk_pool_handle,
                                wallet_client, dest, 'name')
def testLatestAttrIsReceived(looper, nodeSet, sdk_wallet_endorser,
                             sdk_pool_handle, sdk_user_wallet_a):
    _, dest = sdk_user_wallet_a

    attr1 = json.dumps({'name': 'Mario'})
    sdk_add_attribute_and_check(looper, sdk_pool_handle, sdk_wallet_endorser,
                                attr1, dest)
    reply = sdk_get_attribute_and_check(looper, sdk_pool_handle,
                                        sdk_wallet_endorser, dest, 'name')[0]
    reply_equality_of_get_attribute(reply, 'Mario')

    attr2 = json.dumps({'name': 'Luigi'})
    sdk_add_attribute_and_check(looper, sdk_pool_handle, sdk_wallet_endorser,
                                attr2, dest)
    reply = sdk_get_attribute_and_check(looper, sdk_pool_handle,
                                        sdk_wallet_endorser, dest, 'name')[0]
    reply_equality_of_get_attribute(reply, 'Luigi')
def test_send_get_attr_succeeds_for_existing_uuid_dest(looper, sdk_pool_handle,
                                                       sdk_wallet_trustee,
                                                       send_raw_attrib):
    wh, did = sdk_wallet_trustee
    sdk_get_attribute_and_check(looper, sdk_pool_handle, sdk_wallet_trustee,
                                did, attrib_name)
def testEndorserGetAttrsForUser(looper, sdk_user_wallet_a, sdk_wallet_endorser,
                                sdk_pool_handle, attributeName,
                                sdk_added_raw_attribute):
    _, dest = sdk_user_wallet_a
    sdk_get_attribute_and_check(looper, sdk_pool_handle, sdk_wallet_endorser,
                                dest, attributeName)