Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cursor block height decoding in SortedTXCursor (#1950)
#1825 The `BlockHeight` was encoded in hexadecimal in response of `transactions` endpoint and decoded with `u32::from_str` in parameter of type `SortedTXCursor` which was preventing from making chained API calls. This PR, fixes this by decoding `BlockHeight` from hexadecimal form in `SortedTXCursor`. This bug wasn't catch by the test `tx::get_transactions()` because the test was using only txs included in block 3 that has a string representation that is the same in an hexadecimal and decimal encoding. I added the creation of 10 blocks at start of the test so that now the txs are included in blocks that have a hexadecimal and decimal encoding form that differs. I didn't spotted any hangs on the endpoint when the cursor is initialized manually, however as we can't ask to start at a precise block height without specifying a previous `tx_id` it's not very usable to make manual search. PS: This is my first contribution and so to what I saw my PR doesn't brake anything else and I tried to follow the guidelines of the repository, however maybe their things that I missed and so I'm very open to criticise ! ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
- Loading branch information