Skip to content

Commit

Permalink
error for no unbatched transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
V-Staykov committed May 26, 2022
1 parent 58df5b5 commit 859e152
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion module/x/gravity/keeper/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ func (k Keeper) BuildOutgoingTXBatch(
}

selectedTx, err := k.pickUnbatchedTX(ctx, contract, maxElements)
if len(selectedTx) == 0 || err != nil {

if err != nil {
return nil, err
}

if len(selectedTx) == 0 {
return nil, sdkerrors.Wrap(types.ErrEmpty, "there are no unbatched transactions for that denom")
}

nextID := k.autoIncrementID(ctx, types.KeyLastOutgoingBatchID)
batch, err := types.NewInternalOutgingTxBatch(nextID, k.getBatchTimeoutHeight(ctx), selectedTx, contract, 0)
if err != nil {
Expand Down

0 comments on commit 859e152

Please sign in to comment.