[Fix] change get_blocks range to closed interval #3394
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Close issue: #3387
We say
GET /testnet/blocks?start={start_height}&end={end_height}
Returns the blocks for the given block range ( api doc )the given block range was not described clearly enough.
/testnet/blocks
returns the blocks offrom start_height to end_height - 1
. But I think it should returnfrom start_height to end_height
with closed interval which is more friendly with human intuition, cuz we always use current block height as end_height, easily misunderstood if we need give it current block height + 1.Test Plan
change
snarkOS/node/rest/src/routes.rs
Line 140 in 0cc6fe3
to