Skip to content

Commit

Permalink
🎨 fix typos
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <ff137@proton.me>
  • Loading branch information
ff137 committed Apr 17, 2024
1 parent 53cdedd commit cbc90ff
Show file tree
Hide file tree
Showing 61 changed files with 166 additions and 145 deletions.
6 changes: 3 additions & 3 deletions aries_cloudagent/anoncreds/default/legacy_indy/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ async def get_schema(self, profile: Profile, schema_id: str) -> GetSchemaResult:
{"ledger_id": ledger_id},
)

anonscreds_schema = AnonCredsSchema(
anoncreds_schema = AnonCredsSchema(
issuer_id=schema["id"].split(":")[0],
attr_names=schema["attrNames"],
name=schema["name"],
version=schema["version"],
)
result = GetSchemaResult(
schema=anonscreds_schema,
schema=anoncreds_schema,
schema_id=schema["id"],
resolution_metadata={"ledger_id": ledger_id},
schema_metadata={"seqNo": schema["seqNo"]},
Expand Down Expand Up @@ -1084,7 +1084,7 @@ async def fix_ledger_entry(
'>>> rev_reg_delta.get("value"): %s', rev_reg_delta.get("value")
)

# if we had any revocation discrepencies, check the accumulator value
# if we had any revocation discrepancies, check the accumulator value
if rec_count > 0:
if (rev_list.current_accumulator and rev_reg_delta.get("value")) and (
rev_list.current_accumulator != rev_reg_delta["value"]["accum"]
Expand Down
4 changes: 2 additions & 2 deletions aries_cloudagent/anoncreds/revocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,9 +1381,9 @@ async def clear_pending_revocations(
)

async def set_tails_file_public_uri(self, rev_reg_id, tails_public_uri):
"""Update Revocation Registy tails file public uri."""
"""Update Revocation Registry tails file public uri."""
pass

async def set_rev_reg_state(self, rev_reg_id, state):
"""Update Revocation Registy state."""
"""Update Revocation Registry state."""
pass
2 changes: 1 addition & 1 deletion aries_cloudagent/commands/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ async def update_existing_records(profile: Profile):

##########################################################
# Fix for ACA-Py Issue #2485
# issuance_type attribue in IssuerRevRegRecord was removed
# issuance_type attribute in IssuerRevRegRecord was removed
# in 0.5.3 version. IssuerRevRegRecord created previously
# will need
##########################################################
Expand Down
4 changes: 2 additions & 2 deletions aries_cloudagent/core/conductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,12 @@ async def start(self) -> None:
except Exception:
LOGGER.exception("Error accepting mediation invitation")

# notify protcols of startup status
# notify protocols of startup status
await self.root_profile.notify(STARTUP_EVENT_TOPIC, {})

async def stop(self, timeout=1.0):
"""Stop the agent."""
# notify protcols that we are shutting down
# notify protocols that we are shutting down
if self.root_profile:
await self.root_profile.notify(SHUTDOWN_EVENT_TOPIC, {})

Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/core/plugin_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ async def init_context(self, context: InjectionContext):
else:
await self.load_protocols(context, plugin)

# register event handlers for each protocol, if providedf
# register event handlers for each protocol, if provided
self.register_protocol_events(context)

async def load_protocol_version(
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/did/did_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def from_fingerprint(cls, fingerprint: str, key_types=None) -> "DIDKey":
def from_did(cls, did: str) -> "DIDKey":
"""Initialize a new DIDKey instance from a fully qualified did:key string.
Extracts the fingerprint from the did:key and uses that to constrcut the did:key.
Extracts the fingerprint from the did:key and uses that to construct the did:key.
"""
did_parts = did.split("#")
_, fingerprint = did_parts[0].split("did:key:")
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/ledger/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async def _construct_attr_json(
"""Create attr_json string.
Args:
all_exist_endpoings: Dictionary of all existing endpoints
all_exist_endpoints: Dictionary of all existing endpoints
endpoint: The endpoint address
endpoint_type: The type of the endpoint
routing_keys: List of routing_keys if mediator is present
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/agent_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def assign_trace_decorator(self, context, trace):
"""Copy trace from a json structure.
Args:
trace: string containing trace json stucture
trace: string containing trace json structure
"""
if trace:
self.add_trace_decorator(
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/decorators/attach_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class Meta:

@pre_load
def validate_single_xor_multi_sig(self, data: Mapping, **kwargs):
"""Ensure model is for either 1 or many sigatures, not mishmash of both."""
"""Ensure model is for either 1 or many signatures, not mishmash of both."""

if "signatures" in data:
if any(k in data for k in ("header", "protected", "signature")):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestTraceDecorator(TestCase):
timestamp = "123456789.123456"
str_time = "2018-03-27 18:23:45.123Z"
handler = "agent name"
ellapsed_milli = 27
elapsed_milli = 27
outcome = "OK ..."

def test_init_api(self):
Expand All @@ -36,7 +36,7 @@ def test_init_message(self):
timestamp=self.timestamp,
str_time=self.str_time,
handler=self.handler,
ellapsed_milli=self.ellapsed_milli,
elapsed_milli=self.elapsed_milli,
outcome=self.outcome,
)

Expand All @@ -57,7 +57,7 @@ def test_init_message(self):
assert trace_report.timestamp == self.timestamp
assert trace_report.str_time == self.str_time
assert trace_report.handler == self.handler
assert trace_report.ellapsed_milli == self.ellapsed_milli
assert trace_report.elapsed_milli == self.elapsed_milli
assert trace_report.outcome == self.outcome

def test_serialize_load(self):
Expand All @@ -70,7 +70,7 @@ def test_serialize_load(self):
timestamp=self.timestamp,
str_time=self.str_time,
handler=self.handler,
ellapsed_milli=self.ellapsed_milli,
elapsed_milli=self.elapsed_milli,
outcome=self.outcome,
)

Expand All @@ -96,7 +96,7 @@ def test_serialize_load(self):
assert trace_report.timestamp == x_trace_report.timestamp
assert trace_report.str_time == x_trace_report.str_time
assert trace_report.handler == x_trace_report.handler
assert trace_report.ellapsed_milli == x_trace_report.ellapsed_milli
assert trace_report.elapsed_milli == x_trace_report.elapsed_milli
assert trace_report.outcome == x_trace_report.outcome

def test_trace_reports(self):
Expand All @@ -115,7 +115,7 @@ def test_trace_reports(self):
timestamp=self.timestamp,
str_time=self.str_time,
handler=self.handler,
ellapsed_milli=self.ellapsed_milli,
elapsed_milli=self.elapsed_milli,
outcome=self.outcome,
)
decorator.append_trace_report(x_trace_report)
Expand All @@ -130,7 +130,7 @@ def test_trace_reports(self):
timestamp=self.timestamp,
str_time=self.str_time,
handler=self.handler,
ellapsed_milli=self.ellapsed_milli,
elapsed_milli=self.elapsed_milli,
outcome=self.outcome,
)
decorator.append_trace_report(y_trace_report)
Expand All @@ -148,7 +148,7 @@ def test_trace_reports(self):
timestamp=self.timestamp,
str_time=self.str_time,
handler=self.handler,
ellapsed_milli=self.ellapsed_milli,
elapsed_milli=self.elapsed_milli,
outcome=self.outcome,
)
decorator.append_trace_report(z_trace_report)
Expand Down
16 changes: 8 additions & 8 deletions aries_cloudagent/messaging/decorators/trace_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(
timestamp: str = None,
str_time: str = None,
handler: str = None,
ellapsed_milli: int = None,
elapsed_milli: int = None,
outcome: str = None,
):
"""Initialize a TraceReport instance.
Expand All @@ -44,7 +44,7 @@ def __init__(
timestamp: ...
str_time: ...
handler: ...
ellapsed_milli: ...
elapsed_milli: ...
outcome: ...
"""
super().__init__()
Expand All @@ -54,7 +54,7 @@ def __init__(
self._timestamp = timestamp
self._str_time = str_time
self._handler = handler
self._ellapsed_milli = ellapsed_milli
self._elapsed_milli = elapsed_milli
self._outcome = outcome

@property
Expand Down Expand Up @@ -118,14 +118,14 @@ def handler(self):
return self._handler

@property
def ellapsed_milli(self):
"""Accessor for ellapsed_milli.
def elapsed_milli(self):
"""Accessor for elapsed_milli.
Returns:
The sender ellapsed_milli
The sender elapsed_milli
"""
return self._ellapsed_milli
return self._elapsed_milli

@property
def outcome(self):
Expand Down Expand Up @@ -260,7 +260,7 @@ class Meta:
"example": "TODO",
},
)
ellapsed_milli = fields.Int(
elapsed_milli = fields.Int(
required=False,
allow_none=True,
metadata={
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/messaging/jsonld/credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def verify_jws_header(header):


async def jws_verify(session, verify_data, signature, public_key):
"""Detatched jws verify handling."""
"""Detached jws verify handling."""

encoded_header, _, encoded_signature = signature.partition("..")
decoded_header = json.loads(b64decode(encoded_header))
Expand Down
8 changes: 4 additions & 4 deletions aries_cloudagent/messaging/tests/test_agent_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ async def test_add_tracing(self):
timestamp="123456789.123456",
str_time="2019-01-01 12:34:56.7",
handler="function.START",
ellapsed_milli=27,
elapsed_milli=27,
outcome="OK! ...",
)
msg.add_trace_report(trace_report)
Expand All @@ -154,7 +154,7 @@ async def test_add_tracing(self):
assert msg_trace_report.msg_id == msg._id
assert msg_trace_report.thread_id == msg._thread_id
assert msg_trace_report.handler == trace_report.handler
assert msg_trace_report.ellapsed_milli == trace_report.ellapsed_milli
assert msg_trace_report.elapsed_milli == trace_report.elapsed_milli
assert msg_trace_report.traced_type == msg._type
assert msg_trace_report.outcome == trace_report.outcome

Expand All @@ -172,7 +172,7 @@ async def test_add_tracing(self):
timestamp="123456789.123456",
str_time="2019-01-01 12:34:56.7",
handler="function.END",
ellapsed_milli=72,
elapsed_milli=72,
outcome="A OK! ...",
)
msg2.add_trace_report(trace_report2)
Expand All @@ -183,7 +183,7 @@ async def test_add_tracing(self):
assert msg_trace_report.msg_id == msg2._id
assert msg_trace_report.thread_id == msg2._thread_id
assert msg_trace_report.handler == trace_report2.handler
assert msg_trace_report.ellapsed_milli == trace_report2.ellapsed_milli
assert msg_trace_report.elapsed_milli == trace_report2.elapsed_milli
assert msg_trace_report.traced_type == msg2._type
assert msg_trace_report.outcome == trace_report2.outcome

Expand Down
8 changes: 4 additions & 4 deletions aries_cloudagent/messaging/valid.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,8 @@ def __call__(self, value):
class PresentationType(Validator):
"""Presentation Type."""

PRESENTATIONL_TYPE = "VerifiablePresentation"
EXAMPLE = [PRESENTATIONL_TYPE]
PRESENTATION_TYPE = "VerifiablePresentation"
EXAMPLE = [PRESENTATION_TYPE]

def __init__(self) -> None:
"""Initialize the instance."""
Expand All @@ -789,9 +789,9 @@ def __init__(self) -> None:
def __call__(self, value):
"""Validate input value."""
length = len(value)
if length < 1 or PresentationType.PRESENTATIONL_TYPE not in value:
if length < 1 or PresentationType.PRESENTATION_TYPE not in value:
raise ValidationError(
f"type must include {PresentationType.PRESENTATIONL_TYPE}"
f"type must include {PresentationType.PRESENTATION_TYPE}"
)

return value
Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/multitenant/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def put(self, key: str, value: Profile) -> None:
LOGGER.debug(f"Setting profile with id {key} in profile cache")
self._cache[key] = value

# Refresh profile livliness
# Refresh profile liveliness
self._cache.move_to_end(key)
self._cleanup()

Expand Down
2 changes: 1 addition & 1 deletion aries_cloudagent/protocols/connections/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ async def create_response(

# TODO It's possible the mediation request sent here might arrive
# before the connection response. This would result in an error condition
# difficult to accomodate for without modifying handlers for trust ping
# difficult to accommodate for without modifying handlers for trust ping
# to ensure the connection is active.
async with self.profile.session() as session:
send_mediation_request = await connection.metadata_get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class RouteManagerError(Exception):


class RoutingInfo(NamedTuple):
"""Routing info tuple contiaing routing keys and endpoint."""
"""Routing info tuple containing routing keys and endpoint."""

routing_keys: Optional[List[str]]
endpoint: Optional[str]
Expand All @@ -50,7 +50,7 @@ class RouteManager(ABC):
async def get_or_create_my_did(
self, profile: Profile, conn_record: ConnRecord
) -> DIDInfo:
"""Create or retrieve DID info for a conneciton."""
"""Create or retrieve DID info for a connection."""
if not conn_record.my_did:
async with profile.session() as session:
wallet = session.inject(BaseWallet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class RouteManagerProvider(BaseProvider):
"""Route manager provider.
Decides whcih route manager to use based on settings.
Decides which route manager to use based on settings.
"""

def __init__(self, root_profile: Profile):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MediationIdMatchInfoSchema(OpenAPISchema):


class GetKeylistQuerySchema(OpenAPISchema):
"""Get keylist query string paramaters."""
"""Get keylist query string parameters."""

conn_id = CONNECTION_ID_SCHEMA
role = fields.Str(
Expand Down
4 changes: 2 additions & 2 deletions aries_cloudagent/protocols/didexchange/v1_0/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ async def _receive_request_pairwise_did(
def _handshake_protocol_to_use(self, request: DIDXRequest):
"""Determine the connection protocol to use based on the request.
If we support it, we'll send it. If we don't, we'll try didexchage/1.1.
If we support it, we'll send it. If we don't, we'll try didexchange/1.1.
"""
protocol = f"{request._type.protocol}/{request._type.version}"
if protocol in ConnRecord.SUPPORTED_PROTOCOLS:
Expand Down Expand Up @@ -986,7 +986,7 @@ async def accept_response(

conn_rec.their_did = their_did

# The long format I sent has been acknoledged, use short form now.
# The long format I sent has been acknowledged, use short form now.
if LONG_PATTERN.match(conn_rec.my_did or ""):
conn_rec.my_did = await self.long_did_peer_4_to_short(conn_rec.my_did)
if LONG_PATTERN.match(conn_rec.their_did or ""):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def __init__(
goal_code: (optional) is a self-attested code the receiver may want to
display to the user or use in automatically deciding what to do with
the request message. The goal code might be used particularly when the
request is sent to a resolvable DID without reference to a specfic
request is sent to a resolvable DID without reference to a specific
invitation.
goal: (optional) is a self-attested string that the receiver may want to
display to the user about the context-specific goal of the request message.
Expand Down
Loading

0 comments on commit cbc90ff

Please sign in to comment.