Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions baseapp/block_gas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,7 @@ func TestBaseApp_BlockGas(t *testing.T) {
}
// check block gas is always consumed
baseGas := uint64(57504) // baseGas is the gas consumed before tx msg
expGasConsumed := addUint64Saturating(tc.gasToConsume, baseGas)
if expGasConsumed > uint64(simtestutil.DefaultConsensusParams.Block.MaxGas) {
// capped by gasLimit
expGasConsumed = uint64(simtestutil.DefaultConsensusParams.Block.MaxGas)
}
expGasConsumed := min(addUint64Saturating(tc.gasToConsume, baseGas), uint64(simtestutil.DefaultConsensusParams.Block.MaxGas))
require.Equal(t, int(expGasConsumed), int(ctx.BlockGasMeter().GasConsumed()))
// tx fee is always deducted
require.Equal(t, int64(0), bankKeeper.GetBalance(ctx, addr1, feeCoin.Denom).Amount.Int64())
Expand Down
6 changes: 1 addition & 5 deletions client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ func Paginate(numObjs, page, limit, defLimit int) (start, end int) {
}

start = (page - 1) * limit
end = limit + start

if end >= numObjs {
end = numObjs
}
end = min(limit+start, numObjs)

if start >= numObjs {
// page is out of bounds
Expand Down
7 changes: 1 addition & 6 deletions x/distribution/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,7 @@ func newSplitAndApply(
// split messages into slices of length chunkSize
totalMessages := len(msgs)
for i := 0; i < len(msgs); i += chunkSize {

sliceEnd := i + chunkSize
if sliceEnd > totalMessages {
sliceEnd = totalMessages
}

sliceEnd := min(i+chunkSize, totalMessages)
msgChunk := msgs[i:sliceEnd]
if err := genOrBroadcastFn(clientCtx, fs, msgChunk...); err != nil {
return err
Expand Down
12 changes: 2 additions & 10 deletions x/group/internal/orm/iterator_property_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ func TestPaginationProperty(t *testing.T) {
CountTotal: false,
Reverse: false,
}
end := offset + limit
if end > uint64(len(tableModels)) {
end = uint64(len(tableModels))
}
end := min(offset+limit, uint64(len(tableModels)))
dest := reconstructedTableModels[offset:end]
tableModelsIt := testTableModelIterator(tableModels, nil)
_, err := Paginate(tableModelsIt, pageRequest, &dest)
Expand All @@ -65,12 +62,7 @@ func TestPaginationProperty(t *testing.T) {
CountTotal: false,
Reverse: false,
}

end := start + limit
if end > uint64(len(tableModels)) {
end = uint64(len(tableModels))
}

end := min(start+limit, uint64(len(tableModels)))
dest := reconstructedTableModels[start:end]
tableModelsIt := testTableModelIterator(tableModels, key)

Expand Down
Loading