Skip to content

Fix 400 error querying blocks with no transactions#3260

Open
utafrali wants to merge 1 commit intosei-protocol:mainfrom
utafrali:fix/issue-3239-bug-400-error-on-cosmos-tx-v1beta1-txs-b
Open

Fix 400 error querying blocks with no transactions#3260
utafrali wants to merge 1 commit intosei-protocol:mainfrom
utafrali:fix/issue-3239-bug-400-error-on-cosmos-tx-v1beta1-txs-b

Conversation

@utafrali
Copy link
Copy Markdown

Describe your changes and provide context

Fixes #3239

The GetBlockWithTxs endpoint was failing when querying an empty block. It was checking if offset >= blockTxsLn without first verifying blockTxsLn > 0, so any request (even offset=0) would error out when there were no transactions.

Added a check for blockTxsLn > 0 before the offset validation. Handles empty blocks correctly now.

Testing performed to validate your change

Tested locally with both empty and non-empty blocks. Empty blocks now work, and offset validation still works for non-empty blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 400 error on /cosmos/tx/v1beta1/txs/block/ with block with no transactions

1 participant