File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,11 @@ async def ledger_config(
158158 if taa_info ["taa_required" ] and public_did :
159159 LOGGER .debug ("TAA acceptance required" )
160160 taa_accepted = await ledger .get_latest_txn_author_acceptance ()
161- digest_match = taa_info ["taa_record" ]["digest" ] == taa_accepted ["digest" ]
161+
162+ taa_record_digest = taa_info ["taa_record" ]["digest" ] # keys exist
163+ taa_accepted_digest = taa_accepted .get ("digest" ) # key might not exist
164+
165+ digest_match = taa_record_digest == taa_accepted_digest
162166 if not taa_accepted or not digest_match :
163167 LOGGER .info ("TAA acceptance needed - performing acceptance" )
164168 if not await accept_taa (ledger , profile , taa_info , provision ):
Original file line number Diff line number Diff line change @@ -179,11 +179,11 @@ async def get_wallet_public_did(self) -> DIDInfo:
179179 """Fetch the public DID from the wallet."""
180180
181181 @abstractmethod
182- async def get_txn_author_agreement (self , reload : bool = False ):
182+ async def get_txn_author_agreement (self , reload : bool = False ) -> dict :
183183 """Get the current transaction author agreement, fetching it if necessary."""
184184
185185 @abstractmethod
186- async def fetch_txn_author_agreement (self ):
186+ async def fetch_txn_author_agreement (self ) -> dict :
187187 """Fetch the current AML and TAA from the ledger."""
188188
189189 @abstractmethod
@@ -193,7 +193,7 @@ async def accept_txn_author_agreement(
193193 """Save a new record recording the acceptance of the TAA."""
194194
195195 @abstractmethod
196- async def get_latest_txn_author_acceptance (self ):
196+ async def get_latest_txn_author_acceptance (self ) -> dict :
197197 """Look up the latest TAA acceptance."""
198198
199199 def taa_digest (self , version : str , text : str ):
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def __init__(
101101 self .genesis_hash_cache : Optional [str ] = None
102102 self .genesis_txns_cache = genesis_transactions
103103 self .init_config = bool (genesis_transactions )
104- self .taa_cache : Optional [str ] = None
104+ self .taa_cache : Optional [dict ] = None
105105 self .read_only : bool = read_only
106106 self .socks_proxy : str = socks_proxy
107107
You can’t perform that action at this time.
0 commit comments