From 6cf36259ddfa8fe80269b0758f7f2b49a62301f1 Mon Sep 17 00:00:00 2001 From: wwestgarth Date: Thu, 26 Sep 2024 09:17:29 +0100 Subject: [PATCH] fix: unmarshal referral prog discount factors properly when loading from a snapshot --- core/referral/engine.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/referral/engine.go b/core/referral/engine.go index d4949ea013..355a8f0903 100644 --- a/core/referral/engine.go +++ b/core/referral/engine.go @@ -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)