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

#354: use new abs_before_epoch attribute if available for ClaimableBa… #394

Merged
merged 2 commits into from
Jan 3, 2022

Conversation

sreuland
Copy link
Contributor

@sreuland sreuland commented Jan 1, 2022

Problem: The Claimable Balance Claimant AbsBefore Predicate in API response has a formatted datetime string value which follows a custom extended format on top of ISO 8601 per the changes done in horizon API last year. By default ISO 8601 formatted dates support 4 digit years up to 9999. However, with this change in Horizon API, the custom formatted datetime strings for Predicate AbsBefore are based on a unix epoch value expressed as int64. This means it has a huge date range with a max of year 292277026596 into future and -292471206707 year back in past.

An example of value that could be in the json abs_before field:
"+39121901036-03-29T15:30:22Z"

The Java datetime libraries can't handle years this big, limit is 9 digits years or 999,999,999, so if AbsBefore Predicate datetime values with years greater than that are received from API, the Java SDK throws an error and stops parsing the API response.

Solution: use the newabs_before_epoch attribute added to the API via Horizon PR #4148, which will most likely be included to horizon API as of v2.14.0.

closes #354

@sreuland sreuland merged commit 4067ab7 into lightsail-network:master Jan 3, 2022
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.

"Effects for Ledger" hava a Exception
2 participants