From b9760567be5cdfe9fb4fd582c7ed983a67ce117f Mon Sep 17 00:00:00 2001 From: Charlie Date: Mon, 12 Aug 2024 18:55:59 +0100 Subject: [PATCH] fix: devops bot tests --- toolkit.py | 49 ++++++++++++++++++++++++++++++ vega_sim/scenario/common/agents.py | 3 +- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 toolkit.py diff --git a/toolkit.py b/toolkit.py new file mode 100644 index 000000000..11bde33f0 --- /dev/null +++ b/toolkit.py @@ -0,0 +1,49 @@ +from typing import Generator + +from vega_sim.null_service import VegaServiceNull + + +PROPOSER = "PROPOSER" + + +def vega(): + vega = VegaServiceNull(use_full_vega_wallet=True) + vega.start() + + # Create the proposal key + vega.create_key(PROPOSER) + vega.wait_fn(1) + vega.wait_for_total_catchup() + # Mint to the proposal key + vega.mint(PROPOSER, vega.find_asset_id(symbol="VOTE", enabled=True), 10000) + vega.wait_fn(1) + vega.wait_for_total_catchup() + + return vega + + +def usdt(vega: VegaServiceNull) -> str: + vega.create_asset(PROPOSER, "Tether", "USDT", 6, 1000000) + vega.wait_fn(1) + vega.wait_for_total_catchup() + return vega.find_asset_id("USDT") + + +def futr(vega): + """Creates a simple future market""" + pass + + +def spot(vega): + """Creates a simple spot market""" + pass + + +def perp(vega): + """Creates a simple perpetual market""" + pass + + +def epoch(vega): + """Creates a simple epoch""" + pass diff --git a/vega_sim/scenario/common/agents.py b/vega_sim/scenario/common/agents.py index 028c9e94f..7e1a5f660 100644 --- a/vega_sim/scenario/common/agents.py +++ b/vega_sim/scenario/common/agents.py @@ -3959,7 +3959,8 @@ def _check(self) -> bool: amm for amm in self.vega.list_amms( market_id=self.market_id, - party_id=self._public_key, + key_name=self.key_name, + wallet_name=self.wallet_name, status=vega_protos_events.AMM.Status.Value("STATUS_ACTIVE"), ) if amm.status == vega_protos_events.AMM.Status.Value("STATUS_ACTIVE")