Skip to content

Commit

Permalink
INDY-2313: Update load script to support new TAA workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Khoroshavin <[email protected]>
  • Loading branch information
Sergey Khoroshavin committed Dec 24, 2019
1 parent 153386a commit 3f18fa3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ def test_recover_taa_from_ledger(txnPoolNodeSet,
# Step 3. Send TAA txn in old way
text = randomString(1024)
version_1 = randomString(16)

# TODO: INDY-2313 why is this failing even though we use old request handler?
sdk_send_txn_author_agreement(looper, sdk_pool_handle, sdk_wallet_trustee, version_1, text)

# Step 4. return original TAA handlers back
Expand Down
2 changes: 1 addition & 1 deletion scripts/performance/perf_load/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

__title__ = 'indy-perf-load'
__version_info__ = (1, 1, 5)
__version_info__ = (1, 2, 0)
__version__ = '.'.join(map(str, __version_info__))
__description__ = 'Indy node performance load'
__long_description__ = __description__
Expand Down
12 changes: 6 additions & 6 deletions scripts/performance/perf_load/perf_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,17 @@ async def _taa_init(self, text, version):
self._taa_time = current_time + 1 # We are "signing" just 1 second after TAA created
break

# Check whether we can reach desired TAA state at all
if text == "" and version == "" and current_text != "":
raise RuntimeError("Cannot remove TAA from ledger without explicitely setting new version")

# Check that we don't already have different TAA with same version
expected_text, expected_version, _ = await self._get_taa(version)
if expected_text != text and expected_version == version:
raise RuntimeError("Ledger already contains different TAA with same version ")

# Try to set taa
set_taa = await ledger.build_txn_author_agreement_request(self._test_did, text, version)
if text != "":
set_taa = await ledger.build_txn_author_agreement_request(self._test_did, text, version,
ratification_ts=42)
else:
set_taa = await ledger.build_disable_all_txn_author_agreements_request(self._test_did)
await ledger.sign_and_submit_request(self._pool_handle, self._wallet_handle, self._test_did, set_taa)

self._logger.info("_taa_init done")
Expand Down Expand Up @@ -246,7 +246,7 @@ async def _get_taa(self, version: Optional[str] = None) -> Tuple[Optional[str],
if result['data'] is None:
return "", "", None

return result['data']['text'], result['data']['version'], result['txnTime']
return result['data']['text'], result['data']['version'], result['data']['ratification_ts']

async def _pool_auth_rules_init(self):
if not self._set_auth_rule:
Expand Down

0 comments on commit 3f18fa3

Please sign in to comment.