From 936cc6100f1a0579cc1f824e6ae9cd1e7bcd5282 Mon Sep 17 00:00:00 2001 From: forcodedancing Date: Fri, 8 Mar 2024 14:36:14 +0800 Subject: [PATCH] add logs --- x/storage/keeper/payment.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/x/storage/keeper/payment.go b/x/storage/keeper/payment.go index 7cad1ab2e..ca4bf759f 100644 --- a/x/storage/keeper/payment.go +++ b/x/storage/keeper/payment.go @@ -520,20 +520,28 @@ func (k Keeper) GetObjectLockFee(ctx sdk.Context, priceTime int64, payloadSize u return amount, fmt.Errorf("get charge size failed: %d %w", priceTime, err) } + fmt.Println("price", price.PrimaryStorePrice, price.SecondaryStorePrice) + primaryRate := price.PrimaryStorePrice.MulInt(sdkmath.NewIntFromUint64(chargeSize)).TruncateInt() secondarySPNum := int64(k.GetExpectSecondarySPNumForECObject(ctx, priceTime)) secondaryRate := price.SecondaryStorePrice.MulInt(sdkmath.NewIntFromUint64(chargeSize)).TruncateInt() secondaryRate = secondaryRate.MulRaw(int64(secondarySPNum)) + fmt.Println("rate", primaryRate, secondarySPNum, secondaryRate) + versionedParams, err := k.paymentKeeper.GetVersionedParamsWithTs(ctx, priceTime) if err != nil { return amount, fmt.Errorf("get versioned reserve time error: %w", err) } validatorTaxRate := versionedParams.ValidatorTaxRate.MulInt(primaryRate.Add(secondaryRate)).TruncateInt() + fmt.Println("params", versionedParams.ValidatorTaxRate, versionedParams.ReserveTime) + rate := primaryRate.Add(secondaryRate).Add(validatorTaxRate) // should also lock for validator tax pool amount = rate.Mul(sdkmath.NewIntFromUint64(versionedParams.ReserveTime)) + + fmt.Println("final amount", rate, amount) return amount, nil }