diff --git a/commands/errors.go b/commands/errors.go index 4ce8df2508..75704ab4d2 100644 --- a/commands/errors.go +++ b/commands/errors.go @@ -33,6 +33,7 @@ var ( ErrMustBeLessThan150 = errors.New("must be less than 150") ErrMustBeAtMost1M = errors.New("must be at most 1000000") ErrMustBeAtMost100 = errors.New("must be at most 100") + ErrMustBeAtMost200 = errors.New("must be at most 200") ErrMustBeAtMost2048 = errors.New("must be at most 2048") ErrMustBeWithinRange7 = errors.New("must be between -7 and 7") ErrIsNotValid = errors.New("is not a valid value") diff --git a/commands/proposal_submission.go b/commands/proposal_submission.go index d6c268ca17..1e1a7193a1 100644 --- a/commands/proposal_submission.go +++ b/commands/proposal_submission.go @@ -385,8 +385,8 @@ func checkReferralProgramChanges(changes *vegapb.ReferralProgramChanges, enactme } if changes.WindowLength == 0 { errs.AddForProperty("update_referral_program.changes.window_length", ErrIsRequired) - } else if changes.WindowLength > 100 { - errs.AddForProperty("update_referral_program.changes.window_length", ErrMustBeAtMost100) + } else if changes.WindowLength > 200 { + errs.AddForProperty("update_referral_program.changes.window_length", ErrMustBeAtMost200) } tiers := map[string]struct{}{} @@ -449,8 +449,8 @@ func checkVolumeRebateProgramChanges(changes *vegapb.VolumeRebateProgramChanges, } if changes.WindowLength == 0 { errs.AddForProperty("update_volume_rebate_program.changes.window_length", ErrIsRequired) - } else if changes.WindowLength > 100 { - errs.AddForProperty("update_volume_rebate_program.changes.window_length", ErrMustBeAtMost100) + } else if changes.WindowLength > 200 { + errs.AddForProperty("update_volume_rebate_program.changes.window_length", ErrMustBeAtMost200) } for i, tier := range changes.BenefitTiers { errs.Merge(checkVolumeRebateBenefitTier(i, tier)) @@ -497,8 +497,8 @@ func checkVolumeDiscountProgramChanges(changes *vegapb.VolumeDiscountProgramChan } if changes.WindowLength == 0 { errs.AddForProperty("update_volume_discount_program.changes.window_length", ErrIsRequired) - } else if changes.WindowLength > 100 { - errs.AddForProperty("update_volume_discount_program.changes.window_length", ErrMustBeAtMost100) + } else if changes.WindowLength > 200 { + errs.AddForProperty("update_volume_discount_program.changes.window_length", ErrMustBeAtMost200) } for i, tier := range changes.BenefitTiers { errs.Merge(checkVolumeBenefitTier(i, tier)) diff --git a/commands/proposal_submission_update_referral_program_test.go b/commands/proposal_submission_update_referral_program_test.go index 2df7549bfb..3498f2f36f 100644 --- a/commands/proposal_submission_update_referral_program_test.go +++ b/commands/proposal_submission_update_referral_program_test.go @@ -149,14 +149,14 @@ func testSubmissionForReferralProgramUpdateWithWindowLengthOverLimitFails(t *tes Change: &types.ProposalTerms_UpdateReferralProgram{ UpdateReferralProgram: &types.UpdateReferralProgram{ Changes: &types.ReferralProgramChanges{ - WindowLength: 101, + WindowLength: 201, }, }, }, }, }) - assert.Contains(t, err.Get("proposal_submission.terms.change.update_referral_program.changes.window_length"), commands.ErrMustBeAtMost100) + assert.Contains(t, err.Get("proposal_submission.terms.change.update_referral_program.changes.window_length"), commands.ErrMustBeAtMost200) } func testSubmissionForReferralProgramUpdateWithoutTierMinimumRunningNotionalTakerVolumeFails(t *testing.T) { diff --git a/commands/proposal_submission_update_volume_discount_program_test.go b/commands/proposal_submission_update_volume_discount_program_test.go index 9278e3fe0d..aa2edb17db 100644 --- a/commands/proposal_submission_update_volume_discount_program_test.go +++ b/commands/proposal_submission_update_volume_discount_program_test.go @@ -134,14 +134,14 @@ func testSubmissionForVolumeDiscountProgramUpdateWithWindowLengthOverLimitFails( Change: &types.ProposalTerms_UpdateVolumeDiscountProgram{ UpdateVolumeDiscountProgram: &types.UpdateVolumeDiscountProgram{ Changes: &types.VolumeDiscountProgramChanges{ - WindowLength: 101, + WindowLength: 201, }, }, }, }, }) - assert.Contains(t, err.Get("proposal_submission.terms.change.update_volume_discount_program.changes.window_length"), commands.ErrMustBeAtMost100) + assert.Contains(t, err.Get("proposal_submission.terms.change.update_volume_discount_program.changes.window_length"), commands.ErrMustBeAtMost200) } func testSubmissionForVolumeDiscountProgramUpdateWithoutTierMinimumRunningNotionalTakerVolumeFails(t *testing.T) {