From 5b8534e9a996ed6e6a44a31893c98098450d5d9e Mon Sep 17 00:00:00 2001 From: javiersuweijie Date: Fri, 10 Nov 2023 10:31:09 +0800 Subject: [PATCH] fix: test --- x/alliance/keeper/proposal.go | 1 + x/alliance/keeper/tests/asset_test.go | 4 ++++ x/alliance/types/tests/types_test.go | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/x/alliance/keeper/proposal.go b/x/alliance/keeper/proposal.go index 25f0cdf2..c99ab900 100644 --- a/x/alliance/keeper/proposal.go +++ b/x/alliance/keeper/proposal.go @@ -28,6 +28,7 @@ func (k Keeper) UpdateAlliance(ctx context.Context, req *types.MsgUpdateAlliance RewardWeight: req.RewardWeight, TakeRate: req.TakeRate, RewardChangeRate: req.RewardChangeRate, + RewardWeightRange: req.RewardWeightRange, RewardChangeInterval: req.RewardChangeInterval, }) return err diff --git a/x/alliance/keeper/tests/asset_test.go b/x/alliance/keeper/tests/asset_test.go index 1d8130e8..4e4269f3 100644 --- a/x/alliance/keeper/tests/asset_test.go +++ b/x/alliance/keeper/tests/asset_test.go @@ -741,6 +741,7 @@ func TestRewardWeightDecay(t *testing.T) { Description: "", Denom: AllianceDenom, RewardWeight: sdk.MustNewDecFromStr("0.5"), + RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)}, TakeRate: sdk.ZeroDec(), RewardChangeRate: sdk.ZeroDec(), RewardChangeInterval: 0, @@ -753,6 +754,7 @@ func TestRewardWeightDecay(t *testing.T) { Description: "", Denom: AllianceDenom, RewardWeight: sdk.MustNewDecFromStr("0.5"), + RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)}, TakeRate: sdk.ZeroDec(), RewardChangeRate: sdk.MustNewDecFromStr("0.1"), RewardChangeInterval: decayInterval, @@ -779,6 +781,7 @@ func TestRewardWeightDecay(t *testing.T) { Description: "", Denom: AllianceDenomTwo, RewardWeight: sdk.MustNewDecFromStr("0.5"), + RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)}, TakeRate: sdk.ZeroDec(), RewardChangeRate: sdk.MustNewDecFromStr("0.1"), RewardChangeInterval: decayInterval, @@ -1113,6 +1116,7 @@ func TestRewardWeightRateChange(t *testing.T) { Description: "", Denom: alliance.Denom, RewardWeight: alliance.RewardWeight, + RewardWeightRange: types.RewardWeightRange{Min: sdk.NewDec(0), Max: sdk.NewDec(5)}, TakeRate: alliance.TakeRate, RewardChangeRate: sdk.MustNewDecFromStr("1.001"), RewardChangeInterval: time.Minute * 5, diff --git a/x/alliance/types/tests/types_test.go b/x/alliance/types/tests/types_test.go index e1266124..42943b05 100644 --- a/x/alliance/types/tests/types_test.go +++ b/x/alliance/types/tests/types_test.go @@ -66,7 +66,7 @@ func TestProposalsContent(t *testing.T) { title: "Alliance2", desc: "Alliance with 2", typ: "msg_update_alliance_proposal", - str: "title:\"Alliance2\" description:\"Alliance with 2\" denom:\"ibc/denom2\" reward_weight:\"2000000000000000000\" take_rate:\"2000000000000000000\" reward_change_rate:\"2000000000000000000\" reward_change_interval: ", + str: "title:\"Alliance2\" description:\"Alliance with 2\" denom:\"ibc/denom2\" reward_weight:\"2000000000000000000\" take_rate:\"2000000000000000000\" reward_change_rate:\"2000000000000000000\" reward_change_interval: reward_weight_range: ", }, "msg_delete_alliance_proposal": { p: types.NewMsgDeleteAllianceProposal("test", "abcd", "ibc/denom"),