From 79975171dfcf2e6b6ea18e57f8575f4fb6867b5d Mon Sep 17 00:00:00 2001 From: Charlie Date: Thu, 16 May 2024 16:12:07 +0100 Subject: [PATCH] fix: only drop rejected transfers from cache --- vega_sim/api/data.py | 3 --- vega_sim/local_data_cache.py | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/vega_sim/api/data.py b/vega_sim/api/data.py index 8dbbcce06..84d159dd6 100644 --- a/vega_sim/api/data.py +++ b/vega_sim/api/data.py @@ -2371,9 +2371,6 @@ def list_transfers( for transfer_node in transfer_nodes: transfer = transfer_node.transfer - if transfer.status == events_protos.Transfer.Status.STATUS_REJECTED: - continue - if transfer.asset not in asset_dp: asset_dp[transfer.asset] = get_asset_decimals( asset_id=transfer.asset, data_client=data_client diff --git a/vega_sim/local_data_cache.py b/vega_sim/local_data_cache.py index 506e2c95d..cc95b1a08 100644 --- a/vega_sim/local_data_cache.py +++ b/vega_sim/local_data_cache.py @@ -453,14 +453,12 @@ def initialise_market_data( def initialise_transfer_monitoring( self, ): - base_transfers = [] - - base_transfers.extend( - data.list_transfers(data_client=self._trading_data_client) - ) + base_transfers = data.list_transfers(data_client=self._trading_data_client) with self.transfers_lock: for t in base_transfers: + if t.status != events_protos.Transfer.Status.STATUS_REJECTED: + continue self._transfer_state_from_feed.setdefault(t.party_to, {})[t.id] = t def initialise_network_parameters(self):