示例#1
0
    async def run_test(self, genesis_path, seed, w_key):
        try:
            pool_cfg = json.dumps({"genesis_txn": genesis_path})

            # TODO: remove after latest changes committed
            await self.pool_protocol_version()

            await self.pool_create_config(self._pool_name, pool_cfg)
            self._pool_handle = await self.pool_open_pool(
                self._pool_name, self._pool_config)
            self._wallet_name = "{}_wallet".format(self._pool_name)
            wallet_credential = json.dumps({"key": w_key})
            wallet_config = json.dumps({"id": self._wallet_name})
            await self.wallet_create_wallet(wallet_config, wallet_credential)
            self._wallet_handle = await self.wallet_open_wallet(
                wallet_config, wallet_credential)
            self._test_did, self._test_verk = await self.did_create_my_did(
                self._wallet_handle, json.dumps({'seed': seed}))
            await self._req_generator.on_pool_create(
                self._pool_handle,
                self._wallet_handle,
                self._test_did,
                max_cred_num=self._batch_size)
        except Exception as ex:
            self.msg("{} run_test error {}", self._name, ex)
            self._loop.stop()
            return

        await self.pregen_reqs()

        try:
            self._pipe_conn.send(ClientReady())
        except Exception as e:
            print("{} Ready send error {}".format(self._name, e))
            raise e
示例#2
0
    async def run_test(self, genesis_path, seed, w_key, taa_text, taa_version):
        self._logger.info("run_test genesis_path {}, seed {}, w_key {}".format(genesis_path, seed, w_key))
        try:
            await self._pre_init()

            await self._init_pool(genesis_path)
            await self._wallet_init(w_key)
            # TODO: This needs serious refactoring
            await self._did_init(seed, taa_text, taa_version)

            await self._post_init()

            self._logger.info("call _req_generator.on_pool_create")
            await self._req_generator.on_pool_create(self._pool_handle, self._wallet_handle, self._test_did,
                                                     self.ledger_sign_req, self.ledger_submit,
                                                     **self._on_pool_create_ext_params())
        except Exception as ex:
            self._logger.exception("run_test error {} stopping...".format(ex))
            self._loop.stop()
            return

        self._logger.info("call pregen_reqs")
        await self.pregen_reqs()

        self._logger.info("send ClientReady")
        try:
            self._pipe_conn.send(ClientReady())
        except Exception as e:
            self._logger.exception("Ready send error {}".format(e))
            raise e
示例#3
0
    async def run_test(self, genesis_path, seed, w_key):
        try:
            await self._pre_init()

            await self._init_pool(genesis_path)
            await self._wallet_init(w_key)
            await self._did_init(seed)

            await self._post_init()

            await self._req_generator.on_pool_create(self._pool_handle, self._wallet_handle, self._test_did,
                                                     self.ledger_sign_req, self.ledger_submit,
                                                     **self._on_pool_create_ext_params())
        except Exception as ex:
            self.msg("{} run_test error {}", self._name, ex)
            self._loop.stop()
            return

        await self.pregen_reqs()

        try:
            self._pipe_conn.send(ClientReady())
        except Exception as e:
            print("{} Ready send error {}".format(self._name, e))
            raise e