diff --git a/CHANGELOG.md b/CHANGELOG.md index 62117cbaa2..568027a363 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -276,6 +276,7 @@ - [9693](https://github.com/vegaprotocol/vega/issues/9693) - Add missing validation for general account public key in governance transfer - [9691](https://github.com/vegaprotocol/vega/issues/9691) - Refactor referral engine snapshot - [8570](https://github.com/vegaprotocol/vega/issues/8570) - Ensure pagination doesn't trigger a sequential scan on block-explorer transactions table. +- [9704](https://github.com/vegaprotocol/vega/issues/9704) - Fix referral program snapshot - [9705](https://github.com/vegaprotocol/vega/issues/9705) - Ensure vote events are sent in the same order. ## 0.72.1 diff --git a/core/referral/engine.go b/core/referral/engine.go index cc6d3b02b1..ea83c14608 100644 --- a/core/referral/engine.go +++ b/core/referral/engine.go @@ -550,7 +550,8 @@ func (e *Engine) computeFactorsByReferee(ctx context.Context, epoch uint64, take partyTakerVolume = takerVolume } refereeStats := &types.RefereeStats{ - TakerVolume: partyTakerVolume, + TakerVolume: partyTakerVolume, + DiscountFactor: num.DecimalZero(), } e.factorsByReferee[party] = refereeStats setStats.RefereesStats[party] = refereeStats diff --git a/core/referral/snapshot_test.go b/core/referral/snapshot_test.go index be51481ff9..d18f62577e 100644 --- a/core/referral/snapshot_test.go +++ b/core/referral/snapshot_test.go @@ -16,6 +16,7 @@ package referral_test import ( + "bytes" "testing" "time" @@ -180,5 +181,5 @@ func TestTakingAndRestoringSnapshotSucceeds(t *testing.T) { // Comparing the hash after restoration, to ensure it produces the same result. hash2, _, _ := snapshotEngine2.Info() - require.Equal(t, hash1, hash2) + require.True(t, bytes.Equal(hash1, hash2)) } diff --git a/core/types/referral_program_snapshot.go b/core/types/referral_program_snapshot.go index 387b2cfe4d..169cafa3ae 100644 --- a/core/types/referral_program_snapshot.go +++ b/core/types/referral_program_snapshot.go @@ -45,6 +45,7 @@ func (p *PayloadReferralProgramState) IntoProto() *snapshotpb.Payload_ReferralPr NewProgram: p.NewProgram, LastProgramVersion: p.LastProgramVersion, ProgramHasEnded: p.ProgramHasEnded, + Sets: p.Sets, }, } } @@ -62,5 +63,6 @@ func PayloadReferralProgramStateFromProto(payload *snapshotpb.Payload_ReferralPr NewProgram: payload.ReferralProgram.NewProgram, LastProgramVersion: payload.ReferralProgram.LastProgramVersion, ProgramHasEnded: payload.ReferralProgram.ProgramHasEnded, + Sets: payload.ReferralProgram.Sets, } }