Skip to content

Commit

Permalink
Merge pull request #203 from andrewwhitehead/issue-rollup
Browse files Browse the repository at this point in the history
Fix message dispatch; clean up LGTM warnings
  • Loading branch information
swcurran authored Sep 27, 2019
2 parents 5db1d89 + 012d11a commit 5ca8754
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 125 deletions.
18 changes: 9 additions & 9 deletions aries_cloudagent/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,17 +383,17 @@ async def outbound_message_router(
self.logger.debug("Returned message to socket %s", sel_socket.socket_id)
return

try:
await self.prepare_outbound_message(message, context)
except MessagePrepareError:
self.logger.exception(
"Error preparing outbound message for transmission"
)
return

# deliver directly to endpoint
if message.endpoint:
try:
await self.prepare_outbound_message(message, context)
except MessagePrepareError:
self.logger.exception(
"Error preparing outbound message for transmission"
)
return

await self.outbound_transport_manager.send_message(message)
return

self.logger.warning("No endpoint or direct route for outbound message, dropped")
self.logger.error("No endpoint or direct route for outbound message, dropped")
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/agent_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def extract_decorators(self, data, **kwargs):
f"Message defines both field signature and value: {field_name}"
)
found_signatures[field_name] = field["sig"]
processed[field_name], _ts = field["sig"].decode()
processed[field_name], _ = field["sig"].decode() # _ = timestamp
for field_name in expect_fields:
if field_name not in found_signatures:
raise ValidationError(f"Expected field signature: {field_name}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from ..messages.connection_request import ConnectionRequest


class ConnectionRecord(BaseRecord):
class ConnectionRecord(BaseRecord): # lgtm[py/missing-equals]
"""Represents a single pairwise connection."""

class Meta:
Expand Down Expand Up @@ -125,7 +125,7 @@ def record_tags(self) -> dict:
"routing_state",
"accept",
"invitation_mode",
"alias"
"alias",
)
}

Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/credentials/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ async def issue_credential(self, credential_exchange_record: CredentialExchange)
issuer: BaseIssuer = await self.context.inject(BaseIssuer)
(
credential_exchange_record.credential,
credential_revocation_id,
_, # credential_revocation_id
) = await issuer.create_credential(
schema, credential_offer, credential_request, credential_values
)
Expand Down
1 change: 0 additions & 1 deletion aries_cloudagent/messaging/credentials/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ async def credential_exchange_remove(request: web.BaseRequest):
context = request.app["request_context"]
credential_exchange_id = request.match_info["id"]
try:
credential_exchange_id = request.match_info["id"]
credential_exchange_record = await CredentialExchange.retrieve_by_id(
context, credential_exchange_id
)
Expand Down
Loading

0 comments on commit 5ca8754

Please sign in to comment.