Skip to content

Commit

Permalink
fix: remove bond penalty from settlement test (#511)
Browse files Browse the repository at this point in the history
* chore: bump vega tag

* fix: remove bond penalties from test

* fix: run make black

* fix: update tags
  • Loading branch information
cdummett authored Sep 18, 2023
1 parent 3d95815 commit ffea423
Show file tree
Hide file tree
Showing 9 changed files with 1,024 additions and 746 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VEGA_SIM_VEGA_TAG=a4f2e9b676780bb6a0b60239c7a36ac9712820e4
VEGA_SIM_VEGA_TAG="cd631fba15cae959e7a13b9dbd39ece359d83fc0"
VEGA_SIM_CONSOLE_TAG=develop
VEGA_DEFAULT_KEY_NAME='Key 1'
VEGA_SIM_NETWORKS_INTERNAL_TAG=main
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline {
disableConcurrentBuilds(abortPrevious: true)
}
parameters {
string( name: 'VEGA_VERSION', defaultValue: 'a4f2e9b676780bb6a0b60239c7a36ac9712820e4',
string( name: 'VEGA_VERSION', defaultValue: 'cd631fba15cae959e7a13b9dbd39ece359d83fc0',
description: 'Git branch, tag or hash of the vegaprotocol/vega repository')
string( name: 'VEGACAPSULE_VERSION', defaultValue: 'main',
description: 'Git branch, tag or hash of the vegaprotocol/vegacapsule repository')
Expand Down
9 changes: 9 additions & 0 deletions tests/integration/test_settlement.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

from tests.integration.utils.fixtures import (
create_and_faucet_wallet,
build_basic_market,
vega_service,
MM_WALLET,
Expand All @@ -26,6 +27,14 @@ def test_settlement(vega_service: VegaServiceNull):
settlement_price = random.randint(80, 120)
trade_size = random.randint(1, 10)

create_and_faucet_wallet(vega, wallet=MM_WALLET, symbol="VOTE", amount=1000)
vega.update_network_parameter(
proposal_key=MM_WALLET.name,
parameter="market.liquidity.sla.nonPerformanceBondPenaltyMax",
new_value="0",
)
vega.wait_fn(1)

build_basic_market(
vega,
mint_amount=participants_initial_deposit,
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/utils/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@


def create_and_faucet_wallet(
vega: VegaServiceNull, wallet: WalletConfig, amount: float = 1e4
vega: VegaServiceNull,
wallet: WalletConfig,
symbol: Optional[str] = None,
amount: float = 1e4,
):
asset_id = vega.find_asset_id(symbol=ASSET_NAME)
asset_id = vega.find_asset_id(symbol=symbol if symbol is not None else ASSET_NAME)
vega.create_key(wallet.name)
vega.mint(wallet.name, asset_id, amount)

Expand Down
1,064 changes: 563 additions & 501 deletions vega_sim/proto/data_node/api/v2/trading_data_pb2.py

Large diffs are not rendered by default.

192 changes: 192 additions & 0 deletions vega_sim/proto/data_node/api/v2/trading_data_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ def __init__(self, channel):
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTransfersRequest.SerializeToString,
response_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTransfersResponse.FromString,
)
self.GetTransfer = channel.unary_unary(
"/datanode.api.v2.TradingDataService/GetTransfer",
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetTransferRequest.SerializeToString,
response_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetTransferResponse.FromString,
)
self.GetNetworkLimits = channel.unary_unary(
"/datanode.api.v2.TradingDataService/GetNetworkLimits",
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetNetworkLimitsRequest.SerializeToString,
Expand Down Expand Up @@ -502,6 +507,21 @@ def __init__(self, channel):
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetReferralSetStatsRequest.SerializeToString,
response_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetReferralSetStatsResponse.FromString,
)
self.ListTeams = channel.unary_unary(
"/datanode.api.v2.TradingDataService/ListTeams",
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamsRequest.SerializeToString,
response_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamsResponse.FromString,
)
self.ListTeamReferees = channel.unary_unary(
"/datanode.api.v2.TradingDataService/ListTeamReferees",
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereesRequest.SerializeToString,
response_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereesResponse.FromString,
)
self.ListTeamRefereeHistory = channel.unary_unary(
"/datanode.api.v2.TradingDataService/ListTeamRefereeHistory",
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereeHistoryRequest.SerializeToString,
response_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereeHistoryResponse.FromString,
)
self.ExportNetworkHistory = channel.unary_stream(
"/datanode.api.v2.TradingDataService/ExportNetworkHistory",
request_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ExportNetworkHistoryRequest.SerializeToString,
Expand Down Expand Up @@ -749,6 +769,15 @@ def ListTransfers(self, request, context):
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def GetTransfer(self, request, context):
"""Get transfer by ID
Get a specific transfer by ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def GetNetworkLimits(self, request, context):
"""Get network limits
Expand Down Expand Up @@ -1432,6 +1461,33 @@ def GetReferralSetStats(self, request, context):
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListTeams(self, request, context):
"""List teams
Get a list of all teams, or for a specific team by using team ID, or party ID of a referrer or referee
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListTeamReferees(self, request, context):
"""List team referees
Get a list of all referees for a given team ID
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListTeamRefereeHistory(self, request, context):
"""List referee team history
Get a list of a referee's team history, i.e. the teams that a referee has been a member of and transferred from/to.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ExportNetworkHistory(self, request, context):
"""Export network history as CSV
Expand Down Expand Up @@ -1626,6 +1682,11 @@ def add_TradingDataServiceServicer_to_server(servicer, server):
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTransfersRequest.FromString,
response_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTransfersResponse.SerializeToString,
),
"GetTransfer": grpc.unary_unary_rpc_method_handler(
servicer.GetTransfer,
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetTransferRequest.FromString,
response_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetTransferResponse.SerializeToString,
),
"GetNetworkLimits": grpc.unary_unary_rpc_method_handler(
servicer.GetNetworkLimits,
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetNetworkLimitsRequest.FromString,
Expand Down Expand Up @@ -1996,6 +2057,21 @@ def add_TradingDataServiceServicer_to_server(servicer, server):
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetReferralSetStatsRequest.FromString,
response_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.GetReferralSetStatsResponse.SerializeToString,
),
"ListTeams": grpc.unary_unary_rpc_method_handler(
servicer.ListTeams,
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamsRequest.FromString,
response_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamsResponse.SerializeToString,
),
"ListTeamReferees": grpc.unary_unary_rpc_method_handler(
servicer.ListTeamReferees,
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereesRequest.FromString,
response_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereesResponse.SerializeToString,
),
"ListTeamRefereeHistory": grpc.unary_unary_rpc_method_handler(
servicer.ListTeamRefereeHistory,
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereeHistoryRequest.FromString,
response_serializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereeHistoryResponse.SerializeToString,
),
"ExportNetworkHistory": grpc.unary_stream_rpc_method_handler(
servicer.ExportNetworkHistory,
request_deserializer=data__node_dot_api_dot_v2_dot_trading__data__pb2.ExportNetworkHistoryRequest.FromString,
Expand Down Expand Up @@ -2684,6 +2760,35 @@ def ListTransfers(
metadata,
)

@staticmethod
def GetTransfer(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/datanode.api.v2.TradingDataService/GetTransfer",
data__node_dot_api_dot_v2_dot_trading__data__pb2.GetTransferRequest.SerializeToString,
data__node_dot_api_dot_v2_dot_trading__data__pb2.GetTransferResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def GetNetworkLimits(
request,
Expand Down Expand Up @@ -4830,6 +4935,93 @@ def GetReferralSetStats(
metadata,
)

@staticmethod
def ListTeams(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/datanode.api.v2.TradingDataService/ListTeams",
data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamsRequest.SerializeToString,
data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamsResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def ListTeamReferees(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/datanode.api.v2.TradingDataService/ListTeamReferees",
data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereesRequest.SerializeToString,
data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereesResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def ListTeamRefereeHistory(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/datanode.api.v2.TradingDataService/ListTeamRefereeHistory",
data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereeHistoryRequest.SerializeToString,
data__node_dot_api_dot_v2_dot_trading__data__pb2.ListTeamRefereeHistoryResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def ExportNetworkHistory(
request,
Expand Down
Loading

0 comments on commit ffea423

Please sign in to comment.