Skip to content

Commit

Permalink
fix: raise when the dependency set size changes while fetching the agent
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Oct 4, 2023
1 parent 2be89a7 commit 0364195
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
18 changes: 15 additions & 3 deletions aea/cli/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,21 @@ def _fetch_agent_deps(ctx: Context) -> None:
"""
for item_type in (PROTOCOL, CONTRACT, CONNECTION, SKILL):
item_type_plural = "{}s".format(item_type)
required_items = getattr(ctx.agent_config, item_type_plural)
for item_id in required_items:
add_item(ctx, item_type, item_id)
required_items = cast(set, getattr(ctx.agent_config, item_type_plural))
required_items_check = required_items.copy()
try:
for item_id in required_items:
add_item(ctx, item_type, item_id)
except RuntimeError as e:
missing_deps = required_items_check.symmetric_difference(required_items)
error = "\n- ".join(
[
"Size of the dependency set changed during the iteration; "
"Following dependencies are missing from the agent configuration: ",
*map(lambda x: str(x.without_hash()), missing_deps),
]
)
raise click.ClickException(error) from e


def fetch_mixed(
Expand Down
14 changes: 0 additions & 14 deletions docs/api/crypto/helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,3 @@ def hex_to_bytes_for_key(data: str) -> bytes

Convert hex string to bytes with error handling.

<a id="aea.crypto.helpers.generate_multiple_keys"></a>

#### generate`_`multiple`_`keys

```python
def generate_multiple_keys(n: int,
type_: str,
password: Optional[str] = None,
extra_entropy: Union[str, bytes, int] = "",
file: Optional[str] = None) -> None
```

Generate n key pairs.

0 comments on commit 0364195

Please sign in to comment.