Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getBlockRange() returns an error for range of 1. #398

Closed
ehamery opened this issue Jul 11, 2023 · 2 comments
Closed

getBlockRange() returns an error for range of 1. #398

ehamery opened this issue Jul 11, 2023 · 2 comments

Comments

@ehamery
Copy link

ehamery commented Jul 11, 2023

The getBlockRange method returns an error for valid input:

tronweb/src/lib/trx.js

Lines 516 to 517 in 4b131bb

if (!utils.isInteger(end) || end <= start)
return callback('Invalid end of range provided');

It should be < instead of <=:

if (!utils.isInteger(end) || end < start)
    return callback('Invalid end of range provided'); 

If end is equal to start, I expect to get 1 block instead of error.

@start940315
Copy link
Contributor

It seems like it's a bug. We'll fix it in the next version. Currently, you can request 2 blocks and use only one of them.

start940315 pushed a commit that referenced this issue Jul 13, 2023
@start940315
Copy link
Contributor

fixed in TronWeb 5.3.1

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

No branches or pull requests

2 participants