Skip to content

Commit

Permalink
Merge pull request #11712 from vegaprotocol/fix-ref-discount-factors-…
Browse files Browse the repository at this point in the history
…snapshot

fix: unmarshal referral prog discount factors properly when loading f…
  • Loading branch information
jeremyletang authored Sep 26, 2024
2 parents 68f214e + 6cf3625 commit 62066e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/referral/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,9 @@ func (e *Engine) loadFactorsByReferee(factors []*snapshotpb.FactorByReferee) {

factors := types.Factors{}
if fbr.DiscountFactors != nil {
factors.Infra, _ = num.UnmarshalBinaryDecimal([]byte(fbr.DiscountFactors.InfrastructureDiscountFactor))
factors.Liquidity, _ = num.UnmarshalBinaryDecimal([]byte(fbr.DiscountFactors.LiquidityDiscountFactor))
factors.Maker, _ = num.UnmarshalBinaryDecimal([]byte(fbr.DiscountFactors.MakerDiscountFactor))
factors.Infra, _ = num.DecimalFromString(fbr.DiscountFactors.InfrastructureDiscountFactor)
factors.Liquidity, _ = num.DecimalFromString(fbr.DiscountFactors.LiquidityDiscountFactor)
factors.Maker, _ = num.DecimalFromString(fbr.DiscountFactors.MakerDiscountFactor)
}
if len(fbr.DiscountFactor) > 0 {
defaultDF, _ := num.UnmarshalBinaryDecimal(fbr.DiscountFactor)
Expand Down

0 comments on commit 62066e8

Please sign in to comment.