Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes issues in the TradeResponse class related to incorrect property nullability and adds comprehensive test coverage for both orderbook and liquidity pool trade types. The changes mark always-present properties as required, make conditionally-present properties nullable, and update the class to be sealed. Additionally, it corrects a previously misspelled property name (CountAsset → CounterAsset).
Key Changes
- Added
requiredmodifier to properties that are always present in trade responses (e.g.,Id,PagingToken,TradeType) - Made conditionally-present properties nullable (e.g.,
BaseAccount,LiquidityPoolFeeBp,BaseOfferId) - Fixed typo: renamed
CountAssettoCounterAsset
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
StellarDotnetSdk/Responses/TradeResponse.cs |
Updated property nullability with required and nullable modifiers, added comprehensive XML documentation, fixed property name typo, and changed to sealed class |
StellarDotnetSdk.Tests/TestData/Responses/tradePageOrderBook.json |
New test data file containing orderbook trade example |
StellarDotnetSdk.Tests/TestData/Responses/tradePageLiquidityPool.json |
New test data file containing liquidity pool trade examples |
StellarDotnetSdk.Tests/TestData/Responses/tradePage.json |
Removed outdated test data file |
StellarDotnetSdk.Tests/StellarDotnetSdk.Tests.csproj |
Updated test data file references |
StellarDotnetSdk.Tests/Responses/TradesPageDeserializerTest.cs |
Replaced single test with separate tests for orderbook and liquidity pool trades, with expanded assertions |
StellarDotnetSdk.Tests/Requests/TradesRequestBuilderTest.cs |
Updated to use new test data file and assertion method |
Contributor
|
bugbot run |
7c90a44 to
9233d80
Compare
jopmiddelkamp
requested changes
Dec 4, 2025
jopmiddelkamp
approved these changes
Dec 8, 2025
jopmiddelkamp
requested changes
Dec 8, 2025
jopmiddelkamp
previously approved these changes
Dec 8, 2025
219d03d to
2450b6b
Compare
jopmiddelkamp
previously approved these changes
Dec 8, 2025
added 3 commits
December 8, 2025 12:37
2450b6b to
3480a20
Compare
jopmiddelkamp
approved these changes
Dec 8, 2025
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
TradeResponseclass #90requiredmodifier to always-present propertiesNote
Refactors
TradeResponseto properly model orderbook and liquidity pool trades (required/nullable fields, links, assets), and updates tests and fixtures to validate both trade types.TradeResponse:trade_type,liquidity_pool_fee_bp,base_liquidity_pool_id,counter_liquidity_pool_id.required; adjust others to nullable.CounterAssetproperty (wasCountAsset)._links.base/_links.counterto non-genericLink.OfferIdfield; keepbase_offer_id/counter_offer_id.tradePage.jsonwithtradePageOrderBook.jsonand addtradePageLiquidityPool.json.TradesRequestBuilderTest.TestTradesExecuteto use orderbook fixture and new assertions.TradesPageDeserializerTestwith serialize/deserialize tests and assertions for both orderbook and liquidity pool trades..csprojto include new test data files and remove the old trade page fixture.Written by Cursor Bugbot for commit 5a5b79c. Configure here.