Skip to content

Commit

Permalink
fix: failing checks
Browse files Browse the repository at this point in the history
  • Loading branch information
KahanMajmudar committed Nov 13, 2024
1 parent 752446a commit dfb243a
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 27 deletions.
10 changes: 5 additions & 5 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"contract/valory/mech_marketplace/0.1.0": "bafybeib7u3pt4xsviwa2kvpn4kxu3qmnygobhao6si5jqgdfutnlfwkjau",
"connection/valory/websocket_client/0.1.0": "bafybeic4ag3gqc7kd3k2o3pucddj2odck5yrfbgmwh5veqny7zao5qayli",
"skill/valory/contract_subscription/0.1.0": "bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy",
"skill/valory/mech_abci/0.1.0": "bafybeig35ipz6x2ht6wmfb6ivxvyzf7yvtggvml63mqhpgy5o6zqj7rlo4",
"skill/valory/task_submission_abci/0.1.0": "bafybeihh7m4jvnn2sgr25kqfyn7qmrw6452kvrrsipuxruw272o5z6o6fm",
"skill/valory/task_execution/0.1.0": "bafybeiac2tl37wtrs6enevfphej3ltrrb3anibiip65rb6jbxae46uuose",
"skill/valory/mech_abci/0.1.0": "bafybeif6unegjquvfy4i2bhhrq6knnupyucwxs4n76gifwthciqbpigsia",
"skill/valory/task_submission_abci/0.1.0": "bafybeihfxn2aqtiruwxeslipqh5v23ngxycfoy46fi7dndkkfob5g57ciu",
"skill/valory/task_execution/0.1.0": "bafybeib7fkqycq43uu3bdjwmeoiuy324je2b2teyvwee64v2hwjlm7v5x4",
"skill/valory/websocket_client/0.1.0": "bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m",
"skill/valory/subscription_abci/0.1.0": "bafybeie6iqkvupyyan4yqfnxu4z5ujfhzf36hkdwgktmcr7zabwo3zgj3i",
"agent/valory/mech/0.1.0": "bafybeifcyjrstnsr6aan7vndevisthxabk74a3tri7aibotvxkf3efipnu",
"service/valory/mech/0.1.0": "bafybeidjgkp3zmxnij3j3gnd67kacbeyzntxbkddh2cdonwryjhjx56z7u"
"agent/valory/mech/0.1.0": "bafybeife5yf6425epko57ymwacjvcxas7i7ojevo3ba34gdih33eztsj3i",
"service/valory/mech/0.1.0": "bafybeicyuo7gosrw3gkp3o3mucyvzpkzdy3fwe34rgjv7ssvdmb4jnfvo4"
},
"third_party": {
"protocol/valory/default/1.0.0": "bafybeifqcqy5hfbnd7fjv4mqdjrtujh2vx3p2xhe33y67zoxa6ph7wdpaq",
Expand Down
6 changes: 3 additions & 3 deletions packages/valory/agents/mech/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ skills:
- valory/abstract_abci:0.1.0:bafybeieo7pe5wqjphs5izpz5aujjbubymlxub62b3rhx6yglu65ibalffu
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/contract_subscription:0.1.0:bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy
- valory/mech_abci:0.1.0:bafybeig35ipz6x2ht6wmfb6ivxvyzf7yvtggvml63mqhpgy5o6zqj7rlo4
- valory/mech_abci:0.1.0:bafybeif6unegjquvfy4i2bhhrq6knnupyucwxs4n76gifwthciqbpigsia
- valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq
- valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e
- valory/subscription_abci:0.1.0:bafybeie6iqkvupyyan4yqfnxu4z5ujfhzf36hkdwgktmcr7zabwo3zgj3i
- valory/task_execution:0.1.0:bafybeiac2tl37wtrs6enevfphej3ltrrb3anibiip65rb6jbxae46uuose
- valory/task_submission_abci:0.1.0:bafybeihh7m4jvnn2sgr25kqfyn7qmrw6452kvrrsipuxruw272o5z6o6fm
- valory/task_execution:0.1.0:bafybeib7fkqycq43uu3bdjwmeoiuy324je2b2teyvwee64v2hwjlm7v5x4
- valory/task_submission_abci:0.1.0:bafybeihfxn2aqtiruwxeslipqh5v23ngxycfoy46fi7dndkkfob5g57ciu
- valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/websocket_client:0.1.0:bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/mech/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeif7ia4jdlazy6745ke2k2x5yoqlwsgwr6sbztbgqtwvs3ndm2p7ba
fingerprint_ignore_patterns: []
agent: valory/mech:0.1.0:bafybeifcyjrstnsr6aan7vndevisthxabk74a3tri7aibotvxkf3efipnu
agent: valory/mech:0.1.0:bafybeife5yf6425epko57ymwacjvcxas7i7ojevo3ba34gdih33eztsj3i
number_of_agents: 4
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/mech_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ skills:
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq
- valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e
- valory/task_submission_abci:0.1.0:bafybeihh7m4jvnn2sgr25kqfyn7qmrw6452kvrrsipuxruw272o5z6o6fm
- valory/task_submission_abci:0.1.0:bafybeihfxn2aqtiruwxeslipqh5v23ngxycfoy46fi7dndkkfob5g57ciu
- valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/subscription_abci:0.1.0:bafybeie6iqkvupyyan4yqfnxu4z5ujfhzf36hkdwgktmcr7zabwo3zgj3i
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/task_execution/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _check_undelivered_reqs(self) -> None:
target_mechs = [
mech
for mech, config in self.params.mech_to_config.items()
if not config.get("is_marketplace_mech", False)
if not config.is_marketplace_mech
]
contract_api_msg, _ = self.context.contract_dialogues.create(
performative=ContractApiMessage.Performative.GET_STATE,
Expand Down Expand Up @@ -313,7 +313,7 @@ def send_message(
def _get_designated_marketplace_mech_address(self) -> str:
"""Get the designated mech address."""
for mech, config in self.params.mech_to_config.items():
if config.get("is_marketplace_mech", False):
if config.is_marketplace_mech:
return mech

raise ValueError("No marketplace mech address found")
Expand Down
16 changes: 9 additions & 7 deletions packages/valory/skills/task_execution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
"""This module contains the shared state for the abci skill of Mech."""
import dataclasses
from collections import defaultdict
from typing import Any, Callable, Dict, List, Optional, cast
from packages.valory.skills.abstract_round_abci.utils import check_type
from typing import Any, Callable, Dict, Optional

from aea.exceptions import enforce
from aea.skills.base import Model

from packages.valory.skills.abstract_round_abci.utils import check_type


ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"

Expand All @@ -38,11 +39,12 @@ class MechConfig:
is_marketplace_mech: bool

@staticmethod
def from_dict(raw_dict: Dict[bool, bool]) -> "MechConfig":
def from_dict(raw_dict: Dict[str, bool]) -> "MechConfig":
"""From dict."""
print(f"{raw_dict=}")
return MechConfig(
use_dynamic_pricing=raw_dict.get("use_dynamic_pricing"),
is_marketplace_mech=raw_dict.get("is_marketplace_mech"),
use_dynamic_pricing=raw_dict.get("use_dynamic_pricing", False),
is_marketplace_mech=raw_dict.get("is_marketplace_mech", False),
)


Expand Down Expand Up @@ -95,14 +97,14 @@ def _ensure_get(cls, key: str, kwargs: Dict, type_: Any) -> Any:
skill_id = kwargs["skill_context"].skill_id
enforce(
key in kwargs,
f"'{key}' of type '{type_}' required, but it is not set in `models.params.args` of `skill.yaml` of `{skill_id}`",
f"{key!r} of type {type_!r} required, but it is not set in `models.params.args` of `skill.yaml` of `{skill_id}`",
)
value = kwargs.get(key, None)
try:
check_type(key, value, type_)
except TypeError: # pragma: nocover
enforce(
False,
f"'{key}' must be a {type_}, but type {type(value)} was found in `models.params.args` of `skill.yaml` of `{skill_id}`",
f"{key!r} must be a {type_}, but type {type(value)} was found in `models.params.args` of `skill.yaml` of `{skill_id}`",
)
return value
6 changes: 3 additions & 3 deletions packages/valory/skills/task_execution/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeidqhvvlnthkbnmrdkdeyjyx2f2ab6z4xdgmagh7welqnh2v6wczx4
behaviours.py: bafybeifvljjzecbzahjycivwc5ygkdemiopyooj4hrhzu4v3il45jtc7cu
behaviours.py: bafybeihlkuquunpfz6vc5ffoqsayi7567rpbbto7eblcac6e4h72qh74qe
dialogues.py: bafybeid4zxalqdlo5mw4yfbuf34hx4jp5ay5z6chm4zviwu4cj7fudtwca
handlers.py: bafybeidbt5ezj74cgfogk3w4uw4si2grlnk5g54veyumw7g5yh6gdscywu
models.py: bafybeiafwc6ic4kkvcgkevabvqxuqes6tzstieujrbwpjbjxzkub3bkbue
models.py: bafybeigszq73slogvebsaxh32p325fxthyuuwwtot7qxj3bdyho7x7spuq
utils/__init__.py: bafybeiccdijaigu6e5p2iruwo5mkk224o7ywedc7nr6xeu5fpmhjqgk24e
utils/apis.py: bafybeigu73lfz3g3mc6iupisrvlsp3fyl4du3oqlyajgdpfvtqypddh3w4
utils/apis.py: bafybeidqt5nqcymlpwlycnvpsheeeexk3tb3yboceeeizwpd6miqewtr7u
utils/benchmarks.py: bafybeiafnee7iay6dyjnatyqyzjov5c4ibl3ojamjmgfjri7cyghl7qayq
utils/cost_calculation.py: bafybeighafxied73w3mcmgziwfp3u2x6t4qlztw4kyekyq2ddgyhdge74q
utils/ipfs.py: bafybeic7cbuv3tomi2xv7h2qowrqnpoufpanngzlgzljl4ptimpss3meqm
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/task_execution/utils/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
#
# ------------------------------------------------------------------------------
"""Utils for API integrations."""
from typing import Dict, List
from typing import Dict


class KeyChain:
"""Class for managing API keys."""

def __init__(self, services: Dict[str, List[str]]) -> None:
def __init__(self, services: Dict[str, str]) -> None:
"""Initialize the KeyChain with a dictionary of service names and corresponding lists of API keys."""
if not isinstance(services, dict):
raise ValueError(
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/task_submission_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
SharedState as BaseSharedState,
)
from packages.valory.skills.abstract_round_abci.models import TypeCheckMixin
from packages.valory.skills.task_execution.models import MechConfig
from packages.valory.skills.abstract_round_abci.utils import check_type
from packages.valory.skills.task_execution.models import MechConfig
from packages.valory.skills.task_submission_abci.rounds import TaskSubmissionAbciApp


Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/task_submission_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fingerprint:
dialogues.py: bafybeibmac3m5u5h6ucoyjr4dazay72dyga656wvjl6z6saapluvjo54ne
fsm_specification.yaml: bafybeidtmsmpunr3t77pshd3k2s6dd6hlvhze6inu3gj7xyvlg4wi3tnuu
handlers.py: bafybeibe5n7my2vd2wlwo73sbma65epjqc7kxgtittewlylcmvnmoxtxzq
models.py: bafybeiatzdvm5mamweepmxxqiuxzczmqub5y4pc5gw2ioiqubgfg5xjuue
models.py: bafybeicoes4rtg2edxpdxlrow5dmnof2lm6xscagzp55mocrkbxy2xlxwe
payloads.py: bafybeia2yorri2u5rwh6vukb6iwdrbn53ygsuuhthns2txptvjipyb6f4e
rounds.py: bafybeicqimk23sc7itxwcu372lyerwnqly4v7tv2pcl4krd53gdizdv6ae
tasks.py: bafybeicu5t5cvfhbndgpxbbtmp4vbmtyb6fba6vsnlewftvuderxp5lwcy
Expand All @@ -32,7 +32,7 @@ protocols:
skills:
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/task_execution:0.1.0:bafybeiac2tl37wtrs6enevfphej3ltrrb3anibiip65rb6jbxae46uuose
- valory/task_execution:0.1.0:bafybeib7fkqycq43uu3bdjwmeoiuy324je2b2teyvwee64v2hwjlm7v5x4
behaviours:
main:
args: {}
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ authorized_licenses:
MIT license
https://opensource.org/licenses/MIT
License :: OSI Approved :: MIT
CMU License (MIT-CMU)

; aliases for BSD License (and variants)
BSD
Expand Down

0 comments on commit dfb243a

Please sign in to comment.