Skip to content

Commit cd89e66

Browse files
committed
fix format
1 parent c7918e9 commit cd89e66

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

x/feeds/abci.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import (
88

99
// HandleEndBlock is a handler function for the EndBlock ABCI request.
1010
func HandleEndBlock(ctx sdk.Context, k keeper.Keeper) {
11+
// re-calculate prices of all current feeds
1112
k.CalculatePrices(ctx)
13+
14+
// re-calculate current feeds every `CurrentFeedsUpdateInterval` blocks
1215
if ctx.BlockHeight()%k.GetParams(ctx).CurrentFeedsUpdateInterval == 0 {
1316
feeds := k.CalculateNewCurrentFeeds(ctx)
1417
k.SetCurrentFeeds(ctx, feeds)

x/feeds/module.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ import (
2323
const ConsensusVersion = 1
2424

2525
var (
26-
_ module.AppModule = AppModule{}
27-
_ module.AppModuleBasic = AppModuleBasic{}
26+
_ module.AppModule = AppModule{}
27+
_ module.AppModuleBasic = AppModuleBasic{}
28+
_ module.BeginBlockAppModule = AppModule{}
29+
_ module.EndBlockAppModule = AppModule{}
2830
)
2931

3032
// ----------------------------------------------------------------------------

x/feeds/types/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ func AbsInt64(x int64) int64 {
66
if x < 0 {
77
return -1 * x
88
}
9+
910
return x
1011
}

x/feeds/types/validate.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ func validateInt64(name string, positiveOnly bool, i interface{}) error {
1111
if !ok {
1212
return fmt.Errorf("invalid parameter type: %T", i)
1313
}
14+
1415
if v <= 0 && positiveOnly {
1516
return fmt.Errorf("%s must be positive: %d", name, v)
1617
}
18+
1719
return nil
1820
}
1921

@@ -23,9 +25,11 @@ func validateUint64(name string, positiveOnly bool, i interface{}) error {
2325
if !ok {
2426
return fmt.Errorf("invalid parameter type: %T", i)
2527
}
28+
2629
if v == 0 && positiveOnly {
2730
return fmt.Errorf("%s must be positive: %d", name, v)
2831
}
32+
2933
return nil
3034
}
3135

@@ -35,6 +39,7 @@ func validateURL(name string, u string) error {
3539
if err != nil {
3640
return fmt.Errorf("%s has invalid URL format", name)
3741
}
42+
3843
return nil
3944
}
4045

@@ -44,8 +49,10 @@ func validateString(name string, allowEmpty bool, i interface{}) error {
4449
if !ok {
4550
return fmt.Errorf("invalid parameter type: %T", i)
4651
}
52+
4753
if s == "" && !allowEmpty {
4854
return fmt.Errorf("%s cannot be empty", name)
4955
}
56+
5057
return nil
5158
}

0 commit comments

Comments
 (0)