From ff28e36cd62c4b9087048c24b3453227a7a66f5c Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 2 Sep 2024 12:47:35 +0530 Subject: [PATCH 01/11] test for staking --- .../skills/staking_abci/tests/test_rounds.py | 327 ++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 packages/valory/skills/staking_abci/tests/test_rounds.py diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py new file mode 100644 index 000000000..504a08a34 --- /dev/null +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023-2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""This package contains the tests for rounds of StakingAbciApp.""" + +import json +from dataclasses import dataclass, field +from unittest.mock import MagicMock +from typing import Any, Callable, Dict, FrozenSet, Hashable, Mapping, Optional, List +from unittest import mock + +import pytest + +from packages.valory.skills.abstract_round_abci.base import( + BaseTxPayload, + AbciAppDB, + get_name + ) +from packages.valory.skills.abstract_round_abci.test_tools.rounds import ( + BaseCollectSameUntilThresholdRoundTest, +) +from packages.valory.skills.staking_abci.payloads import CallCheckpointPayload +from packages.valory.skills.staking_abci.rounds import ( + Event, + SynchronizedData, + CallCheckpointRound, + CheckpointCallPreparedRound, + FinishedStakingRound, + ServiceEvictedRound, + StakingAbciApp +) + +@pytest.fixture +def abci_app() -> StakingAbciApp: + """Fixture for StakingAbciApp.""" + synchronized_data = MagicMock() + logger = MagicMock() + context = MagicMock() + + return StakingAbciApp( + synchronized_data=synchronized_data, + logger=logger, + context=context + ) + +DUMMY_SERVICE_STATE = { + "service_staking_state": 0, # Assuming 0 means UNSTAKED + "tx_submitter": "dummy_submitter", + "most_voted_tx_hash": "dummy_tx_hash", +} + +DUMMY_PARTICIPANT_TO_CHECKPOINT = { + "agent_0": "checkpoint_0", + "agent_1": "checkpoint_1", +} + +def get_participants() -> FrozenSet[str]: + """Participants""" + return frozenset([f"agent_{i}" for i in range(MAX_PARTICIPANTS)]) + + +def get_payloads( + payload_cls: BaseTxPayload, + data: Optional[str], +) -> Mapping[str, BaseTxPayload]: + """Get payloads.""" + return { + participant: payload_cls( + participant, + tx_submitter="dummy_submitter", + tx_hash="dummy_tx_hash", + service_staking_state=0 + ) + for participant in get_participants() + } + + +@dataclass +class RoundTestCase: + """RoundTestCase""" + + name: str + initial_data: Dict[str, Hashable] + payloads: Mapping[str, BaseTxPayload] + final_data: Dict[str, Hashable] + event: Event + most_voted_payload: Any + synchronized_data_attr_checks: List[Callable] = field(default_factory=list) + + +MAX_PARTICIPANTS: int = 4 + + +class BaseStakingRoundTestClass(BaseCollectSameUntilThresholdRoundTest): + """Base test class for Staking rounds.""" + + synchronized_data: SynchronizedData + _synchronized_data_class = SynchronizedData + _event_class = Event + + def run_test(self, test_case: RoundTestCase, **kwargs: Any) -> None: + """Run the test""" + + self.synchronized_data.update(**test_case.initial_data) + + test_round = self.round_class( + synchronized_data=self.synchronized_data, context=mock.MagicMock() + ) + + result = self._test_round( + test_round=test_round, + round_payloads=test_case.payloads, + synchronized_data_update_fn=lambda sync_data, _: sync_data.update( + **test_case.final_data + ), + synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, + most_voted_payload=test_case.most_voted_payload, + exit_event=test_case.event, + ) + + # Debugging line: print result after running the test + print(f"Test case {test_case.name} result: {result}") + + self._complete_run(result) + + +class TestCallCheckpointRound(BaseStakingRoundTestClass): + """Tests for CallCheckpointRound.""" + + round_class = CallCheckpointRound + + @pytest.mark.parametrize( + "test_case", + [ + RoundTestCase( + name="Happy path", + initial_data={}, + payloads=get_payloads( + payload_cls=CallCheckpointPayload, + data=json.dumps(DUMMY_SERVICE_STATE), + ), + final_data={ + "service_staking_state": 0, + "tx_submitter": "dummy_submitter", + "most_voted_tx_hash": "dummy_tx_hash", + }, + event=Event.DONE, + most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + synchronized_data_attr_checks=[ + lambda synchronized_data: synchronized_data.service_staking_state == 0, + lambda synchronized_data: synchronized_data.tx_submitter == "dummy_submitter", + ], + ), + RoundTestCase( + name="Service not staked", + initial_data={}, + payloads=get_payloads( + payload_cls=CallCheckpointPayload, + data=json.dumps(DUMMY_SERVICE_STATE), + ), + final_data={}, + event=Event.SERVICE_NOT_STAKED, + most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + synchronized_data_attr_checks=[ + lambda synchronized_data: synchronized_data.service_staking_state == 0, + ], + ), + RoundTestCase( + name="Service evicted", + initial_data={}, + payloads=get_payloads( + payload_cls=CallCheckpointPayload, + data=json.dumps(DUMMY_SERVICE_STATE), + ), + final_data={}, + event=Event.SERVICE_EVICTED, + most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + synchronized_data_attr_checks=[ + lambda synchronized_data: synchronized_data.service_staking_state == 0, + ], + ), + RoundTestCase( + name="Next checkpoint not reached", + initial_data={}, + payloads=get_payloads( + payload_cls=CallCheckpointPayload, + data=json.dumps(DUMMY_SERVICE_STATE), + ), + final_data={}, + event=Event.NEXT_CHECKPOINT_NOT_REACHED_YET, + most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + synchronized_data_attr_checks=[ + lambda synchronized_data: synchronized_data.service_staking_state == 0, + ], + ), + ], + ) + def test_run(self, test_case: RoundTestCase) -> None: + """Run tests with debugging.""" + # Print test case details + print(f"Running test case: {test_case.name}") + print(f"Initial Data: {test_case.initial_data}") + print(f"Payloads: {test_case.payloads}") + print(f"Final Data: {test_case.final_data}") + print(f"Event: {test_case.event}") + print(f"Most Voted Payload: {test_case.most_voted_payload}") + + # Run the test + self.run_test(test_case) + + def run_test(self, test_case: RoundTestCase, **kwargs: Any) -> None: + """Run the test with added debugging.""" + self.synchronized_data.update(**test_case.initial_data) + + test_round = self.round_class( + synchronized_data=self.synchronized_data, context=mock.MagicMock() + ) + + print("Starting _test_round...") + result = self._test_round( + test_round=test_round, + round_payloads=test_case.payloads, + synchronized_data_update_fn=lambda sync_data, _: sync_data.update( + **test_case.final_data + ), + synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, + most_voted_payload=test_case.most_voted_payload, + exit_event=test_case.event, + ) + + # Debugging line: print result after running the test + print(f"Test case {test_case.name} result: {result}") + + self._complete_run(result) + + + +class TestCheckpointCallPreparedRound: + """Tests for CheckpointCallPreparedRound.""" + + def test_checkpoint_call_prepared_round_initialization(self) -> None: + """Test the initialization of CheckpointCallPreparedRound.""" + round_ = CheckpointCallPreparedRound( + synchronized_data=MagicMock(), context=MagicMock() + ) + assert isinstance(round_, CheckpointCallPreparedRound) + + +class TestFinishedStakingRound: + """Tests for FinishedStakingRound.""" + + def test_finished_staking_round_initialization(self) -> None: + """Test the initialization of FinishedStakingRound.""" + round_ = FinishedStakingRound( + synchronized_data=MagicMock(), context=MagicMock() + ) + assert isinstance(round_, FinishedStakingRound) + + +class TestServiceEvictedRound: + """Tests for ServiceEvictedRound.""" + + def test_service_evicted_round_initialization(self) -> None: + """Test the initialization of ServiceEvictedRound.""" + round_ = ServiceEvictedRound( + synchronized_data=MagicMock(), context=MagicMock() + ) + assert isinstance(round_, ServiceEvictedRound) + + +def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None: + """Test the initialization of StakingAbciApp.""" + assert abci_app.initial_round_cls is CallCheckpointRound + assert abci_app.final_states == { + CheckpointCallPreparedRound, + FinishedStakingRound, + ServiceEvictedRound, + } + assert abci_app.transition_function == { + CallCheckpointRound: { + Event.DONE: CheckpointCallPreparedRound, + Event.SERVICE_NOT_STAKED: FinishedStakingRound, + Event.SERVICE_EVICTED: ServiceEvictedRound, + Event.NEXT_CHECKPOINT_NOT_REACHED_YET: FinishedStakingRound, + Event.ROUND_TIMEOUT: CallCheckpointRound, + Event.NO_MAJORITY: CallCheckpointRound, + }, + CheckpointCallPreparedRound: {}, + FinishedStakingRound: {}, + ServiceEvictedRound: {}, + } + assert abci_app.event_to_timeout == {Event.ROUND_TIMEOUT: 30.0} + assert abci_app.db_pre_conditions == {CallCheckpointRound: set()} + assert abci_app.db_post_conditions == { + CheckpointCallPreparedRound: { + get_name(SynchronizedData.tx_submitter), + get_name(SynchronizedData.most_voted_tx_hash), + get_name(SynchronizedData.service_staking_state), + }, + FinishedStakingRound: { + get_name(SynchronizedData.service_staking_state), + }, + ServiceEvictedRound: { + get_name(SynchronizedData.service_staking_state), + }, + } + +def test_synchronized_data_initialization() -> None: + """Test the initialization and attributes of SynchronizedData.""" + data = SynchronizedData(db=AbciAppDB(setup_data={"test": ["test"]})) + assert data.db._data == {0: {"test": ["test"]}} From 0812811fd6325b1a25c00d28f62bfa9c87cf0725 Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 2 Sep 2024 16:50:19 +0530 Subject: [PATCH 02/11] test: dialogues of staking --- .../staking_abci/tests/test_dialogues.py | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/valory/skills/staking_abci/tests/test_dialogues.py diff --git a/packages/valory/skills/staking_abci/tests/test_dialogues.py b/packages/valory/skills/staking_abci/tests/test_dialogues.py new file mode 100644 index 000000000..46a6313a9 --- /dev/null +++ b/packages/valory/skills/staking_abci/tests/test_dialogues.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2021-2024 Valory AG +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# ------------------------------------------------------------------------------ + +"""Test the dialogues.py module of the skill.""" + +# pylint: skip-file + +import packages.valory.skills.staking_abci.dialogues # noqa + + +def test_import() -> None: + """Test that the 'dialogues.py' Python module can be imported.""" \ No newline at end of file From bf4f451f5dc6f662ba8484fc46c9983399466b17 Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Tue, 3 Sep 2024 12:13:29 +0530 Subject: [PATCH 03/11] test --- .../valory/skills/staking_abci/tests/test_rounds.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index 504a08a34..e55d54daf 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -212,15 +212,7 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): ], ) def test_run(self, test_case: RoundTestCase) -> None: - """Run tests with debugging.""" - # Print test case details - print(f"Running test case: {test_case.name}") - print(f"Initial Data: {test_case.initial_data}") - print(f"Payloads: {test_case.payloads}") - print(f"Final Data: {test_case.final_data}") - print(f"Event: {test_case.event}") - print(f"Most Voted Payload: {test_case.most_voted_payload}") - + # Run the test self.run_test(test_case) From b74817e7e79da3b88b70293b4c4472f58a253985 Mon Sep 17 00:00:00 2001 From: Adamantios Date: Wed, 4 Sep 2024 14:31:59 +0300 Subject: [PATCH 04/11] fix: tests logic --- .../skills/staking_abci/tests/test_rounds.py | 101 +++++++----------- 1 file changed, 41 insertions(+), 60 deletions(-) diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index e55d54daf..2d07da625 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -19,19 +19,18 @@ """This package contains the tests for rounds of StakingAbciApp.""" -import json from dataclasses import dataclass, field -from unittest.mock import MagicMock -from typing import Any, Callable, Dict, FrozenSet, Hashable, Mapping, Optional, List +from typing import Any, Callable, Dict, FrozenSet, Hashable, Mapping, List, Type from unittest import mock +from unittest.mock import MagicMock import pytest -from packages.valory.skills.abstract_round_abci.base import( - BaseTxPayload, +from packages.valory.skills.abstract_round_abci.base import ( + BaseTxPayload, AbciAppDB, - get_name - ) + get_name, CollectSameUntilThresholdRound +) from packages.valory.skills.abstract_round_abci.test_tools.rounds import ( BaseCollectSameUntilThresholdRoundTest, ) @@ -43,49 +42,42 @@ CheckpointCallPreparedRound, FinishedStakingRound, ServiceEvictedRound, - StakingAbciApp + StakingAbciApp, StakingState ) + @pytest.fixture def abci_app() -> StakingAbciApp: """Fixture for StakingAbciApp.""" synchronized_data = MagicMock() logger = MagicMock() context = MagicMock() - + return StakingAbciApp( synchronized_data=synchronized_data, logger=logger, context=context ) + DUMMY_SERVICE_STATE = { - "service_staking_state": 0, # Assuming 0 means UNSTAKED + "service_staking_state": StakingState.UNSTAKED.value, "tx_submitter": "dummy_submitter", - "most_voted_tx_hash": "dummy_tx_hash", + "tx_hash": "dummy_tx_hash", } -DUMMY_PARTICIPANT_TO_CHECKPOINT = { - "agent_0": "checkpoint_0", - "agent_1": "checkpoint_1", -} def get_participants() -> FrozenSet[str]: """Participants""" return frozenset([f"agent_{i}" for i in range(MAX_PARTICIPANTS)]) -def get_payloads( - payload_cls: BaseTxPayload, - data: Optional[str], -) -> Mapping[str, BaseTxPayload]: +def get_checkpoint_payloads(data: Dict) -> Mapping[str, CallCheckpointPayload]: """Get payloads.""" return { - participant: payload_cls( + participant: CallCheckpointPayload( participant, - tx_submitter="dummy_submitter", - tx_hash="dummy_tx_hash", - service_staking_state=0 + **data, ) for participant in get_participants() } @@ -110,6 +102,7 @@ class RoundTestCase: class BaseStakingRoundTestClass(BaseCollectSameUntilThresholdRoundTest): """Base test class for Staking rounds.""" + round_class: Type[CollectSameUntilThresholdRound] synchronized_data: SynchronizedData _synchronized_data_class = SynchronizedData _event_class = Event @@ -134,9 +127,6 @@ def run_test(self, test_case: RoundTestCase, **kwargs: Any) -> None: exit_event=test_case.event, ) - # Debugging line: print result after running the test - print(f"Test case {test_case.name} result: {result}") - self._complete_run(result) @@ -151,32 +141,30 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): RoundTestCase( name="Happy path", initial_data={}, - payloads=get_payloads( - payload_cls=CallCheckpointPayload, - data=json.dumps(DUMMY_SERVICE_STATE), - ), + payloads=get_checkpoint_payloads({ + "service_staking_state": StakingState.STAKED.value, + "tx_submitter": "dummy_submitter", + "tx_hash": "dummy_tx_hash", + }), final_data={ - "service_staking_state": 0, + "service_staking_state": StakingState.STAKED.value, "tx_submitter": "dummy_submitter", - "most_voted_tx_hash": "dummy_tx_hash", + "tx_hash": "dummy_tx_hash", }, event=Event.DONE, - most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ - lambda synchronized_data: synchronized_data.service_staking_state == 0, + lambda synchronized_data: synchronized_data.service_staking_state == StakingState.STAKED.value, lambda synchronized_data: synchronized_data.tx_submitter == "dummy_submitter", ], ), RoundTestCase( name="Service not staked", initial_data={}, - payloads=get_payloads( - payload_cls=CallCheckpointPayload, - data=json.dumps(DUMMY_SERVICE_STATE), - ), + payloads=get_checkpoint_payloads(DUMMY_SERVICE_STATE), final_data={}, event=Event.SERVICE_NOT_STAKED, - most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ lambda synchronized_data: synchronized_data.service_staking_state == 0, ], @@ -184,13 +172,14 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): RoundTestCase( name="Service evicted", initial_data={}, - payloads=get_payloads( - payload_cls=CallCheckpointPayload, - data=json.dumps(DUMMY_SERVICE_STATE), - ), + payloads=get_checkpoint_payloads({ + "service_staking_state": StakingState.EVICTED.value, + "tx_submitter": "dummy_submitter", + "tx_hash": "dummy_tx_hash", + }), final_data={}, event=Event.SERVICE_EVICTED, - most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ lambda synchronized_data: synchronized_data.service_staking_state == 0, ], @@ -198,13 +187,14 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): RoundTestCase( name="Next checkpoint not reached", initial_data={}, - payloads=get_payloads( - payload_cls=CallCheckpointPayload, - data=json.dumps(DUMMY_SERVICE_STATE), - ), + payloads=get_checkpoint_payloads({ + "service_staking_state": StakingState.STAKED.value, + "tx_submitter": "dummy_submitter", + "tx_hash": None, + }), final_data={}, event=Event.NEXT_CHECKPOINT_NOT_REACHED_YET, - most_voted_payload=json.dumps(DUMMY_SERVICE_STATE), + most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ lambda synchronized_data: synchronized_data.service_staking_state == 0, ], @@ -212,19 +202,13 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): ], ) def test_run(self, test_case: RoundTestCase) -> None: - - # Run the test - self.run_test(test_case) - - def run_test(self, test_case: RoundTestCase, **kwargs: Any) -> None: - """Run the test with added debugging.""" + """Run the test.""" self.synchronized_data.update(**test_case.initial_data) test_round = self.round_class( synchronized_data=self.synchronized_data, context=mock.MagicMock() ) - print("Starting _test_round...") result = self._test_round( test_round=test_round, round_payloads=test_case.payloads, @@ -236,13 +220,9 @@ def run_test(self, test_case: RoundTestCase, **kwargs: Any) -> None: exit_event=test_case.event, ) - # Debugging line: print result after running the test - print(f"Test case {test_case.name} result: {result}") - self._complete_run(result) - class TestCheckpointCallPreparedRound: """Tests for CheckpointCallPreparedRound.""" @@ -313,6 +293,7 @@ def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None: }, } + def test_synchronized_data_initialization() -> None: """Test the initialization and attributes of SynchronizedData.""" data = SynchronizedData(db=AbciAppDB(setup_data={"test": ["test"]})) From fe57a6c1798b1a2fddef43edb958007011480472 Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Fri, 6 Sep 2024 16:32:09 +0530 Subject: [PATCH 05/11] generators --- packages/packages.json | 14 ++-- packages/valory/agents/trader/aea-config.yaml | 8 +- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 2 +- .../valory/skills/staking_abci/skill.yaml | 2 + .../staking_abci/tests/test_dialogues.py | 2 +- .../skills/staking_abci/tests/test_rounds.py | 83 +++++++++++-------- packages/valory/skills/trader_abci/skill.yaml | 6 +- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 10 files changed, 69 insertions(+), 54 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 01f458c42..24a9e5aec 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeihzgjyvhtorugjw3yldznqsbwo3aqpxowm7k2nrvj6qtwpsc7jl7u", "skill/valory/market_manager_abci/0.1.0": "bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra", "skill/valory/decision_maker_abci/0.1.0": "bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy", - "skill/valory/trader_abci/0.1.0": "bafybeigpelxc6kppckpx4phewwyi24mejyz54fi6g5i7swnm3xi2x5olve", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibgzwhazshodynrpsowbnvy7awtl6vgzrf3yunvicgrha4hfzbsi4", - "skill/valory/staking_abci/0.1.0": "bafybeiduborfqevheegy3plk7bzhkl4fukwixvlb57tenijdepintubbdi", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeiat5hmo6i2r6t6ufyfnidvepixmbnppotdmztu4dad5j4hiewdh64", - "agent/valory/trader/0.1.0": "bafybeibj2ezsqdnqa5kcwnhv5ke6z6fgspfxlewnkakz5ci73nmen43cpe", - "service/valory/trader/0.1.0": "bafybeibocmmtkoqnx2k4uhovfzk563ki7onukirkpex7pjnwwaesilqf7a", - "service/valory/trader_pearl/0.1.0": "bafybeigin5i6pvy4mwcgarcna2xetlhrofnnj4l7fbfiirrecpzvn3vshe" + "skill/valory/trader_abci/0.1.0": "bafybeichdtzhx3kw77ksj3j65opz6pgbirov47gqk4hdq2uflbkrmktuci", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigm7ukev5j77rpldv23ta5p2ophmmwfzq6v6ju2ad2o2iqpulpfq4", + "skill/valory/staking_abci/0.1.0": "bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeifm7dbfiik2i6kbrvdw3qzda7c5s2ydtx5lc2ioubxdh3jun2g6cy", + "agent/valory/trader/0.1.0": "bafybeifvdrsjnsoopbc2zmslabvhzeq4s7k7tigxuye7uxakvypmxrzn5q", + "service/valory/trader/0.1.0": "bafybeihbmsoeobk4ick63qsioatoxnsiswygxqzdbu2xecdwpsyjc7za3a", + "service/valory/trader_pearl/0.1.0": "bafybeibiz6244uqr3yp7qodx3nalj5wzng2cezmmsyx27vjzvpvlffxfri" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index b573664c2..d30a8c5e9 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -47,12 +47,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibgzwhazshodynrpsowbnvy7awtl6vgzrf3yunvicgrha4hfzbsi4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigm7ukev5j77rpldv23ta5p2ophmmwfzq6v6ju2ad2o2iqpulpfq4 - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/trader_abci:0.1.0:bafybeigpelxc6kppckpx4phewwyi24mejyz54fi6g5i7swnm3xi2x5olve -- valory/staking_abci:0.1.0:bafybeiduborfqevheegy3plk7bzhkl4fukwixvlb57tenijdepintubbdi -- valory/check_stop_trading_abci:0.1.0:bafybeiat5hmo6i2r6t6ufyfnidvepixmbnppotdmztu4dad5j4hiewdh64 +- valory/trader_abci:0.1.0:bafybeichdtzhx3kw77ksj3j65opz6pgbirov47gqk4hdq2uflbkrmktuci +- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m +- valory/check_stop_trading_abci:0.1.0:bafybeifm7dbfiik2i6kbrvdw3qzda7c5s2ydtx5lc2ioubxdh3jun2g6cy - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index bd0a928fe..2ffb65b3a 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeibj2ezsqdnqa5kcwnhv5ke6z6fgspfxlewnkakz5ci73nmen43cpe +agent: valory/trader:0.1.0:bafybeifvdrsjnsoopbc2zmslabvhzeq4s7k7tigxuye7uxakvypmxrzn5q number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 540be3783..1a3e7e42d 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeibj2ezsqdnqa5kcwnhv5ke6z6fgspfxlewnkakz5ci73nmen43cpe +agent: valory/trader:0.1.0:bafybeifvdrsjnsoopbc2zmslabvhzeq4s7k7tigxuye7uxakvypmxrzn5q number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 82a7943dd..afd280520 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui -- valory/staking_abci:0.1.0:bafybeiduborfqevheegy3plk7bzhkl4fukwixvlb57tenijdepintubbdi +- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m behaviours: main: args: {} diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index 39144ec26..8f48b5247 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -16,8 +16,10 @@ fingerprint: payloads.py: bafybeibnub5ehb2mvpcoan3x23pp5oz4azpofwrtcl32abswcfl4cmjlwq rounds.py: bafybeic7kre4hriounn6at63fjzttw45zoivxatg23cmojok4ah6fca7ca tests/__init__.py: bafybeid7m6ynosqeb4mvsss2hqg75aly5o2d47r7yfg2xtgwzkkilv2d2m + tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme tests/test_payloads.py: bafybeiaq2dxpbein6qhipalibi57x6niiydxi6kvbpeqripzlngcgpb3qq + tests/test_rounds.py: bafybeifyhj4ly2xortpbubycghl5enztvbsfpqzqytj65jnrvkzgihyrzu fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/tests/test_dialogues.py b/packages/valory/skills/staking_abci/tests/test_dialogues.py index 46a6313a9..b7073dec1 100644 --- a/packages/valory/skills/staking_abci/tests/test_dialogues.py +++ b/packages/valory/skills/staking_abci/tests/test_dialogues.py @@ -25,4 +25,4 @@ def test_import() -> None: - """Test that the 'dialogues.py' Python module can be imported.""" \ No newline at end of file + """Test that the 'dialogues.py' Python module can be imported.""" diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index 2d07da625..a78cc3cc4 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -20,29 +20,31 @@ """This package contains the tests for rounds of StakingAbciApp.""" from dataclasses import dataclass, field -from typing import Any, Callable, Dict, FrozenSet, Hashable, Mapping, List, Type +from typing import Any, Callable, Dict, FrozenSet, Hashable, List, Mapping, Type from unittest import mock from unittest.mock import MagicMock import pytest from packages.valory.skills.abstract_round_abci.base import ( - BaseTxPayload, AbciAppDB, - get_name, CollectSameUntilThresholdRound + BaseTxPayload, + CollectSameUntilThresholdRound, + get_name, ) from packages.valory.skills.abstract_round_abci.test_tools.rounds import ( BaseCollectSameUntilThresholdRoundTest, ) from packages.valory.skills.staking_abci.payloads import CallCheckpointPayload from packages.valory.skills.staking_abci.rounds import ( - Event, - SynchronizedData, CallCheckpointRound, CheckpointCallPreparedRound, + Event, FinishedStakingRound, ServiceEvictedRound, - StakingAbciApp, StakingState + StakingAbciApp, + StakingState, + SynchronizedData, ) @@ -54,9 +56,7 @@ def abci_app() -> StakingAbciApp: context = MagicMock() return StakingAbciApp( - synchronized_data=synchronized_data, - logger=logger, - context=context + synchronized_data=synchronized_data, logger=logger, context=context ) @@ -107,10 +107,12 @@ class BaseStakingRoundTestClass(BaseCollectSameUntilThresholdRoundTest): _synchronized_data_class = SynchronizedData _event_class = Event - def run_test(self, test_case: RoundTestCase, **kwargs: Any) -> None: + def run_test(self, test_case: RoundTestCase) -> None: """Run the test""" - self.synchronized_data.update(**test_case.initial_data) + self.synchronized_data.update( + self._synchronized_data_class, **test_case.initial_data + ) test_round = self.round_class( synchronized_data=self.synchronized_data, context=mock.MagicMock() @@ -141,11 +143,13 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): RoundTestCase( name="Happy path", initial_data={}, - payloads=get_checkpoint_payloads({ - "service_staking_state": StakingState.STAKED.value, - "tx_submitter": "dummy_submitter", - "tx_hash": "dummy_tx_hash", - }), + payloads=get_checkpoint_payloads( + { + "service_staking_state": StakingState.STAKED.value, + "tx_submitter": "dummy_submitter", + "tx_hash": "dummy_tx_hash", + } + ), final_data={ "service_staking_state": StakingState.STAKED.value, "tx_submitter": "dummy_submitter", @@ -154,8 +158,10 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): event=Event.DONE, most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ - lambda synchronized_data: synchronized_data.service_staking_state == StakingState.STAKED.value, - lambda synchronized_data: synchronized_data.tx_submitter == "dummy_submitter", + lambda synchronized_data: synchronized_data.service_staking_state + == StakingState.STAKED.value, + lambda synchronized_data: synchronized_data.tx_submitter + == "dummy_submitter", ], ), RoundTestCase( @@ -166,44 +172,53 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): event=Event.SERVICE_NOT_STAKED, most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ - lambda synchronized_data: synchronized_data.service_staking_state == 0, + lambda synchronized_data: synchronized_data.service_staking_state + == 0, ], ), RoundTestCase( name="Service evicted", initial_data={}, - payloads=get_checkpoint_payloads({ - "service_staking_state": StakingState.EVICTED.value, - "tx_submitter": "dummy_submitter", - "tx_hash": "dummy_tx_hash", - }), + payloads=get_checkpoint_payloads( + { + "service_staking_state": StakingState.EVICTED.value, + "tx_submitter": "dummy_submitter", + "tx_hash": "dummy_tx_hash", + } + ), final_data={}, event=Event.SERVICE_EVICTED, most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ - lambda synchronized_data: synchronized_data.service_staking_state == 0, + lambda synchronized_data: synchronized_data.service_staking_state + == 0, ], ), RoundTestCase( name="Next checkpoint not reached", initial_data={}, - payloads=get_checkpoint_payloads({ - "service_staking_state": StakingState.STAKED.value, - "tx_submitter": "dummy_submitter", - "tx_hash": None, - }), + payloads=get_checkpoint_payloads( + { + "service_staking_state": StakingState.STAKED.value, + "tx_submitter": "dummy_submitter", + "tx_hash": None, + } + ), final_data={}, event=Event.NEXT_CHECKPOINT_NOT_REACHED_YET, most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"], synchronized_data_attr_checks=[ - lambda synchronized_data: synchronized_data.service_staking_state == 0, + lambda synchronized_data: synchronized_data.service_staking_state + == 0, ], ), ], ) def test_run(self, test_case: RoundTestCase) -> None: """Run the test.""" - self.synchronized_data.update(**test_case.initial_data) + self.synchronized_data.update( + self._synchronized_data_class, **test_case.initial_data + ) test_round = self.round_class( synchronized_data=self.synchronized_data, context=mock.MagicMock() @@ -250,9 +265,7 @@ class TestServiceEvictedRound: def test_service_evicted_round_initialization(self) -> None: """Test the initialization of ServiceEvictedRound.""" - round_ = ServiceEvictedRound( - synchronized_data=MagicMock(), context=MagicMock() - ) + round_ = ServiceEvictedRound(synchronized_data=MagicMock(), context=MagicMock()) assert isinstance(round_, ServiceEvictedRound) diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 3a2e90685..5e8d0c2bb 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -28,9 +28,9 @@ skills: - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibgzwhazshodynrpsowbnvy7awtl6vgzrf3yunvicgrha4hfzbsi4 -- valory/staking_abci:0.1.0:bafybeiduborfqevheegy3plk7bzhkl4fukwixvlb57tenijdepintubbdi -- valory/check_stop_trading_abci:0.1.0:bafybeiat5hmo6i2r6t6ufyfnidvepixmbnppotdmztu4dad5j4hiewdh64 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigm7ukev5j77rpldv23ta5p2ophmmwfzq6v6ju2ad2o2iqpulpfq4 +- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m +- valory/check_stop_trading_abci:0.1.0:bafybeifm7dbfiik2i6kbrvdw3qzda7c5s2ydtx5lc2ioubxdh3jun2g6cy - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index e97464c4a..fc8534162 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -24,7 +24,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/staking_abci:0.1.0:bafybeiduborfqevheegy3plk7bzhkl4fukwixvlb57tenijdepintubbdi +- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: From 85b2943395846a7cd2acb0703a400a4c13c84030 Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Fri, 6 Sep 2024 17:12:53 +0530 Subject: [PATCH 06/11] tox.ini --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 1d83e9988..8c569a52f 100644 --- a/tox.ini +++ b/tox.ini @@ -105,6 +105,7 @@ commands = pytest -rfE {env:SKILLS_PATHS}/decision_maker_abci/tests --cov={env:SKILLS_PATHS}/decision_maker_abci --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs} pytest -rfE {env:SKILLS_PATHS}/check_stop_trading_abci/tests --cov={env:SKILLS_PATHS}/check_stop_trading_abci --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs} pytest -rfE {env:SKILLS_PATHS}/market_manager_abci/tests --cov={env:SKILLS_PATHS}/market_manager_abci --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs} + pytest -rfE {env:SKILLS_PATHS}/staking_abci/tests --cov={env:SKILLS_PATHS}/staking_abci --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs} [testenv:py3.8-linux] basepython = python3.8 From b713731364bf85f00b890225744a6378332df13f Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 9 Sep 2024 11:50:45 +0530 Subject: [PATCH 07/11] fix: coverage --- .../skills/staking_abci/tests/test_rounds.py | 74 ++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index a78cc3cc4..00c98da2e 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -19,10 +19,11 @@ """This package contains the tests for rounds of StakingAbciApp.""" +import json from dataclasses import dataclass, field from typing import Any, Callable, Dict, FrozenSet, Hashable, List, Mapping, Type from unittest import mock -from unittest.mock import MagicMock +from unittest.mock import MagicMock, patch import pytest @@ -306,6 +307,77 @@ def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None: }, } +DUMMY_PARTICIPANT_TO_CHECKPOINT = json.dumps( + { + "agent_0": {"sender": "agent_0", "data": "checkpoint_1"}, + "agent_1": {"sender": "agent_1", "data": "checkpoint_2"}, + } +) + +@pytest.mark.parametrize( + "key,serialized_data,expected_result,property_to_check", + [ + ( + "participant_to_checkpoint", + DUMMY_PARTICIPANT_TO_CHECKPOINT, + json.loads(DUMMY_PARTICIPANT_TO_CHECKPOINT), + "participant_to_checkpoint", # Corresponds to _get_deserialized method + ), + ], +) +@patch( + "packages.valory.skills.staking_abci.rounds.CollectionRound.deserialize_collection" +) +def test_synchronized_data_get_deserialized( + mock_deserialize_collection: MagicMock, + key: str, + serialized_data: str, + expected_result: Mapping[str, Any], + property_to_check: str, +) -> None: + """Test the deserialization and property access in SynchronizedData.""" + # Mock the db.get_strict to return the serialized data + mock_db = mock.MagicMock() + mock_db.get_strict.return_value = serialized_data + + # Initialize SynchronizedData with the mocked db + synchronized_data = SynchronizedData(db=mock_db) + + # Mock the deserialize_collection function to return the expected deserialized result + mock_deserialize_collection.return_value = expected_result + + # Access the property using the appropriate property access method + deserialized_data = synchronized_data.participant_to_checkpoint + + # Ensure that get_strict is called with the correct key + mock_db.get_strict.assert_called_once_with(key) + + # Ensure that deserialize_collection is called with the correct serialized data + mock_deserialize_collection.assert_called_once_with(serialized_data) + assert deserialized_data == expected_result + + +def test_synchronized_data_tx_submitter() -> None: + """Test the tx_submitter property in SynchronizedData.""" + mock_db = mock.MagicMock() + mock_db.get_strict.return_value = "agent_0" + + synchronized_data = SynchronizedData(db=mock_db) + + assert synchronized_data.tx_submitter == "agent_0" + mock_db.get_strict.assert_called_once_with("tx_submitter") + + +def test_synchronized_data_service_staking_state() -> None: + """Test the service_staking_state property in SynchronizedData.""" + mock_db = mock.MagicMock() + mock_db.get.return_value = 0 + + synchronized_data = SynchronizedData(db=mock_db) + + staking_state = synchronized_data.service_staking_state + assert isinstance(staking_state, StakingState) + mock_db.get.assert_called_once_with("service_staking_state", 0) def test_synchronized_data_initialization() -> None: """Test the initialization and attributes of SynchronizedData.""" From fe7194598396ccd49661d8ab830518e7ae76a71c Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 9 Sep 2024 11:56:04 +0530 Subject: [PATCH 08/11] generators --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 2 +- packages/valory/skills/staking_abci/skill.yaml | 2 +- .../skills/staking_abci/tests/test_rounds.py | 3 +++ packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 24a9e5aec..2c6d75f4a 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeihzgjyvhtorugjw3yldznqsbwo3aqpxowm7k2nrvj6qtwpsc7jl7u", "skill/valory/market_manager_abci/0.1.0": "bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra", "skill/valory/decision_maker_abci/0.1.0": "bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy", - "skill/valory/trader_abci/0.1.0": "bafybeichdtzhx3kw77ksj3j65opz6pgbirov47gqk4hdq2uflbkrmktuci", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigm7ukev5j77rpldv23ta5p2ophmmwfzq6v6ju2ad2o2iqpulpfq4", - "skill/valory/staking_abci/0.1.0": "bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeifm7dbfiik2i6kbrvdw3qzda7c5s2ydtx5lc2ioubxdh3jun2g6cy", - "agent/valory/trader/0.1.0": "bafybeifvdrsjnsoopbc2zmslabvhzeq4s7k7tigxuye7uxakvypmxrzn5q", - "service/valory/trader/0.1.0": "bafybeihbmsoeobk4ick63qsioatoxnsiswygxqzdbu2xecdwpsyjc7za3a", - "service/valory/trader_pearl/0.1.0": "bafybeibiz6244uqr3yp7qodx3nalj5wzng2cezmmsyx27vjzvpvlffxfri" + "skill/valory/trader_abci/0.1.0": "bafybeigkq76ttun6kczaup2opgrxo33f4zhpc3k22ln6ncr425liezreuu", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibc6m45ha3tuvui3rbsdqz7k5kzjitk2fnjzxqr57dy7dw3iv42qe", + "skill/valory/staking_abci/0.1.0": "bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeia2m2tinhubnyzujr7o3v6nuvg5ivsr55miuuthfhs57lrz3x53ha", + "agent/valory/trader/0.1.0": "bafybeid5e4lfxj5ipprgowmbohzxwun4jetsnq2umm77zrh5kdil4j62ua", + "service/valory/trader/0.1.0": "bafybeial2lgh5uiherbbytrsxduouqd3zl3b4ukigaxedlb5mojmes5d4u", + "service/valory/trader_pearl/0.1.0": "bafybeighruorx5sa5d4dsv7wo4mjvlgpwrdmi4mphyaxejaju6ojzcpeba" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index d30a8c5e9..0f610941c 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -47,12 +47,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigm7ukev5j77rpldv23ta5p2ophmmwfzq6v6ju2ad2o2iqpulpfq4 +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibc6m45ha3tuvui3rbsdqz7k5kzjitk2fnjzxqr57dy7dw3iv42qe - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/trader_abci:0.1.0:bafybeichdtzhx3kw77ksj3j65opz6pgbirov47gqk4hdq2uflbkrmktuci -- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m -- valory/check_stop_trading_abci:0.1.0:bafybeifm7dbfiik2i6kbrvdw3qzda7c5s2ydtx5lc2ioubxdh3jun2g6cy +- valory/trader_abci:0.1.0:bafybeigkq76ttun6kczaup2opgrxo33f4zhpc3k22ln6ncr425liezreuu +- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe +- valory/check_stop_trading_abci:0.1.0:bafybeia2m2tinhubnyzujr7o3v6nuvg5ivsr55miuuthfhs57lrz3x53ha - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 2ffb65b3a..9e45a219f 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifvdrsjnsoopbc2zmslabvhzeq4s7k7tigxuye7uxakvypmxrzn5q +agent: valory/trader:0.1.0:bafybeid5e4lfxj5ipprgowmbohzxwun4jetsnq2umm77zrh5kdil4j62ua number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 1a3e7e42d..2726a92d9 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifvdrsjnsoopbc2zmslabvhzeq4s7k7tigxuye7uxakvypmxrzn5q +agent: valory/trader:0.1.0:bafybeid5e4lfxj5ipprgowmbohzxwun4jetsnq2umm77zrh5kdil4j62ua number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index afd280520..01076987e 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui -- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m +- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe behaviours: main: args: {} diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index 8f48b5247..8c3d558a1 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -19,7 +19,7 @@ fingerprint: tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme tests/test_payloads.py: bafybeiaq2dxpbein6qhipalibi57x6niiydxi6kvbpeqripzlngcgpb3qq - tests/test_rounds.py: bafybeifyhj4ly2xortpbubycghl5enztvbsfpqzqytj65jnrvkzgihyrzu + tests/test_rounds.py: bafybeiazmgr4uwq2ayiq4az2ojfscpxouyawrf6yjsu3baz6pr6ziaqs74 fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index 00c98da2e..e46ed2bec 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -307,6 +307,7 @@ def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None: }, } + DUMMY_PARTICIPANT_TO_CHECKPOINT = json.dumps( { "agent_0": {"sender": "agent_0", "data": "checkpoint_1"}, @@ -314,6 +315,7 @@ def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None: } ) + @pytest.mark.parametrize( "key,serialized_data,expected_result,property_to_check", [ @@ -379,6 +381,7 @@ def test_synchronized_data_service_staking_state() -> None: assert isinstance(staking_state, StakingState) mock_db.get.assert_called_once_with("service_staking_state", 0) + def test_synchronized_data_initialization() -> None: """Test the initialization and attributes of SynchronizedData.""" data = SynchronizedData(db=AbciAppDB(setup_data={"test": ["test"]})) diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index 5e8d0c2bb..b132a6936 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -28,9 +28,9 @@ skills: - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigm7ukev5j77rpldv23ta5p2ophmmwfzq6v6ju2ad2o2iqpulpfq4 -- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m -- valory/check_stop_trading_abci:0.1.0:bafybeifm7dbfiik2i6kbrvdw3qzda7c5s2ydtx5lc2ioubxdh3jun2g6cy +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibc6m45ha3tuvui3rbsdqz7k5kzjitk2fnjzxqr57dy7dw3iv42qe +- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe +- valory/check_stop_trading_abci:0.1.0:bafybeia2m2tinhubnyzujr7o3v6nuvg5ivsr55miuuthfhs57lrz3x53ha - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index fc8534162..2425357a0 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -24,7 +24,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/staking_abci:0.1.0:bafybeicylqrivxldwenj6p3ukxb2buingnrhtymzxcyx3kwxt5qwmwzj2m +- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: From 14c1c54c24c67b55f39dec23c904aa320aa3e50e Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 9 Sep 2024 12:19:00 +0530 Subject: [PATCH 09/11] generators --- packages/packages.json | 14 +++++------ packages/valory/agents/trader/aea-config.yaml | 8 +++---- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 2 +- .../valory/skills/staking_abci/skill.yaml | 2 +- .../skills/staking_abci/tests/test_rounds.py | 24 +++++++++---------- packages/valory/skills/trader_abci/skill.yaml | 6 ++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 2c6d75f4a..d9e30e734 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeihzgjyvhtorugjw3yldznqsbwo3aqpxowm7k2nrvj6qtwpsc7jl7u", "skill/valory/market_manager_abci/0.1.0": "bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra", "skill/valory/decision_maker_abci/0.1.0": "bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy", - "skill/valory/trader_abci/0.1.0": "bafybeigkq76ttun6kczaup2opgrxo33f4zhpc3k22ln6ncr425liezreuu", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeibc6m45ha3tuvui3rbsdqz7k5kzjitk2fnjzxqr57dy7dw3iv42qe", - "skill/valory/staking_abci/0.1.0": "bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeia2m2tinhubnyzujr7o3v6nuvg5ivsr55miuuthfhs57lrz3x53ha", - "agent/valory/trader/0.1.0": "bafybeid5e4lfxj5ipprgowmbohzxwun4jetsnq2umm77zrh5kdil4j62ua", - "service/valory/trader/0.1.0": "bafybeial2lgh5uiherbbytrsxduouqd3zl3b4ukigaxedlb5mojmes5d4u", - "service/valory/trader_pearl/0.1.0": "bafybeighruorx5sa5d4dsv7wo4mjvlgpwrdmi4mphyaxejaju6ojzcpeba" + "skill/valory/trader_abci/0.1.0": "bafybeiayx4uag65yuni7xz5v6dbtscbkcfjyvqpbfnm423jok7kofhz4ta", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigv5gxaizendphmwmmkfilbad7f6uej5ey2p6c6marw5etgmppyfu", + "skill/valory/staking_abci/0.1.0": "bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeid5ihloxfmnmgr44kaxxqdprrkag4mfub6l3fqhabdktlcwtejk6y", + "agent/valory/trader/0.1.0": "bafybeifpazl4oy42yzb3pujy7ak5kfsh4f7m2s4y4huqwru34qk6fhiaju", + "service/valory/trader/0.1.0": "bafybeid75rpd7lahelnanicjc66kqzmovf5gm56qtbgvkaq3qlwq3xitoa", + "service/valory/trader_pearl/0.1.0": "bafybeic6mg67nrevcdzzvgmlxvvbotmuuctng3axlj3atfzxoodqw6c62e" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 0f610941c..a256b7569 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -47,12 +47,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibc6m45ha3tuvui3rbsdqz7k5kzjitk2fnjzxqr57dy7dw3iv42qe +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigv5gxaizendphmwmmkfilbad7f6uej5ey2p6c6marw5etgmppyfu - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/trader_abci:0.1.0:bafybeigkq76ttun6kczaup2opgrxo33f4zhpc3k22ln6ncr425liezreuu -- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe -- valory/check_stop_trading_abci:0.1.0:bafybeia2m2tinhubnyzujr7o3v6nuvg5ivsr55miuuthfhs57lrz3x53ha +- valory/trader_abci:0.1.0:bafybeiayx4uag65yuni7xz5v6dbtscbkcfjyvqpbfnm423jok7kofhz4ta +- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe +- valory/check_stop_trading_abci:0.1.0:bafybeid5ihloxfmnmgr44kaxxqdprrkag4mfub6l3fqhabdktlcwtejk6y - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 9e45a219f..92e2bd72d 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeid5e4lfxj5ipprgowmbohzxwun4jetsnq2umm77zrh5kdil4j62ua +agent: valory/trader:0.1.0:bafybeifpazl4oy42yzb3pujy7ak5kfsh4f7m2s4y4huqwru34qk6fhiaju number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 2726a92d9..8b6d5acb0 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeid5e4lfxj5ipprgowmbohzxwun4jetsnq2umm77zrh5kdil4j62ua +agent: valory/trader:0.1.0:bafybeifpazl4oy42yzb3pujy7ak5kfsh4f7m2s4y4huqwru34qk6fhiaju number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 01076987e..04dc51e65 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui -- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe +- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe behaviours: main: args: {} diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index 8c3d558a1..07b251595 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -19,7 +19,7 @@ fingerprint: tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme tests/test_payloads.py: bafybeiaq2dxpbein6qhipalibi57x6niiydxi6kvbpeqripzlngcgpb3qq - tests/test_rounds.py: bafybeiazmgr4uwq2ayiq4az2ojfscpxouyawrf6yjsu3baz6pr6ziaqs74 + tests/test_rounds.py: bafybeig4vys5fjyk4ytif64cxljulbeilfpvvzg3sq4gnv6s6psujkzuh4 fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index e46ed2bec..a9a69aebf 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -110,7 +110,7 @@ class BaseStakingRoundTestClass(BaseCollectSameUntilThresholdRoundTest): def run_test(self, test_case: RoundTestCase) -> None: """Run the test""" - + # Set initial data self.synchronized_data.update( self._synchronized_data_class, **test_case.initial_data ) @@ -119,19 +119,19 @@ def run_test(self, test_case: RoundTestCase) -> None: synchronized_data=self.synchronized_data, context=mock.MagicMock() ) - result = self._test_round( - test_round=test_round, - round_payloads=test_case.payloads, - synchronized_data_update_fn=lambda sync_data, _: sync_data.update( - **test_case.final_data - ), - synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, - most_voted_payload=test_case.most_voted_payload, - exit_event=test_case.event, + self._complete_run( + self._test_round( + test_round=test_round, + round_payloads=test_case.payloads, + synchronized_data_update_fn=lambda sync_data, _: sync_data.update( + **test_case.final_data + ), + synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, + most_voted_payload=test_case.most_voted_payload, + exit_event=test_case.event, + ) ) - self._complete_run(result) - class TestCallCheckpointRound(BaseStakingRoundTestClass): """Tests for CallCheckpointRound.""" diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index b132a6936..b8257dae4 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -28,9 +28,9 @@ skills: - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeibc6m45ha3tuvui3rbsdqz7k5kzjitk2fnjzxqr57dy7dw3iv42qe -- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe -- valory/check_stop_trading_abci:0.1.0:bafybeia2m2tinhubnyzujr7o3v6nuvg5ivsr55miuuthfhs57lrz3x53ha +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigv5gxaizendphmwmmkfilbad7f6uej5ey2p6c6marw5etgmppyfu +- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe +- valory/check_stop_trading_abci:0.1.0:bafybeid5ihloxfmnmgr44kaxxqdprrkag4mfub6l3fqhabdktlcwtejk6y - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index 2425357a0..e41016a5f 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -24,7 +24,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/staking_abci:0.1.0:bafybeibqntjuxwj5aer5v7l7njbdiimu33jr6cfcc2ju7duufypobg2dfe +- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: From e44049f056287aee00e145ac1652f743da5ed8be Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 9 Sep 2024 12:49:09 +0530 Subject: [PATCH 10/11] coverage --- packages/packages.json | 14 +++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- packages/valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 2 +- packages/valory/skills/staking_abci/skill.yaml | 2 +- .../skills/staking_abci/tests/test_rounds.py | 5 ++--- packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 21 insertions(+), 22 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index d9e30e734..2786ae2de 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeihzgjyvhtorugjw3yldznqsbwo3aqpxowm7k2nrvj6qtwpsc7jl7u", "skill/valory/market_manager_abci/0.1.0": "bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra", "skill/valory/decision_maker_abci/0.1.0": "bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy", - "skill/valory/trader_abci/0.1.0": "bafybeiayx4uag65yuni7xz5v6dbtscbkcfjyvqpbfnm423jok7kofhz4ta", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeigv5gxaizendphmwmmkfilbad7f6uej5ey2p6c6marw5etgmppyfu", - "skill/valory/staking_abci/0.1.0": "bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeid5ihloxfmnmgr44kaxxqdprrkag4mfub6l3fqhabdktlcwtejk6y", - "agent/valory/trader/0.1.0": "bafybeifpazl4oy42yzb3pujy7ak5kfsh4f7m2s4y4huqwru34qk6fhiaju", - "service/valory/trader/0.1.0": "bafybeid75rpd7lahelnanicjc66kqzmovf5gm56qtbgvkaq3qlwq3xitoa", - "service/valory/trader_pearl/0.1.0": "bafybeic6mg67nrevcdzzvgmlxvvbotmuuctng3axlj3atfzxoodqw6c62e" + "skill/valory/trader_abci/0.1.0": "bafybeidpfqzn4k5mgm77aiwqfcs4kc5xxpig62hp6kdptu67as5fcjb67a", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicd5y47cgxldhdhro462fqwkj35jnx5ni5byyk2wb2yiyq2ms3t2m", + "skill/valory/staking_abci/0.1.0": "bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeibyvmohlbhcunb2vxancw532rh5g46bdmnm6klpz7t73ddluopf3i", + "agent/valory/trader/0.1.0": "bafybeifbt3iyq5he7k4sjvlgmxskzcoe2zjvjoweh6ccqsxgvu2qtrzm34", + "service/valory/trader/0.1.0": "bafybeif2sf3fw4aiz2pjt54far4swwc6vynfw3a2fskv7s6ggq4xfbxs7q", + "service/valory/trader_pearl/0.1.0": "bafybeidioan7vor3sq43jmexkdj55s5ll3unnvoq6qzmll2ydt7hx5ute4" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index a256b7569..59708e5d3 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -47,12 +47,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigv5gxaizendphmwmmkfilbad7f6uej5ey2p6c6marw5etgmppyfu +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicd5y47cgxldhdhro462fqwkj35jnx5ni5byyk2wb2yiyq2ms3t2m - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/trader_abci:0.1.0:bafybeiayx4uag65yuni7xz5v6dbtscbkcfjyvqpbfnm423jok7kofhz4ta -- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe -- valory/check_stop_trading_abci:0.1.0:bafybeid5ihloxfmnmgr44kaxxqdprrkag4mfub6l3fqhabdktlcwtejk6y +- valory/trader_abci:0.1.0:bafybeidpfqzn4k5mgm77aiwqfcs4kc5xxpig62hp6kdptu67as5fcjb67a +- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi +- valory/check_stop_trading_abci:0.1.0:bafybeibyvmohlbhcunb2vxancw532rh5g46bdmnm6klpz7t73ddluopf3i - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 92e2bd72d..57b177d4d 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifpazl4oy42yzb3pujy7ak5kfsh4f7m2s4y4huqwru34qk6fhiaju +agent: valory/trader:0.1.0:bafybeifbt3iyq5he7k4sjvlgmxskzcoe2zjvjoweh6ccqsxgvu2qtrzm34 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 8b6d5acb0..20f97dc06 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifpazl4oy42yzb3pujy7ak5kfsh4f7m2s4y4huqwru34qk6fhiaju +agent: valory/trader:0.1.0:bafybeifbt3iyq5he7k4sjvlgmxskzcoe2zjvjoweh6ccqsxgvu2qtrzm34 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 04dc51e65..596577158 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui -- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe +- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi behaviours: main: args: {} diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index 07b251595..b52ba279f 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -19,7 +19,7 @@ fingerprint: tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme tests/test_payloads.py: bafybeiaq2dxpbein6qhipalibi57x6niiydxi6kvbpeqripzlngcgpb3qq - tests/test_rounds.py: bafybeig4vys5fjyk4ytif64cxljulbeilfpvvzg3sq4gnv6s6psujkzuh4 + tests/test_rounds.py: bafybeicvudptxpukxbdg6o4utj62r2ld2pkdnc3w7som33brhrq62dybem fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index a9a69aebf..55b12c92e 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -21,7 +21,7 @@ import json from dataclasses import dataclass, field -from typing import Any, Callable, Dict, FrozenSet, Hashable, List, Mapping, Type +from typing import Any, Callable, Dict, FrozenSet, Hashable, List, Mapping from unittest import mock from unittest.mock import MagicMock, patch @@ -30,7 +30,6 @@ from packages.valory.skills.abstract_round_abci.base import ( AbciAppDB, BaseTxPayload, - CollectSameUntilThresholdRound, get_name, ) from packages.valory.skills.abstract_round_abci.test_tools.rounds import ( @@ -103,7 +102,7 @@ class RoundTestCase: class BaseStakingRoundTestClass(BaseCollectSameUntilThresholdRoundTest): """Base test class for Staking rounds.""" - round_class: Type[CollectSameUntilThresholdRound] + round_class = CallCheckpointRound synchronized_data: SynchronizedData _synchronized_data_class = SynchronizedData _event_class = Event diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index b8257dae4..d404df54f 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -28,9 +28,9 @@ skills: - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeigv5gxaizendphmwmmkfilbad7f6uej5ey2p6c6marw5etgmppyfu -- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe -- valory/check_stop_trading_abci:0.1.0:bafybeid5ihloxfmnmgr44kaxxqdprrkag4mfub6l3fqhabdktlcwtejk6y +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicd5y47cgxldhdhro462fqwkj35jnx5ni5byyk2wb2yiyq2ms3t2m +- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi +- valory/check_stop_trading_abci:0.1.0:bafybeibyvmohlbhcunb2vxancw532rh5g46bdmnm6klpz7t73ddluopf3i - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index e41016a5f..f23a58468 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -24,7 +24,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/staking_abci:0.1.0:bafybeiftd3mrvquvo3mr3tv5pwkj64gc7bfwuoks5yhs2jtamov2vxjcoe +- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: From 3572611f722f97d213e35a10997a0b74cefcb946 Mon Sep 17 00:00:00 2001 From: Ravleen-Solulab Date: Mon, 9 Sep 2024 14:57:26 +0530 Subject: [PATCH 11/11] fix:coverage --- packages/packages.json | 14 ++++++------- packages/valory/agents/trader/aea-config.yaml | 8 ++++---- packages/valory/services/trader/service.yaml | 2 +- .../valory/services/trader_pearl/service.yaml | 2 +- .../skills/check_stop_trading_abci/skill.yaml | 2 +- .../valory/skills/staking_abci/skill.yaml | 2 +- .../skills/staking_abci/tests/test_rounds.py | 20 +------------------ packages/valory/skills/trader_abci/skill.yaml | 6 +++--- .../tx_settlement_multiplexer_abci/skill.yaml | 2 +- 9 files changed, 20 insertions(+), 38 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 2786ae2de..b6acaaf72 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -17,13 +17,13 @@ "contract/valory/relayer/0.1.0": "bafybeihzgjyvhtorugjw3yldznqsbwo3aqpxowm7k2nrvj6qtwpsc7jl7u", "skill/valory/market_manager_abci/0.1.0": "bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra", "skill/valory/decision_maker_abci/0.1.0": "bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy", - "skill/valory/trader_abci/0.1.0": "bafybeidpfqzn4k5mgm77aiwqfcs4kc5xxpig62hp6kdptu67as5fcjb67a", - "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeicd5y47cgxldhdhro462fqwkj35jnx5ni5byyk2wb2yiyq2ms3t2m", - "skill/valory/staking_abci/0.1.0": "bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi", - "skill/valory/check_stop_trading_abci/0.1.0": "bafybeibyvmohlbhcunb2vxancw532rh5g46bdmnm6klpz7t73ddluopf3i", - "agent/valory/trader/0.1.0": "bafybeifbt3iyq5he7k4sjvlgmxskzcoe2zjvjoweh6ccqsxgvu2qtrzm34", - "service/valory/trader/0.1.0": "bafybeif2sf3fw4aiz2pjt54far4swwc6vynfw3a2fskv7s6ggq4xfbxs7q", - "service/valory/trader_pearl/0.1.0": "bafybeidioan7vor3sq43jmexkdj55s5ll3unnvoq6qzmll2ydt7hx5ute4" + "skill/valory/trader_abci/0.1.0": "bafybeieya5jxda7vacxeaowaoyafqtyldzjsloxnj5gcnschxoicfmua3y", + "skill/valory/tx_settlement_multiplexer_abci/0.1.0": "bafybeic6w4wdyvicy3mvmvskp3fg2snthofb3z5kmqhfohqfiv65k7hlgq", + "skill/valory/staking_abci/0.1.0": "bafybeiegy5iny4x3jk2kjuykebxksoqhfl7irdcldbcwzrsvpopxooys2q", + "skill/valory/check_stop_trading_abci/0.1.0": "bafybeif6w4uc3pzrbuuhyktgehvwsq2gxv6udeivhlhijlguhmctxokdqa", + "agent/valory/trader/0.1.0": "bafybeiepmomqpnpmzwe2ed5qexpdnkmeaxhthuia4iqk7v24d6il4mgrh4", + "service/valory/trader/0.1.0": "bafybeigwrd7kjfygxvaxegnfu4l7vmdxcbe7hlur642mskzfoflahjnjdm", + "service/valory/trader_pearl/0.1.0": "bafybeiaxpxlmg7q3tg5sarbzntx443sgjvmkmgfhb4rvxgw4bdxkfejwhe" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/trader/aea-config.yaml b/packages/valory/agents/trader/aea-config.yaml index 59708e5d3..f13912808 100644 --- a/packages/valory/agents/trader/aea-config.yaml +++ b/packages/valory/agents/trader/aea-config.yaml @@ -47,12 +47,12 @@ skills: - valory/reset_pause_abci:0.1.0:bafybeiameewywqigpupy3u2iwnkfczeiiucue74x2l5lbge74rmw6bgaie - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/transaction_settlement_abci:0.1.0:bafybeic3tccdjypuge2lewtlgprwkbb53lhgsgn7oiwzyrcrrptrbeyote -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicd5y47cgxldhdhro462fqwkj35jnx5ni5byyk2wb2yiyq2ms3t2m +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic6w4wdyvicy3mvmvskp3fg2snthofb3z5kmqhfohqfiv65k7hlgq - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/trader_abci:0.1.0:bafybeidpfqzn4k5mgm77aiwqfcs4kc5xxpig62hp6kdptu67as5fcjb67a -- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi -- valory/check_stop_trading_abci:0.1.0:bafybeibyvmohlbhcunb2vxancw532rh5g46bdmnm6klpz7t73ddluopf3i +- valory/trader_abci:0.1.0:bafybeieya5jxda7vacxeaowaoyafqtyldzjsloxnj5gcnschxoicfmua3y +- valory/staking_abci:0.1.0:bafybeiegy5iny4x3jk2kjuykebxksoqhfl7irdcldbcwzrsvpopxooys2q +- valory/check_stop_trading_abci:0.1.0:bafybeif6w4uc3pzrbuuhyktgehvwsq2gxv6udeivhlhijlguhmctxokdqa - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e customs: - valory/mike_strat:0.1.0:bafybeihjiol7f4ch4piwfikurdtfwzsh6qydkbsztpbwbwb2yrqdqf726m diff --git a/packages/valory/services/trader/service.yaml b/packages/valory/services/trader/service.yaml index 57b177d4d..3aa07a502 100644 --- a/packages/valory/services/trader/service.yaml +++ b/packages/valory/services/trader/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeigtuothskwyvrhfosps2bu6suauycolj67dpuxqvnicdrdu7yhtvq fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifbt3iyq5he7k4sjvlgmxskzcoe2zjvjoweh6ccqsxgvu2qtrzm34 +agent: valory/trader:0.1.0:bafybeiepmomqpnpmzwe2ed5qexpdnkmeaxhthuia4iqk7v24d6il4mgrh4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/trader_pearl/service.yaml b/packages/valory/services/trader_pearl/service.yaml index 20f97dc06..cf4ae4b6a 100644 --- a/packages/valory/services/trader_pearl/service.yaml +++ b/packages/valory/services/trader_pearl/service.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibg7bdqpioh4lmvknw3ygnllfku32oca4eq5pqtvdrdsgw6buko7e fingerprint_ignore_patterns: [] -agent: valory/trader:0.1.0:bafybeifbt3iyq5he7k4sjvlgmxskzcoe2zjvjoweh6ccqsxgvu2qtrzm34 +agent: valory/trader:0.1.0:bafybeiepmomqpnpmzwe2ed5qexpdnkmeaxhthuia4iqk7v24d6il4mgrh4 number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/check_stop_trading_abci/skill.yaml b/packages/valory/skills/check_stop_trading_abci/skill.yaml index 596577158..c6630c50b 100644 --- a/packages/valory/skills/check_stop_trading_abci/skill.yaml +++ b/packages/valory/skills/check_stop_trading_abci/skill.yaml @@ -27,7 +27,7 @@ contracts: protocols: [] skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui -- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi +- valory/staking_abci:0.1.0:bafybeiegy5iny4x3jk2kjuykebxksoqhfl7irdcldbcwzrsvpopxooys2q behaviours: main: args: {} diff --git a/packages/valory/skills/staking_abci/skill.yaml b/packages/valory/skills/staking_abci/skill.yaml index b52ba279f..fc42de816 100644 --- a/packages/valory/skills/staking_abci/skill.yaml +++ b/packages/valory/skills/staking_abci/skill.yaml @@ -19,7 +19,7 @@ fingerprint: tests/test_dialogues.py: bafybeidwjk52mufwvkj4cr3xgqycbdzxc6gvosmqyuqdjarnrgwth6wcai tests/test_handers.py: bafybeibnxlwznx3tsdpjpzh62bnp6lq7zdpolyjxfvxeumzz52ljxfzpme tests/test_payloads.py: bafybeiaq2dxpbein6qhipalibi57x6niiydxi6kvbpeqripzlngcgpb3qq - tests/test_rounds.py: bafybeicvudptxpukxbdg6o4utj62r2ld2pkdnc3w7som33brhrq62dybem + tests/test_rounds.py: bafybeih27bkijv6vcqfdbrfxgbtajtqbquekknc77omkxsfgnboiduj7sm fingerprint_ignore_patterns: [] connections: [] contracts: diff --git a/packages/valory/skills/staking_abci/tests/test_rounds.py b/packages/valory/skills/staking_abci/tests/test_rounds.py index 55b12c92e..9703a46df 100644 --- a/packages/valory/skills/staking_abci/tests/test_rounds.py +++ b/packages/valory/skills/staking_abci/tests/test_rounds.py @@ -216,26 +216,8 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass): ) def test_run(self, test_case: RoundTestCase) -> None: """Run the test.""" - self.synchronized_data.update( - self._synchronized_data_class, **test_case.initial_data - ) - - test_round = self.round_class( - synchronized_data=self.synchronized_data, context=mock.MagicMock() - ) - - result = self._test_round( - test_round=test_round, - round_payloads=test_case.payloads, - synchronized_data_update_fn=lambda sync_data, _: sync_data.update( - **test_case.final_data - ), - synchronized_data_attr_checks=test_case.synchronized_data_attr_checks, - most_voted_payload=test_case.most_voted_payload, - exit_event=test_case.event, - ) - self._complete_run(result) + self.run_test(test_case) class TestCheckpointCallPreparedRound: diff --git a/packages/valory/skills/trader_abci/skill.yaml b/packages/valory/skills/trader_abci/skill.yaml index d404df54f..10905010d 100644 --- a/packages/valory/skills/trader_abci/skill.yaml +++ b/packages/valory/skills/trader_abci/skill.yaml @@ -28,9 +28,9 @@ skills: - valory/termination_abci:0.1.0:bafybeif2zim2de356eo3sipkmoev5emwadpqqzk3huwqarywh4tmqt3vzq - valory/market_manager_abci:0.1.0:bafybeicymkyk7e5rohauml6xazai6mv2rqd3euz3ifbk2ftfkylhpgo4ra - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeicd5y47cgxldhdhro462fqwkj35jnx5ni5byyk2wb2yiyq2ms3t2m -- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi -- valory/check_stop_trading_abci:0.1.0:bafybeibyvmohlbhcunb2vxancw532rh5g46bdmnm6klpz7t73ddluopf3i +- valory/tx_settlement_multiplexer_abci:0.1.0:bafybeic6w4wdyvicy3mvmvskp3fg2snthofb3z5kmqhfohqfiv65k7hlgq +- valory/staking_abci:0.1.0:bafybeiegy5iny4x3jk2kjuykebxksoqhfl7irdcldbcwzrsvpopxooys2q +- valory/check_stop_trading_abci:0.1.0:bafybeif6w4uc3pzrbuuhyktgehvwsq2gxv6udeivhlhijlguhmctxokdqa - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: diff --git a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml index f23a58468..065737d9d 100644 --- a/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml +++ b/packages/valory/skills/tx_settlement_multiplexer_abci/skill.yaml @@ -24,7 +24,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeiar2yhzxacfe3qqamqhaihtlcimquwedffctw55sowx6rac3cm3ui - valory/decision_maker_abci:0.1.0:bafybeicr3o4z5ytp6njmsxlj3p6cbaxyad6tdv5kyoxaeon5da2wn6hxqy -- valory/staking_abci:0.1.0:bafybeifrrhslhov7uamkcl5xllftftqkhwpvzly5hlporvslif4gxq3wqi +- valory/staking_abci:0.1.0:bafybeiegy5iny4x3jk2kjuykebxksoqhfl7irdcldbcwzrsvpopxooys2q - valory/mech_interact_abci:0.1.0:bafybeih2cck5xu6yaibomwtm5zbcp6llghr3ighdnk56fzwu3ihu5xx35e behaviours: main: