Merged
Conversation
ClaimableBalanceResponse classClaimableBalanceResponse class
There was a problem hiding this comment.
Pull request overview
This PR fixes the ClaimableBalanceResponse class to properly represent the Horizon API response structure for claimable balances. The changes address missing properties, incorrect nullability, and add comprehensive documentation.
Key changes:
- Added
requiredmodifier to always-present properties inClaimableBalanceResponseand related classes - Added missing
Flags,Links, andLastModifiedTimeproperties to match Horizon API responses - Enhanced
Predicateclass withAbsBeforeEpochproperty and improved documentation - Updated test data and assertions to reflect actual Horizon API responses
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
StellarDotnetSdk/Responses/ClaimableBalanceResponse.cs |
Added missing properties (Flags, Links, LastModifiedTime), marked always-present properties as required, added comprehensive XML documentation, and removed file-level nullable disable directive |
StellarDotnetSdk/Responses/Predicate.cs |
Added missing AbsBeforeEpoch property, changed Unconditional to nullable, added XML documentation, made class sealed, and improved exception handling |
StellarDotnetSdk.Tests/TestData/Responses/claimableBalance.json |
Updated test data to reflect actual Horizon API response including flags, last_modified_time, and additional claimant with nested predicate |
StellarDotnetSdk.Tests/Responses/ClaimableBalanceDeserializerTest.cs |
Updated test assertions to validate new properties and more comprehensive test data structure |
Comments suppressed due to low confidence (1)
StellarDotnetSdk/Responses/Predicate.cs:102
- The logic prioritizes
AbsBeforeEpochoverAbsBefore, but both represent the same deadline. According to the documentation (lines 40-49),AbsBeforeEpochis described as 'representing the same deadline date as abs_before.' Consider documenting whyAbsBeforeEpochtakes precedence, or verify that they should be mutually exclusive. If Horizon returns both fields, there should be clarity on which is the source of truth.
if (AbsBeforeEpoch != null)
{
var dateTime = DateTimeOffset.FromUnixTimeSeconds(AbsBeforeEpoch.Value);
return claimant_ClaimPredicate.BeforeAbsoluteTime(dateTime);
}
if (AbsBefore != null)
{
var dateTime = DateTimeOffset.Parse(AbsBefore);
return claimant_ClaimPredicate.BeforeAbsoluteTime(dateTime);
}
Contributor
|
bugbot run |
jopmiddelkamp
requested changes
Dec 3, 2025
3135956 to
923bb5e
Compare
Contributor
|
bugbot run |
jopmiddelkamp
previously approved these changes
Dec 4, 2025
jopmiddelkamp
previously approved these changes
Dec 4, 2025
64f5cef to
6fd5705
Compare
jopmiddelkamp
approved these changes
Dec 4, 2025
6fd5705 to
7619be6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Types of changes
ClaimableBalanceResponseclass #98requiredmodifier to always-present propertiesNote
Replaces flat
Predicatewith a polymorphic model + JSON converter and expandsClaimableBalanceResponse(required fields, links, flags), updating tests and fixtures accordingly.ClaimableBalanceResponse: Sealed; addsrequiredon core fields; introduceslast_modified_time,flags.clawback_enabled, and_links(self,operations,transactions).Responses.PredicatewithResponses.Predicateshierarchy (PredicateAnd,PredicateOr,PredicateNot,PredicateUnconditional,PredicateBeforeAbsoluteTime,PredicateBeforeRelativeTime) and a customPredicateJsonConverterfor polymorphic (de)serialization and numeric-as-string handling.Responses.Claimant: Uses newPredicates.Predicate.Claimants.ClaimPredicateandClaimants.Claimant.rel_beforekey naming; add coverage for epoch/string values and polymorphic predicate (de)serialization.PredicateBeforeAbsoluteTime.Written by Cursor Bugbot for commit a880f3a. Configure here.