From 32352c8f53bc8408a83b1dddac2cd1990484f22a Mon Sep 17 00:00:00 2001 From: Snobbish Bee <125891987+snobbee@users.noreply.github.com> Date: Tue, 12 Dec 2023 10:41:55 +0100 Subject: [PATCH] fix: update default values for clp params (#3436) * fix: update default values for clp params * fix: test --- integrationtest/output/tc1.json | 2 +- x/clp/keeper/executors.go | 2 ++ x/clp/types/keys.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/integrationtest/output/tc1.json b/integrationtest/output/tc1.json index 53c5a72ed1..bb9777868d 100644 --- a/integrationtest/output/tc1.json +++ b/integrationtest/output/tc1.json @@ -43,7 +43,7 @@ }, "liquidity_provider_units": "1000000000000000000000", "liquidity_provider_address": "sif1syavy2npfyt9tcncdtsdzf7kny9lh777yqc2nd", - "last_updated_block": 1, + "last_updated_block": 4, "reward_amount": null } } diff --git a/x/clp/keeper/executors.go b/x/clp/keeper/executors.go index 5500b5b451..99ca8bbca6 100644 --- a/x/clp/keeper/executors.go +++ b/x/clp/keeper/executors.go @@ -191,6 +191,8 @@ func (k Keeper) RemoveLiquidity(ctx sdk.Context, pool types.Pool, externalAssetC k.DestroyLiquidityProvider(ctx, lp.Asset.Symbol, lp.LiquidityProviderAddress) } else { lp.LiquidityProviderUnits = lpUnitsLeft + // Set LP’s LastUpdatedBlock to current block height + lp.LastUpdatedBlock = ctx.BlockHeight() k.SetLiquidityProvider(ctx, &lp) } return nil diff --git a/x/clp/types/keys.go b/x/clp/types/keys.go index a9e13e520a..f1df3e3b16 100644 --- a/x/clp/types/keys.go +++ b/x/clp/types/keys.go @@ -71,8 +71,8 @@ func GetLiquidityProviderKey(externalTicker string, lp string) []byte { func GetDefaultRewardParams() *RewardParams { return &RewardParams{ - LiquidityRemovalLockPeriod: 12 * 60 * 24 * 50, // 50 days - LiquidityRemovalCancelPeriod: 12 * 60 * 6, // 6 hours + LiquidityRemovalLockPeriod: 12 * 60 * 5, // 5 hours + LiquidityRemovalCancelPeriod: 12 * 60 * 24 * 50, // 50 days RewardPeriods: nil, RewardPeriodStartTime: "", RewardsLockPeriod: 12 * 60 * 24 * 14, // 14 days