Skip to content

Commit

Permalink
Merge branch 'develop' into tick_size
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyletang authored Feb 27, 2024
2 parents 3922796 + a2b2b84 commit 1dc964e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

- [10686](https://github.com/vegaprotocol/vega/issues/10686) - Allow transfers to filter by from and to account type.
- [10686](https://github.com/vegaprotocol/vega/issues/10764) - Network will now only trade within price monitoring bounds.
- [](https://github.com/vegaprotocol/vega/issues/xxx)
- [10770](https://github.com/vegaprotocol/vega/issues/10770) - Increase price monitoring triggers to 100.


### 🐛 Fixes

Expand Down
4 changes: 2 additions & 2 deletions commands/proposal_submission.go
Original file line number Diff line number Diff line change
Expand Up @@ -1028,8 +1028,8 @@ func checkPriceMonitoring(parameters *protoTypes.PriceMonitoringParameters, pare
return errs
}

if len(parameters.Triggers) > 5 {
errs.AddForProperty(fmt.Sprintf("%s.price_monitoring_parameters.triggers", parentProperty), errors.New("maximum 5 triggers allowed"))
if len(parameters.Triggers) > 100 {
errs.AddForProperty(fmt.Sprintf("%s.price_monitoring_parameters.triggers", parentProperty), errors.New("maximum 100 triggers allowed"))
}

for i, trigger := range parameters.Triggers {
Expand Down
16 changes: 7 additions & 9 deletions commands/proposal_submission_new_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,28 +677,26 @@ func testPriceMonitoringChangeSubmissionWithTriggersSucceeds(t *testing.T) {
}

func testNewMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) {
triggers := []*vegapb.PriceMonitoringTrigger{}
for i := 0; i <= 100; i++ {
triggers = append(triggers, &vegapb.PriceMonitoringTrigger{})
}

err := checkProposalSubmission(&commandspb.ProposalSubmission{
Terms: &vegapb.ProposalTerms{
Change: &vegapb.ProposalTerms_NewMarket{
NewMarket: &vegapb.NewMarket{
Changes: &vegapb.NewMarketConfiguration{
PriceMonitoringParameters: &vegapb.PriceMonitoringParameters{
Triggers: []*vegapb.PriceMonitoringTrigger{
{},
{},
{},
{},
{},
{},
},
Triggers: triggers,
},
},
},
},
},
})

assert.Contains(t, err.Get("proposal_submission.terms.change.new_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 5 triggers allowed"))
assert.Contains(t, err.Get("proposal_submission.terms.change.new_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 100 triggers allowed"))
}

func testPriceMonitoringChangeSubmissionWithoutTriggerHorizonFails(t *testing.T) {
Expand Down
16 changes: 7 additions & 9 deletions commands/proposal_submission_new_spot_market_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ func testSpotPriceMonitoringChangeSubmissionWithTriggersSucceeds(t *testing.T) {
}

func testNewSpotMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) {
triggers := []*vegapb.PriceMonitoringTrigger{}
for i := 0; i <= 100; i++ {
triggers = append(triggers, &vegapb.PriceMonitoringTrigger{})
}

err := checkProposalSubmission(&commandspb.ProposalSubmission{
Terms: &protoTypes.ProposalTerms{
Change: &protoTypes.ProposalTerms_NewSpotMarket{
Expand All @@ -508,22 +513,15 @@ func testNewSpotMarketChangeSubmissionWithTooManyPMTriggersFails(t *testing.T) {
Product: &protoTypes.InstrumentConfiguration_Spot{},
},
PriceMonitoringParameters: &protoTypes.PriceMonitoringParameters{
Triggers: []*protoTypes.PriceMonitoringTrigger{
{},
{},
{},
{},
{},
{},
},
Triggers: triggers,
},
},
},
},
},
})

assert.Contains(t, err.Get("proposal_submission.terms.change.new_spot_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 5 triggers allowed"))
assert.Contains(t, err.Get("proposal_submission.terms.change.new_spot_market.changes.price_monitoring_parameters.triggers"), errors.New("maximum 100 triggers allowed"))
}

func testSpotPriceMonitoringChangeSubmissionWithoutTriggerHorizonFails(t *testing.T) {
Expand Down

0 comments on commit 1dc964e

Please sign in to comment.