[SDK] Support multiple statuses in EscrowFilter#3481
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for filtering escrows by multiple statuses in the SDK's EscrowFilter, allowing users to query escrows with an array of status values instead of being limited to a single status.
- Updated EscrowFilter interface to accept both single status and array of statuses
- Modified GraphQL queries to use
status_inparameter for array filtering - Enhanced status processing logic in both TypeScript and Python SDKs
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/typescript/human-protocol-sdk/src/interfaces.ts | Updated IEscrowsFilter interface to accept status as either single value or array |
| packages/sdk/typescript/human-protocol-sdk/src/graphql/queries/escrow.ts | Modified GraphQL query to use status_in parameter for array filtering |
| packages/sdk/typescript/human-protocol-sdk/src/escrow.ts | Added logic to transform status parameter into array format for GraphQL query |
| packages/sdk/typescript/human-protocol-sdk/test/escrow.test.ts | Added unit test for multiple status filtering functionality |
| packages/sdk/typescript/human-protocol-sdk/example/escrow.ts | Updated example to demonstrate multiple status filtering |
| packages/sdk/python/human-protocol-sdk/human_protocol_sdk/filter.py | Updated EscrowFilter class to accept status as single value or list |
| packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py | Modified GraphQL query generation to handle status arrays |
| packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow/escrow_utils.py | Added status array processing logic |
| packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py | Added test cases and fixed manifest field names |
Comments suppressed due to low confidence (2)
packages/sdk/python/human-protocol-sdk/human_protocol_sdk/gql/escrow.py:30
- [nitpick] The variable name
use_statusesis unclear. Consider renaming it tostatus_arrayorformatted_statusesto better reflect its purpose of handling both single status and status array cases.
use_statuses = (
packages/sdk/python/human-protocol-sdk/test/human_protocol_sdk/escrow/test_escrow_utils.py:38
- The test data change from
manifestUrltomanifestsuggests a schema change, but there's no corresponding test to verify that the old field name is no longer accepted or that the new field name works correctly in isolation.
"manifest": "https://example.com",
777d22d to
2a53396
Compare
Dzeranov
requested changes
Jul 28, 2025
Dzeranov
reviewed
Jul 28, 2025
Dzeranov
requested changes
Jul 28, 2025
Co-authored-by: Siarhei <sergey.dzeranov@gmail.com>
Dzeranov
approved these changes
Jul 28, 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.
Issue tracking
None
Context behind the change
Support multiple statuses in EscrowFilter
Update unit tests
How has this been tested?
Launched several queries for testing
Release plan
Deploy new SDK version
Potential risks; What to monitor; Rollback plan
None