Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shaspitz committed Sep 14, 2023
1 parent f5be6c8 commit 3b6b640
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 58 deletions.
114 changes: 57 additions & 57 deletions x/ccv/consumer/types/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion x/ccv/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64,
SoftOptOutThreshold: softOptOutThreshold,
RewardDenoms: rewardDenoms,
ProviderRewardDenoms: providerRewardDenoms,
RetryDelayPeriod: DefaultRetryDelayPeriod,
RetryDelayPeriod: retryDelayPeriod,
}
}

Expand Down

0 comments on commit 3b6b640

Please sign in to comment.