From 3b6b6402f98e837ff323fa6f3a71b9e27f4a0e49 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:05:48 -0700 Subject: [PATCH] fix test --- x/ccv/consumer/types/params_test.go | 114 ++++++++++++++-------------- x/ccv/types/params.go | 2 +- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/x/ccv/consumer/types/params_test.go b/x/ccv/consumer/types/params_test.go index ca3a36d9f3..589a6fdfc3 100644 --- a/x/ccv/consumer/types/params_test.go +++ b/x/ccv/consumer/types/params_test.go @@ -16,63 +16,63 @@ func TestValidateParams(t *testing.T) { params ccvtypes.Params expPass bool }{ - // {"default params", ccvtypes.DefaultParams(), true}, - // { - // "custom valid params", - // ccvtypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), true, - // }, - // { - // "custom invalid params, block per dist transmission", - // ccvtypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, dist transmission channel", - // ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, ccv timeout", - // ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, transfer timeout", - // ccvtypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, consumer redist fraction is negative", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, consumer redist fraction is over 1", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, bad consumer redist fraction ", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, negative num historical entries", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, negative unbonding period", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, invalid soft opt out threshold", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "-0.05", []string{"u"}, []string{}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, invalid soft opt out threshold", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.5", []string{"u"}, []string{}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, invalid reward denom", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"u"}, []string{}, 2*time.Hour), false, - // }, - // { - // "custom invalid params, invalid provider reward denom", - // ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{"a"}, 2*time.Hour), false, - // }, + {"default params", ccvtypes.DefaultParams(), true}, + { + "custom valid params", + ccvtypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), true, + }, + { + "custom invalid params, block per dist transmission", + ccvtypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, dist transmission channel", + ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, ccv timeout", + ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, transfer timeout", + ccvtypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, consumer redist fraction is negative", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, consumer redist fraction is over 1", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, bad consumer redist fraction ", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, negative num historical entries", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, negative unbonding period", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, + }, + { + "custom invalid params, invalid soft opt out threshold", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "-0.05", []string{"u"}, []string{}, 2*time.Hour), false, + }, + { + "custom invalid params, invalid soft opt out threshold", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.5", []string{"u"}, []string{}, 2*time.Hour), false, + }, + { + "custom invalid params, invalid reward denom", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"u"}, []string{}, 2*time.Hour), false, + }, + { + "custom invalid params, invalid provider reward denom", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{"a"}, 2*time.Hour), false, + }, { "custom invalid params, retry delay period is negative", ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{}, -2*time.Hour), false, diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index 8bd58ba00b..efad72ea75 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -86,7 +86,7 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, SoftOptOutThreshold: softOptOutThreshold, RewardDenoms: rewardDenoms, ProviderRewardDenoms: providerRewardDenoms, - RetryDelayPeriod: DefaultRetryDelayPeriod, + RetryDelayPeriod: retryDelayPeriod, } }