def testLatestAttrIsReceived(nodeSet, addedSponsor, sponsorWallet, looper, sponsor, userIdA): attr1 = json.dumps({'name': 'Mario'}) attrib = Attribute(name='name', origin=sponsorWallet.defaultId, value=attr1, dest=userIdA, ledgerStore=LedgerStore.RAW) addAttributeAndCheck(looper, sponsor, sponsorWallet, attrib) assert attr1 in [ a.value for a in sponsorWallet.getAttributesForNym(userIdA) ] attr2 = json.dumps({'name': 'Luigi'}) attrib = Attribute(name='name', origin=sponsorWallet.defaultId, value=attr2, dest=userIdA, ledgerStore=LedgerStore.RAW) addAttributeAndCheck(looper, sponsor, sponsorWallet, attrib) logger.debug([a.value for a in sponsorWallet.getAttributesForNym(userIdA)]) assert attr2 in [ a.value for a in sponsorWallet.getAttributesForNym(userIdA) ]
def addedRawAttribute(userWalletA: Wallet, sponsor: Client, sponsorWallet: Wallet, attributeData, looper): attrib = Attribute(name='test attribute', origin=sponsorWallet.defaultId, value=attributeData, dest=userWalletA.defaultId, ledgerStore=LedgerStore.RAW) addAttributeAndCheck(looper, sponsor, sponsorWallet, attrib) return attrib
def testUserAddAttrsForHerSelf(nodeSet, looper, userClientA, userWalletA, userIdA, attributeData): attr1 = json.dumps({'age': 25}) attrib = Attribute(name='test4 attribute', origin=userIdA, value=attr1, dest=userIdA, ledgerStore=LedgerStore.RAW) addAttributeAndCheck(looper, userClientA, userWalletA, attrib)
def createAgentAndAddEndpoint(looper, agentNym, agentVerkey, agentPort, steward, stewardWallet): createNym(looper, agentNym, steward, stewardWallet, role=SPONSOR, verkey=agentVerkey) ep = '127.0.0.1:{}'.format(agentPort) attributeData = json.dumps({ENDPOINT: ep}) # TODO Faber Agent should be doing this! attrib = Attribute(name='{}_endpoint'.format(agentNym), origin=stewardWallet.defaultId, value=attributeData, dest=agentNym, ledgerStore=LedgerStore.RAW) addAttributeAndCheck(looper, steward, stewardWallet, attrib) return attrib