def clientFromSigner(signer, looper, nodeSet, tdir): wallet = Wallet(signer.identifier) wallet.addSigner(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) w = Wallet(c.name) w.addSigner(signer=signer) c.registerObserver(w.handleIncomingReply) looper.add(c) looper.run(c.ensureConnectedToNodes()) return c, w
def anotherSponsor(genned, steward, stewardWallet, tdir, looper): sseed = b'this is 1 secret sponsor seed...' signer = SimpleSigner(seed=sseed) c, _ = genTestClient(genned, tmpdir=tdir) w = Wallet(c.name) w.addSigner(signer=signer) c.registerObserver(w.handleIncomingReply) looper.add(c) looper.run(c.ensureConnectedToNodes()) createNym(looper, signer.verstr, steward, stewardWallet, SPONSOR) return c, w
def testNonSponsoredNymCanDoGetNym(genned, addedSponsor, sponsorWallet, tdir, looper): signer = SimpleSigner() someClient, _ = genTestClient(genned, tmpdir=tdir) wallet = Wallet(someClient.name) wallet.addSigner(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 stewardWallet(): wallet = Wallet('steward') seed = b'is a pit seed, or somepin else' wallet.addSigner(seed=seed) assert wallet.defaultId == 'LRtO/oin94hzKKCVG4GOG1eMuH7uVMJ3txDUHBX2BqY=' return wallet
def sponsorWallet(): wallet = Wallet('sponsor') seed = b'sponsors are people too.........' wallet.addSigner(seed=seed) return wallet
def clientAndWallet1(client1Signer, looper, nodeSet, tdir, up): client, wallet = genTestClient(nodeSet, tmpdir=tdir) wallet = Wallet(client.name) wallet.addSigner(signer=client1Signer) return client, wallet
def _newWallet(name=None): signer = SimpleSigner() w = Wallet(name or signer.identifier) w.addSigner(signer=signer) return w
def addUser(looper, creatorClient, creatorWallet, name): wallet = Wallet(name) wallet.addSigner() createNym(looper, wallet.defaultId, creatorClient, creatorWallet) return wallet