Skip to content

Commit

Permalink
chore: add documentation for edge case of fetching min/max square size
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulghangas committed Dec 21, 2022
1 parent 0fca546 commit 0a296c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions x/blob/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {

// MinSquareSize returns the MinSquareSize param
func (k Keeper) MinSquareSize(ctx sdk.Context) (res uint32) {
// use the default size for the first block so that we return a value on the
// first block in PrepareProposal
if ctx.BlockHeader().Height < 1 {
return appconsts.DefaultMinSquareSize
}
Expand All @@ -31,6 +33,8 @@ func (k Keeper) MinSquareSize(ctx sdk.Context) (res uint32) {

// MaxSquareSize returns the MaxSquareSize param
func (k Keeper) MaxSquareSize(ctx sdk.Context) (res uint32) {
// use the default size for the first block so that we return a value on the
// first block in PrepareProposal
if ctx.BlockHeader().Height < 1 {
return appconsts.DefaultMaxSquareSize
}
Expand Down

0 comments on commit 0a296c1

Please sign in to comment.