Skip to content

Commit

Permalink
Merge pull request #11589 from vegaprotocol/11531-update-tests
Browse files Browse the repository at this point in the history
test: update test to include changes to protos
  • Loading branch information
jeremyletang authored Aug 15, 2024
2 parents 1e2ed42 + f7b47e6 commit 497db9f
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
80 changes: 80 additions & 0 deletions datanode/sqlstore/referral_programs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,32 @@ func TestReferralPrograms_AddReferralProgram(t *testing.T) {
MinimumEpochs: "10",
ReferralRewardFactor: "0.0001",
ReferralDiscountFactor: "0.0001",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.00002",
LiquidityRewardFactor: "0.00004",
MakerRewardFactor: "0.00004",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.00002",
LiquidityDiscountFactor: "0.00004",
MakerDiscountFactor: "0.00004",
},
},
{
MinimumRunningNotionalTakerVolume: "10000",
MinimumEpochs: "100",
ReferralRewardFactor: "0.001",
ReferralDiscountFactor: "0.001",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.0002",
LiquidityRewardFactor: "0.0004",
MakerRewardFactor: "0.0004",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.0002",
LiquidityDiscountFactor: "0.0004",
MakerDiscountFactor: "0.0004",
},
},
},
EndOfProgramTimestamp: endTime.Unix(),
Expand All @@ -92,12 +112,32 @@ func TestReferralPrograms_AddReferralProgram(t *testing.T) {
MinimumEpochs: "20",
ReferralRewardFactor: "0.0002",
ReferralDiscountFactor: "0.0002",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.00004",
LiquidityRewardFactor: "0.00008",
MakerRewardFactor: "0.00008",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.00004",
LiquidityDiscountFactor: "0.00008",
MakerDiscountFactor: "0.00008",
},
},
{
MinimumRunningNotionalTakerVolume: "20000",
MinimumEpochs: "200",
ReferralRewardFactor: "0.002",
ReferralDiscountFactor: "0.002",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.0004",
LiquidityRewardFactor: "0.0008",
MakerRewardFactor: "0.0008",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.0004",
LiquidityDiscountFactor: "0.0008",
MakerDiscountFactor: "0.0008",
},
},
},
EndOfProgramTimestamp: endTime2.Unix(),
Expand Down Expand Up @@ -153,12 +193,32 @@ func getReferralEvents(t *testing.T, endTime time.Time) (*eventspb.ReferralProgr
MinimumEpochs: "10",
ReferralRewardFactor: "0.0001",
ReferralDiscountFactor: "0.0001",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.00002",
LiquidityRewardFactor: "0.00004",
MakerRewardFactor: "0.00004",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.00002",
LiquidityDiscountFactor: "0.00004",
MakerDiscountFactor: "0.00004",
},
},
{
MinimumRunningNotionalTakerVolume: "10000",
MinimumEpochs: "100",
ReferralRewardFactor: "0.001",
ReferralDiscountFactor: "0.001",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.0002",
LiquidityRewardFactor: "0.0004",
MakerRewardFactor: "0.0004",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.0002",
LiquidityDiscountFactor: "0.0004",
MakerDiscountFactor: "0.0004",
},
},
},
EndOfProgramTimestamp: endTime.Unix(),
Expand Down Expand Up @@ -188,12 +248,32 @@ func getReferralEvents(t *testing.T, endTime time.Time) (*eventspb.ReferralProgr
MinimumEpochs: "20",
ReferralRewardFactor: "0.0002",
ReferralDiscountFactor: "0.0002",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.0004",
LiquidityRewardFactor: "0.0008",
MakerRewardFactor: "0.0008",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.0004",
LiquidityDiscountFactor: "0.0008",
MakerDiscountFactor: "0.0008",
},
},
{
MinimumRunningNotionalTakerVolume: "20000",
MinimumEpochs: "200",
ReferralRewardFactor: "0.002",
ReferralDiscountFactor: "0.002",
ReferralRewardFactors: &vega.RewardFactors{
InfrastructureRewardFactor: "0.004",
LiquidityRewardFactor: "0.008",
MakerRewardFactor: "0.008",
},
ReferralDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.004",
LiquidityDiscountFactor: "0.008",
MakerDiscountFactor: "0.008",
},
},
},
EndOfProgramTimestamp: endTime.Unix(),
Expand Down
40 changes: 40 additions & 0 deletions datanode/sqlstore/volume_discount_programs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,20 @@ func TestVolumeDiscountPrograms_AddVolumeDiscountProgram(t *testing.T) {
{
MinimumRunningNotionalTakerVolume: "1000",
VolumeDiscountFactor: "0.01",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.004",
LiquidityDiscountFactor: "0.002",
MakerDiscountFactor: "0.004",
},
},
{
MinimumRunningNotionalTakerVolume: "10000",
VolumeDiscountFactor: "0.1",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.04",
LiquidityDiscountFactor: "0.02",
MakerDiscountFactor: "0.04",
},
},
},
EndOfProgramTimestamp: endTime.Unix(),
Expand All @@ -76,10 +86,20 @@ func TestVolumeDiscountPrograms_AddVolumeDiscountProgram(t *testing.T) {
{
MinimumRunningNotionalTakerVolume: "2000",
VolumeDiscountFactor: "0.02",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.008",
LiquidityDiscountFactor: "0.002",
MakerDiscountFactor: "0.004",
},
},
{
MinimumRunningNotionalTakerVolume: "20000",
VolumeDiscountFactor: "0.2",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.08",
LiquidityDiscountFactor: "0.04",
MakerDiscountFactor: "0.08",
},
},
},
EndOfProgramTimestamp: endTime2.Unix(),
Expand Down Expand Up @@ -122,10 +142,20 @@ func getVolumeDiscountEvents(t *testing.T, endTime time.Time) (*eventspb.VolumeD
{
MinimumRunningNotionalTakerVolume: "1000",
VolumeDiscountFactor: "0.01",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.004",
LiquidityDiscountFactor: "0.002",
MakerDiscountFactor: "0.004",
},
},
{
MinimumRunningNotionalTakerVolume: "10000",
VolumeDiscountFactor: "0.1",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.04",
LiquidityDiscountFactor: "0.02",
MakerDiscountFactor: "0.04",
},
},
},
EndOfProgramTimestamp: endTime.Unix(),
Expand All @@ -143,10 +173,20 @@ func getVolumeDiscountEvents(t *testing.T, endTime time.Time) (*eventspb.VolumeD
{
MinimumRunningNotionalTakerVolume: "2000",
VolumeDiscountFactor: "0.02",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.008",
LiquidityDiscountFactor: "0.004",
MakerDiscountFactor: "0.008",
},
},
{
MinimumRunningNotionalTakerVolume: "20000",
VolumeDiscountFactor: "0.2",
VolumeDiscountFactors: &vega.DiscountFactors{
InfrastructureDiscountFactor: "0.08",
LiquidityDiscountFactor: "0.04",
MakerDiscountFactor: "0.08",
},
},
},
EndOfProgramTimestamp: endTime.Unix(),
Expand Down

0 comments on commit 497db9f

Please sign in to comment.