-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add support for batched JSON-RPC requests #65
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
0410582
DEFI-2565: Add support for batched JSON-RPC requests
lpahlavi bcc612d
Add `JsonRpcPayload` trait
lpahlavi 05829f5
Refactor into `JsonRpcCall` trait
lpahlavi dc4d0bb
Revert to generic types for `Request` and `Response`
lpahlavi dce5081
Remove `JsonRpcCall` trait
lpahlavi e72299a
Cleanup example
lpahlavi b924dd3
Make heterogeneous batch JSON-RPC request in example
lpahlavi 5cf6e80
Use `Display` in `ConsistentResponseIdFilterError`
lpahlavi ec447ba
Panic if request IDs are not unique
lpahlavi bc85a04
Make `ConsistentJsonRpcIdFilter::request_ids` always a `BTreeSet`
lpahlavi af0a625
Correlate responses with request IDs in `ConsistentJsonRpcIdFilter`
lpahlavi 026c4c9
Use `BTreeSet` instead of `itertools::dedup` to check for duplicates
lpahlavi a8d4d14
Check that batch is non-empty and document panics
lpahlavi 8ab87b9
Rename `correlate_response_ids` and change return type
lpahlavi cc78666
Use defend-style programming
lpahlavi 66209dd
Use `partition_map` to clean-up iterations
lpahlavi c86f4f7
Clippy
lpahlavi 51e286f
Assert response IDs are correctly ordered
lpahlavi d14af61
Shuffle responses instead of reversing
lpahlavi 3326bcb
Fix swapped test names and comments
lpahlavi 9696907
Remove unused imports
lpahlavi 6b79b86
Generate index randomly
lpahlavi 4bf2766
Use `prop_assert` instead of `assert` in `proptest!`
lpahlavi c295e66
Use `ic_cdk::println!` in example
lpahlavi 5b0af47
Return `Invalid Request` error responses with `Id::Null`
lpahlavi 0cde722
Expand `http/json/tests.rs` with JSON-RPC batch tests
lpahlavi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.