Skip to content

Commit

Permalink
feat: Don't immediately leave opening auction in fuzz tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMcL committed Jan 31, 2024
1 parent d8f03d8 commit 81fa7df
Show file tree
Hide file tree
Showing 39 changed files with 108 additions and 143 deletions.
33 changes: 15 additions & 18 deletions vega_sim/api/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2505,10 +2505,7 @@ def estimate_position(
include_collateral_increase_in_available_collateral: bool = True,
scale_liquidation_price_to_market_decimals: bool = False,
asset_decimals: Optional[Dict[str, int]] = {},
) -> Tuple[
MarginEstimate,
LiquidationEstimate,
]:
) -> Tuple[MarginEstimate, LiquidationEstimate,]:
if orders is not None:
proto_orders = [
data_node_protos_v2.trading_data.OrderInfo(
Expand Down Expand Up @@ -2591,13 +2588,13 @@ def list_referral_sets(
referrer: Optional[str] = None,
referee: Optional[str] = None,
) -> Dict[str, ReferralSet]:
response: List[data_node_protos_v2.trading_data.ReferralSet] = (
data_raw.list_referral_sets(
data_client=data_client,
referral_set_id=referral_set_id,
referrer=referrer,
referee=referee,
)
response: List[
data_node_protos_v2.trading_data.ReferralSet
] = data_raw.list_referral_sets(
data_client=data_client,
referral_set_id=referral_set_id,
referrer=referrer,
referee=referee,
)
referral_sets = {}
for referral_set in response:
Expand All @@ -2611,13 +2608,13 @@ def list_referral_set_referees(
referrer: Optional[str] = None,
referee: Optional[str] = None,
) -> Dict[str, Dict[str, ReferralSetReferee]]:
response: List[data_node_protos_v2.trading_data.ReferralSetReferee] = (
data_raw.list_referral_set_referees(
data_client=data_client,
referral_set_id=referral_set_id,
referrer=referrer,
referee=referee,
)
response: List[
data_node_protos_v2.trading_data.ReferralSetReferee
] = data_raw.list_referral_set_referees(
data_client=data_client,
referral_set_id=referral_set_id,
referrer=referrer,
referee=referee,
)
referral_set_referees = defaultdict(dict)
for referral_set_referee in response:
Expand Down
18 changes: 9 additions & 9 deletions vega_sim/local_data_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,15 @@ def initialise_market_data(
]
with self.market_data_lock:
for market_id in market_ids:
self.market_data_from_feed_store[market_id] = (
data.get_latest_market_data(
market_id,
data_client=self._trading_data_client,
market_price_decimals_map=self._market_price_decimals,
market_position_decimals_map=self._market_pos_decimals,
asset_decimals_map=self._asset_decimals,
market_to_asset_map=self._market_to_asset,
)
self.market_data_from_feed_store[
market_id
] = data.get_latest_market_data(
market_id,
data_client=self._trading_data_client,
market_price_decimals_map=self._market_price_decimals,
market_position_decimals_map=self._market_pos_decimals,
asset_decimals_map=self._asset_decimals,
market_to_asset_map=self._market_to_asset,
)

def initialise_transfer_monitoring(
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/blockexplorer/api/v1/blockexplorer_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vega_sim/proto/blockexplorer/api/v1/blockexplorer_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class ListTransactionsRequest(_message.Message):
def __init__(
self, key: _Optional[str] = ..., value: _Optional[str] = ...
) -> None: ...

BEFORE_FIELD_NUMBER: _ClassVar[int]
AFTER_FIELD_NUMBER: _ClassVar[int]
FILTERS_FIELD_NUMBER: _ClassVar[int]
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/data_node/api/v2/trading_data_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vega_sim/proto/data_node/api/v2/trading_data_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,6 @@ class ListTransfersRequest(_message.Message):
SCOPE_UNSPECIFIED: _ClassVar[ListTransfersRequest.Scope]
SCOPE_INDIVIDUAL: _ClassVar[ListTransfersRequest.Scope]
SCOPE_TEAM: _ClassVar[ListTransfersRequest.Scope]

SCOPE_UNSPECIFIED: ListTransfersRequest.Scope
SCOPE_INDIVIDUAL: ListTransfersRequest.Scope
SCOPE_TEAM: ListTransfersRequest.Scope
Expand Down Expand Up @@ -2902,7 +2901,6 @@ class ListGovernanceDataRequest(_message.Message):
TYPE_UPDATE_MARKET_STATE: _ClassVar[ListGovernanceDataRequest.Type]
TYPE_UPDATE_REFERRAL_PROGRAM: _ClassVar[ListGovernanceDataRequest.Type]
TYPE_UPDATE_VOLUME_DISCOUNT_PROGRAM: _ClassVar[ListGovernanceDataRequest.Type]

TYPE_UNSPECIFIED: ListGovernanceDataRequest.Type
TYPE_ALL: ListGovernanceDataRequest.Type
TYPE_NEW_MARKET: ListGovernanceDataRequest.Type
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/api/v1/core_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vega_sim/proto/vega/api/v1/core_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class SubmitTransactionRequest(_message.Message):
TYPE_ASYNC: _ClassVar[SubmitTransactionRequest.Type]
TYPE_SYNC: _ClassVar[SubmitTransactionRequest.Type]
TYPE_COMMIT: _ClassVar[SubmitTransactionRequest.Type]

TYPE_UNSPECIFIED: SubmitTransactionRequest.Type
TYPE_ASYNC: SubmitTransactionRequest.Type
TYPE_SYNC: SubmitTransactionRequest.Type
Expand Down Expand Up @@ -130,7 +129,6 @@ class SubmitRawTransactionRequest(_message.Message):
TYPE_ASYNC: _ClassVar[SubmitRawTransactionRequest.Type]
TYPE_SYNC: _ClassVar[SubmitRawTransactionRequest.Type]
TYPE_COMMIT: _ClassVar[SubmitRawTransactionRequest.Type]

TYPE_UNSPECIFIED: SubmitRawTransactionRequest.Type
TYPE_ASYNC: SubmitRawTransactionRequest.Type
TYPE_SYNC: SubmitRawTransactionRequest.Type
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/api/v1/corestate_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vega_sim/proto/vega/assets_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vega_sim/proto/vega/assets_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class Asset(_message.Message):
STATUS_REJECTED: _ClassVar[Asset.Status]
STATUS_PENDING_LISTING: _ClassVar[Asset.Status]
STATUS_ENABLED: _ClassVar[Asset.Status]

STATUS_UNSPECIFIED: Asset.Status
STATUS_PROPOSED: Asset.Status
STATUS_REJECTED: Asset.Status
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/chain_events_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vega_sim/proto/vega/checkpoint/v1/checkpoint_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vega_sim/proto/vega/commands/v1/commands_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions vega_sim/proto/vega/commands/v1/commands_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ class UpdateMarginMode(_message.Message):
MODE_UNSPECIFIED: _ClassVar[UpdateMarginMode.Mode]
MODE_CROSS_MARGIN: _ClassVar[UpdateMarginMode.Mode]
MODE_ISOLATED_MARGIN: _ClassVar[UpdateMarginMode.Mode]

MODE_UNSPECIFIED: UpdateMarginMode.Mode
MODE_CROSS_MARGIN: UpdateMarginMode.Mode
MODE_ISOLATED_MARGIN: UpdateMarginMode.Mode
Expand Down Expand Up @@ -397,7 +396,6 @@ class UndelegateSubmission(_message.Message):
METHOD_UNSPECIFIED: _ClassVar[UndelegateSubmission.Method]
METHOD_NOW: _ClassVar[UndelegateSubmission.Method]
METHOD_AT_END_OF_EPOCH: _ClassVar[UndelegateSubmission.Method]

METHOD_UNSPECIFIED: UndelegateSubmission.Method
METHOD_NOW: UndelegateSubmission.Method
METHOD_AT_END_OF_EPOCH: UndelegateSubmission.Method
Expand Down Expand Up @@ -523,7 +521,6 @@ class CreateReferralSet(_message.Message):
closed: bool = ...,
allow_list: _Optional[_Iterable[str]] = ...,
) -> None: ...

IS_TEAM_FIELD_NUMBER: _ClassVar[int]
TEAM_FIELD_NUMBER: _ClassVar[int]
is_team: bool
Expand Down Expand Up @@ -557,7 +554,6 @@ class UpdateReferralSet(_message.Message):
closed: bool = ...,
allow_list: _Optional[_Iterable[str]] = ...,
) -> None: ...

ID_FIELD_NUMBER: _ClassVar[int]
IS_TEAM_FIELD_NUMBER: _ClassVar[int]
TEAM_FIELD_NUMBER: _ClassVar[int]
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/commands/v1/data_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vega_sim/proto/vega/commands/v1/data_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class OracleDataSubmission(_message.Message):
ORACLE_SOURCE_OPEN_ORACLE: _ClassVar[OracleDataSubmission.OracleSource]
ORACLE_SOURCE_JSON: _ClassVar[OracleDataSubmission.OracleSource]
ORACLE_SOURCE_ETHEREUM: _ClassVar[OracleDataSubmission.OracleSource]

ORACLE_SOURCE_UNSPECIFIED: OracleDataSubmission.OracleSource
ORACLE_SOURCE_OPEN_ORACLE: OracleDataSubmission.OracleSource
ORACLE_SOURCE_JSON: OracleDataSubmission.OracleSource
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/commands/v1/signature_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vega_sim/proto/vega/commands/v1/transaction_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vega_sim/proto/vega/commands/v1/validator_commands_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vega_sim/proto/vega/commands/v1/validator_commands_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class NodeVote(_message.Message):
TYPE_SIGNER_THRESHOLD_SET: _ClassVar[NodeVote.Type]
TYPE_GOVERNANCE_VALIDATE_ASSET: _ClassVar[NodeVote.Type]
TYPE_ETHEREUM_CONTRACT_CALL_RESULT: _ClassVar[NodeVote.Type]

TYPE_UNSPECIFIED: NodeVote.Type
TYPE_STAKE_DEPOSITED: NodeVote.Type
TYPE_STAKE_REMOVED: NodeVote.Type
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/data/v1/data_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vega_sim/proto/vega/data/v1/spec_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vega_sim/proto/vega/data/v1/spec_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class PropertyKey(_message.Message):
TYPE_BOOLEAN: _ClassVar[PropertyKey.Type]
TYPE_DECIMAL: _ClassVar[PropertyKey.Type]
TYPE_TIMESTAMP: _ClassVar[PropertyKey.Type]

TYPE_UNSPECIFIED: PropertyKey.Type
TYPE_EMPTY: PropertyKey.Type
TYPE_INTEGER: PropertyKey.Type
Expand Down Expand Up @@ -68,7 +67,6 @@ class Condition(_message.Message):
OPERATOR_GREATER_THAN_OR_EQUAL: _ClassVar[Condition.Operator]
OPERATOR_LESS_THAN: _ClassVar[Condition.Operator]
OPERATOR_LESS_THAN_OR_EQUAL: _ClassVar[Condition.Operator]

OPERATOR_UNSPECIFIED: Condition.Operator
OPERATOR_EQUALS: Condition.Operator
OPERATOR_GREATER_THAN: Condition.Operator
Expand Down
6 changes: 3 additions & 3 deletions vega_sim/proto/vega/data_source_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion vega_sim/proto/vega/data_source_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ class DataSourceSpec(_message.Message):
STATUS_UNSPECIFIED: _ClassVar[DataSourceSpec.Status]
STATUS_ACTIVE: _ClassVar[DataSourceSpec.Status]
STATUS_DEACTIVATED: _ClassVar[DataSourceSpec.Status]

STATUS_UNSPECIFIED: DataSourceSpec.Status
STATUS_ACTIVE: DataSourceSpec.Status
STATUS_DEACTIVATED: DataSourceSpec.Status
Expand Down
Loading

0 comments on commit 81fa7df

Please sign in to comment.