Repository: hyperledger/aries-cloudagent-python

Issue:
Accumulator synchronization not working in ACA-Py v0.10.1  
After upgrading to ACA-Py `0.10.1` calls to `/revocation/registry/{rev_reg_id}/fix-revocation-entry-state`, even with `apply_ledger_update=false` fail with the following error.  The same calls were working with `1.0.0-rc0`; the version that initialy contained the accumulator synchronization code.

```
2023-09-07 16:01:09,270 aries_cloudagent.indy.sdk.profile WARNING Indy wallet type is deprecated, use Askar instead; see: https://aca-py.org/main/deploying/IndySDKtoAskarMigration/
2023-09-07 16:01:11,892 indy.libindy WARNING _indy_loop_callback: Function returned error 

::::::::::::::::::::::::::::::::::::::::::::::
::   The Law Society of British Columbia    ::
::                  (TEST)                  ::
::                                          ::
::                                          ::
:: Inbound Transports:                      ::
::                                          ::
::   - http://0.0.0.0:8021                  ::
::                                          ::
:: Outbound Transports:                     ::
::                                          ::
::   - http                                 ::
::   - https                                ::
::                                          ::
:: Public DID Information:                  ::
::                                          ::
::   - DID: AuJrigKQGRLJajKAebTgWu          ::
::                                          ::
:: Administration API:                      ::
::                                          ::
::   - http://0.0.0.0:8024                  ::
::                                          ::
::                              ver: 0.10.1 ::
::::::::::::::::::::::::::::::::::::::::::::::

Listening...

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::                             âš  DEPRECATION NOTICE: âš                               ::
:: -------------------------------------------------------------------------------- ::
:: The Indy wallet type is deprecated, use Askar instead; see: https://aca-         ::
:: py.org/main/deploying/IndySDKtoAskarMigration/                                   ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

2023-09-07 16:01:15,200 aries_cloudagent.core.conductor WARNING Wallet version storage record not found.
2023-09-07 16:01:15,201 aries_cloudagent.core.conductor WARNING No upgrade from version was found from wallet or via --from-version startup argument. Defaulting to v0.7.5.
2023-09-07 16:01:19,513 indy.libindy WARNING _indy_loop_callback: Function returned error 
2023-09-07 16:02:19,903 aries_cloudagent.core.dispatcher ERROR Handler error: update_rev_reg_revoked_state
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 256, in __step
    result = coro.send(None)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/revocation/routes.py", line 904, in update_rev_reg_revoked_state
    pool = write_ledger[1].pool
TypeError: 'IndySdkLedger' object is not subscriptable
2023-09-07 16:02:19,904 aries_cloudagent.admin.server ERROR Handler error with exception: 'IndySdkLedger' object is not subscriptable

=================
Traceback (most recent call last):
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 181, in ready_middleware
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 218, in debug_middleware
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aiohttp_apispec/middlewares.py", line 45, in validation_middleware
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 338, in check_token
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 450, in setup_context
    return await task
  File "/usr/local/lib/python3.9/asyncio/futures.py", line 284, in __await__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
    future.result()
  File "/usr/local/lib/python3.9/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 256, in __step
    result = coro.send(None)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/revocation/routes.py", line 904, in update_rev_reg_revoked_state
    pool = write_ledger[1].pool
TypeError: 'IndySdkLedger' object is not subscriptable
2023-09-07 16:02:19,904 aiohttp.server ERROR Error handling request
Traceback (most recent call last):
  File "/home/indy/.local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 181, in ready_middleware
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 218, in debug_middleware
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aiohttp_apispec/middlewares.py", line 45, in validation_middleware
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 338, in check_token
    return await handler(request)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/admin/server.py", line 450, in setup_context
    return await task
  File "/usr/local/lib/python3.9/asyncio/futures.py", line 284, in __await__
    yield self  # This tells Task to wait for completion.
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 328, in __wakeup
    future.result()
  File "/usr/local/lib/python3.9/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/usr/local/lib/python3.9/asyncio/tasks.py", line 256, in __step
    result = coro.send(None)
  File "/home/indy/.local/lib/python3.9/site-packages/aries_cloudagent/revocation/routes.py", line 904, in update_rev_reg_revoked_state
    pool = write_ledger[1].pool
TypeError: 'IndySdkLedger' object is not subscriptable
```


Discussion:
A version of the log with debug logging enabled:

[ACAPy-debug.log](https://github.com/hyperledger/aries-cloudagent-python/files/12551410/ACAPy-debug.log)

This is a bug introduced with my PR on selectable write ledger.
Fix will involve removing `[1]` from:
- https://github.com/hyperledger/aries-cloudagent-python/blob/56cd983e4b1d846c62e4890f01822671fdbfa33c/aries_cloudagent/revocation/routes.py#L891
- https://github.com/hyperledger/aries-cloudagent-python/blob/56cd983e4b1d846c62e4890f01822671fdbfa33c/aries_cloudagent/tails/indy_tails_server.py#L50
move to ready to go colm

Resolving patch:
diff --git a/aries_cloudagent/revocation/routes.py b/aries_cloudagent/revocation/routes.py
--- a/aries_cloudagent/revocation/routes.py
+++ b/aries_cloudagent/revocation/routes.py
@@ -888,7 +888,7 @@ async def update_rev_reg_revoked_state(request: web.BaseRequest):
             available_write_ledgers = await ledger_manager.get_write_ledgers()
             LOGGER.debug(f"available write_ledgers = {available_write_ledgers}")
             LOGGER.debug(f"write_ledger = {write_ledger}")
-            pool = write_ledger[1].pool
+            pool = write_ledger.pool
             LOGGER.debug(f"write_ledger pool = {pool}")
 
             genesis_transactions = pool.genesis_txns
diff --git a/aries_cloudagent/tails/indy_tails_server.py b/aries_cloudagent/tails/indy_tails_server.py
--- a/aries_cloudagent/tails/indy_tails_server.py
+++ b/aries_cloudagent/tails/indy_tails_server.py
@@ -47,7 +47,7 @@ async def upload_tails_file(
             available_write_ledgers = await ledger_manager.get_write_ledgers()
             LOGGER.debug(f"available write_ledgers = {available_write_ledgers}")
             LOGGER.debug(f"write_ledger = {write_ledger}")
-            pool = write_ledger[1].pool
+            pool = write_ledger.pool
             LOGGER.debug(f"write_ledger pool = {pool}")
 
             genesis_transactions = pool.genesis_txns


Test patch: