def clientFromSigner(signer, looper, nodeSet, tdir): wallet = Wallet(signer.identifier) wallet.addIdentifier(signer) s = genTestClient(nodeSet, tmpdir=tdir, identifier=signer.identifier) looper.add(s) looper.run(s.ensureConnectedToNodes()) return s
def nonSponsor(looper, nodeSet, tdir): sseed = b'this is a secret sponsor seed...' signer = SimpleSigner(seed=sseed) c, _ = genTestClient(nodeSet, tmpdir=tdir, usePoolLedger=True) w = Wallet(c.name) w.addIdentifier(signer=signer) c.registerObserver(w.handleIncomingReply) looper.add(c) looper.run(c.ensureConnectedToNodes()) return c, w
def testNonSponsoredNymCanDoGetNym(nodeSet, addedSponsor, sponsorWallet, tdir, looper): signer = SimpleSigner() someClient, _ = genTestClient(nodeSet, tmpdir=tdir, usePoolLedger=True) wallet = Wallet(someClient.name) wallet.addIdentifier(signer=signer) someClient.registerObserver(wallet.handleIncomingReply) looper.add(someClient) looper.run(someClient.ensureConnectedToNodes()) needle = sponsorWallet.defaultId makeGetNymRequest(someClient, wallet, needle) looper.run(eventually(someClient.hasNym, needle, retryWait=1, timeout=5))
def anotherSponsor(nodeSet, steward, stewardWallet, tdir, looper): sseed = b'this is 1 secret sponsor seed...' signer = SimpleSigner(seed=sseed) c, _ = genTestClient(nodeSet, tmpdir=tdir, usePoolLedger=True) w = Wallet(c.name) w.addIdentifier(signer=signer) c.registerObserver(w.handleIncomingReply) looper.add(c) looper.run(c.ensureConnectedToNodes()) createNym(looper, signer.identifier, steward, stewardWallet, role=SPONSOR, verkey=signer.verkey) return c, w
def addRole(looper, creatorClient, creatorWallet, name, useDid=True, addVerkey=True, role=None): wallet = Wallet(name) signer = DidSigner() if useDid else SimpleSigner() idr, _ = wallet.addIdentifier(signer=signer) verkey = wallet.getVerkey(idr) if addVerkey else None createNym(looper, idr, creatorClient, creatorWallet, verkey=verkey, role=role) return wallet
def testNewKeyChangesWalletsDefaultId(be, do, poolNodesStarted, aliceCLI, connectedToTest): mywallet = Wallet('my wallet') keyseed='a'*32 idr, _ = mywallet.addIdentifier(seed=keyseed.encode("utf-8")) be(aliceCLI) do('connect test', within=3, expect=connectedToTest) do('new key with seed {}'.format(keyseed)) do('send NYM dest={}'.format(idr)) do('new key with seed 11111111111111111111111111111111') do('send NYM dest={}'.format(idr), within=3, expect=["Nym {} added".format(idr)] )
def stewardWallet(poolTxnStewardData): name, sigseed = poolTxnStewardData wallet = Wallet('steward') signer = SimpleSigner(seed=sigseed) wallet.addIdentifier(signer=signer) return wallet
def sponsorWallet(): wallet = Wallet('sponsor') seed = b'sponsors are people too.........' wallet.addIdentifier(seed=seed) return wallet
def clientAndWallet1(client1Signer, looper, nodeSet, tdir, up): client, wallet = genTestClient(nodeSet, tmpdir=tdir, usePoolLedger=True) wallet = Wallet(client.name) wallet.addIdentifier(signer=client1Signer) return client, wallet
def _newWallet(name=None): signer = SimpleSigner() w = Wallet(name or signer.identifier) w.addIdentifier(signer=signer) return w
def buildAgentWallet(name, seed): wallet = Wallet(name) wallet.addIdentifier(signer=SimpleSigner(seed=seed)) return wallet
def _(name): wallet = Wallet(name) wallet.addIdentifier(signer=DidSigner()) return wallet
def trusteeWallet(trusteeData): name, sigseed = trusteeData wallet = Wallet('trustee') signer = SimpleSigner(seed=sigseed) wallet.addIdentifier(signer=signer) return wallet