feat(target_chains/ton): add helper function to parse price IDs beyond a single cell and enhance update handling #2558
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.
Summary
Added a helper function to parse price IDs from cell chains, improving support for large sets of price feed IDs that span multiple cells. This allows handling of more than 3 price IDs in a single request.
Rationale
The original implementation couldn't properly handle price IDs that span cell boundaries, causing cell underflow errors (exit code 9) with larger sets of price feed IDs. By refactoring the parsing logic into a shared helper function that properly handles bit loading across cell boundaries, we've made the code more robust and maintainable.
How has this been tested?
The implementation has been tested with the existing test suite plus new tests that specifically verify handling of more than 3 price feed IDs. Test cases should successfully parse price feed updates with more than 3 price feed ids and should successfully parse unique price feed updates with more than 3 price feed ids demonstrate that the changes correctly handle larger price ID sets across cell chains.