Skip to content

Commit

Permalink
fix the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gsk967 committed Jun 27, 2023
1 parent 05ace99 commit 4abb3ed
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 72 deletions.
6 changes: 4 additions & 2 deletions proto/umee/oracle/v1/oracle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ message Params {
google.protobuf.Duration avg_period = 13 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"avg_period\""
(gogoproto.jsontag) = "avg_period,omitempty",
(gogoproto.moretags) = "yaml:\"avg_period\""
];
// avg shift
google.protobuf.Duration avg_shift = 14 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"avg_shift\""
(gogoproto.jsontag) = "avg_shift,omitempty",
(gogoproto.moretags) = "yaml:\"avg_shift\""
];
}

Expand Down
135 changes: 68 additions & 67 deletions x/oracle/types/oracle.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x/oracle/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func validateAvgPeriod(i interface{}) error {
return fmt.Errorf("invalid parameter type: %T", i)
}

if v.Seconds() == 0 {
if v.Seconds() <= 0 {
return fmt.Errorf("avg period must be positive: %d", v)
}

Expand All @@ -395,7 +395,7 @@ func validateAvgShift(i interface{}) error {
return fmt.Errorf("invalid parameter type: %T", i)
}

if v.Seconds() == 0 {
if v.Seconds() <= 0 {
return fmt.Errorf("avg shift must be positive: %d", v)
}

Expand Down
2 changes: 1 addition & 1 deletion x/oracle/types/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,5 @@ func TestValidateVotingThreshold(t *testing.T) {

func TestParams_ParamSetPairs(t *testing.T) {
params := DefaultParams()
assert.Equal(t, 12, len(params.ParamSetPairs()))
assert.Equal(t, 14, len(params.ParamSetPairs()))
}

0 comments on commit 4abb3ed

Please sign in to comment.