def testSendAttribSucceedsForExistingDidDest(be, do, poolNodesStarted,
                                             localTrusteeCli):

    seed = randomSeed()
    idr, verkey = createHalfKeyIdentifierAndAbbrevVerkey(seed=seed)

    userCli = localTrusteeCli
    addNym(be, do, userCli, idr=idr, verkey=verkey)
    newKey(be, do, userCli, seed=seed.decode())

    sendAttribParameters = {'dest': idr, 'raw': json.dumps({'name': 'Alice'})}

    be(userCli)
    do('send ATTRIB dest={dest} raw={raw}',
       mapper=sendAttribParameters,
       expect=ATTRIBUTE_ADDED,
       within=2)
def testSendAttribFailsForNotExistingCryptonymDest(be, do, poolNodesStarted,
                                                   localTrusteeCli):

    seed = randomSeed()
    cryptonym = createCryptonym(seed=seed)

    userCli = localTrusteeCli
    newKey(be, do, userCli, seed=seed.decode())

    sendAttribParameters = {
        'dest': cryptonym,
        'raw': json.dumps({'name': 'Alice'})
    }

    be(userCli)
    do('send ATTRIB dest={dest} raw={raw}',
       mapper=sendAttribParameters,
       expect=ERROR,
       within=2)
Esempio n. 3
0
def thriftCli(be, do, thriftCLI, newKeyringOut, thriftMap):
    be(thriftCLI)
    setPromptAndKeyring(do, "Thrift", newKeyringOut, thriftMap)
    newKey(be, do, thriftCLI, seed=thriftMap['seed'])

    return thriftCLI
Esempio n. 4
0
def acmeCli(be, do, acmeCLI, newKeyringOut, acmeMap):
    be(acmeCLI)
    setPromptAndKeyring(do, "Acme", newKeyringOut, acmeMap)
    newKey(be, do, acmeCLI, seed=acmeMap['seed'])

    return acmeCLI
Esempio n. 5
0
def faberCli(be, do, faberCLI, newKeyringOut, faberMap):
    be(faberCLI)
    setPromptAndKeyring(do, "Faber", newKeyringOut, faberMap)
    newKey(be, do, faberCLI, seed=faberMap['seed'])

    return faberCLI
Esempio n. 6
0
def thriftCli(be, do, thriftCLI, newKeyringOut, thriftMap):
    be(thriftCLI)
    setPromptAndKeyring(do, "Thrift", newKeyringOut, thriftMap)
    newKey(be, do, thriftCLI, seed=thriftMap['seed'])

    return thriftCLI
Esempio n. 7
0
def acmeCli(be, do, acmeCLI, newKeyringOut, acmeMap):
    be(acmeCLI)
    setPromptAndKeyring(do, "Acme", newKeyringOut, acmeMap)
    newKey(be, do, acmeCLI, seed=acmeMap['seed'])

    return acmeCLI
Esempio n. 8
0
def faberCli(be, do, faberCLI, newKeyringOut, faberMap):
    be(faberCLI)
    setPromptAndKeyring(do, "Faber", newKeyringOut, faberMap)
    newKey(be, do, faberCLI, seed=faberMap['seed'])

    return faberCLI