-
Notifications
You must be signed in to change notification settings - Fork 111
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
thiagodeev/rpcv08-websocket #651
Draft
thiagodeev
wants to merge
13
commits into
v0.8.0
Choose a base branch
from
thiagodeev/rpcv08-websocket
base: v0.8.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains 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
thiagodeev
force-pushed
the
v0.8.0
branch
2 times, most recently
from
January 6, 2025 11:37
61eb5fb
to
9199306
Compare
…ith Websocket support - Added gorilla/websocket v1.5.3 as a direct dependency in go.mod. - Introduced NewWebsocketProvider function in provider.go to create a Websocket RPC Provider instance, enhancing the existing HTTP provider functionality.
- Removed the dependency on github.com/ethereum/go-ethereum and replaced it with github.com/NethermindEth/starknet.go/client in go.mod and related files. - Introduced new WebSocket provider functionality in provider.go
…od to work on starknet
- Updated the handler to correctly process subscription IDs for Starknet, accommodating the new structure returned by the Starknet API. - Modified the subscriptionResult struct to include a Starknet-specific subscription ID field. - Adjusted the WebSocket provider to support new block header subscriptions, improving the overall subscription mechanism. - Updated example usage to reflect changes in subscription handling and error management. These changes improve compatibility with Starknet's API and enhance the robustness of the WebSocket client.
- Updated the main CI workflow to include testing for the client with mocks. - Modified subscription handling in `subscription.js` to accommodate the new `subscription_id` structure from Starknet. - Refactored `provider_test.go` to include WebSocket provider support and improved test configurations. - Introduced a new test file `websocket_test.go` to validate WebSocket subscriptions for new block headers, ensuring robust error handling and compatibility with the testnet environment. These changes improve the overall robustness of the RPC client and enhance compatibility with Starknet's API.
thiagodeev
force-pushed
the
thiagodeev/rpcv08-websocket
branch
from
January 13, 2025 16:49
f846bb8
to
05d7e90
Compare
thiagodeev
force-pushed
the
thiagodeev/rpcv08-websocket
branch
from
January 13, 2025 22:37
4bb568c
to
c73bfce
Compare
Note: at the moment it's not possible to omit optional parameters in json-rpc calls using array as structure type with Juno, and the current client implementation only supports sending parameters as arrays. Therefore, I changed the Subscribe function and now we are able to send optional parameters as object too. That way Juno doesn't return an error
…hanced error handling and testing - Added the SubscribeEvents method to the WebSocket provider, allowing for event subscriptions with optional parameters. - Introduced a new test case in websocket_test.go to validate event subscriptions under various conditions, including handling of empty arguments and specific address filtering. - Updated the HexToFeltNoErr utility function to convert hexadecimal strings to felt objects without error handling, suitable for internal use. These changes improve the robustness of the WebSocket client and enhance compatibility with Starknet's event subscription model.
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.
No description provided.