Skip to content
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

Ten gateway use http instead of ws #1743

Merged
merged 12 commits into from
Jan 17, 2024

Conversation

zkokelj
Copy link
Contributor

@zkokelj zkokelj commented Jan 12, 2024

Why this change is needed

We want to use http connections from the gateway to the validator. Having web socket connections open for a lot of users can cause gateway to crash. It is also problematic if we want to have it behind load balancer.
Websocket connections are still needed for subscriptions.

https://github.com/ten-protocol/ten-internal/issues/2505

What changes were made as part of this PR

Changed ws connection to http, creating ws connections for subscriptions + added a test for subscription topics

PR checks pre-merging

Please indicate below by ticking the checkbox that you have read and performed the required
PR checks

  • PR checks reviewed and performed

https://github.com/ten-protocol/ten-test/actions/runs/7504133752/job/20430444139

The first topic when an event is produced is a signature of the event, but when you subscribe to an event you don't pass a signature as first topic
Copy link

coderabbitai bot commented Jan 12, 2024

Walkthrough

The recent updates involve enhancing testing capabilities, refining the account management system, and differentiating between HTTP and WebSocket protocols across the application. A new test function was added to verify subscription topics, and existing functions were updated to handle the separation of HTTP and WebSocket addresses. The AccountManager structure and related functions have been expanded to support more complex client management and proxy requests. Constants and initialization processes were modified to align with these protocol changes, ensuring proper client-server communication.

Changes

Files Change Summaries
integration/obscurogateway/tengateway_test.go Added testSubscriptionTopics function; updated TestTenGateway to include the new test; modified transferETHToAddress and subscribeToEvents function signature.
tools/walletextension/accountmanager/account_manager.go Added bytes and storage packages; updated AccountManager struct; modified NewAccountManager, AddClient, and ProxyRequest functions; added suggestSubscriptionClient, filterClients, and createClientsForAllAccounts.
tools/walletextension/common/constants.go Added HTTPProtocol constant.
tools/walletextension/container/walletextension_container.go,
tools/walletextension/useraccountmanager/user_account_manager.go,
tools/walletextension/wallet_extension.go
Updated network client creation, account manager initialization, and wallet extension instantiation to differentiate between WebSocket and HTTP protocols; added separate fields for HTTP and WS addresses.
tools/walletextension/useraccountmanager/user_account_manager_test.go Updated function calls and arguments in TestAddingAndGettingUserAccountManagers and TestDeletingUserAccountManagers to reflect the new WebSocket and HTTP address parameters.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@zkokelj zkokelj marked this pull request as ready for review January 12, 2024 15:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 4

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cdc02eb and ecb2f9d.
Files selected for processing (7)
  • integration/obscurogateway/tengateway_test.go (3 hunks)
  • tools/walletextension/accountmanager/account_manager.go (6 hunks)
  • tools/walletextension/common/constants.go (1 hunks)
  • tools/walletextension/container/walletextension_container.go (4 hunks)
  • tools/walletextension/useraccountmanager/user_account_manager.go (3 hunks)
  • tools/walletextension/useraccountmanager/user_account_manager_test.go (2 hunks)
  • tools/walletextension/wallet_extension.go (4 hunks)
Additional comments: 22
tools/walletextension/common/constants.go (1)
  • 40-40: The addition of the HTTPProtocol constant is consistent with the existing constants and follows the correct syntax.
tools/walletextension/useraccountmanager/user_account_manager_test.go (2)
  • 12-12: The addition of the "http://test" argument in the NewUserAccountManager function call aligns with the updated function signature to accommodate HTTP and WebSocket addresses.

  • 53-53: The addition of the extra empty string arguments in the NewUserAccountManager function call is consistent with the updated function signature.

tools/walletextension/useraccountmanager/user_account_manager.go (4)
  • 16-22: The UserAccountManager struct has been updated to include separate fields for HTTP and WebSocket RPC addresses, which aligns with the architectural changes to support both protocols.

  • 27-33: The NewUserAccountManager function now correctly takes two additional parameters for the HTTP and WebSocket addresses, consistent with the updated struct.

  • 46-46: The NewAccountManager function within the UserAccountManager struct has been updated to use the WebSocket RPC address, which is appropriate for the context of subscriptions that still use WebSocket connections.

  • 99-99: The creation of a new client using the WebSocket address within the GetUserAccountManager method is consistent with the need to maintain WebSocket connections for certain operations.

tools/walletextension/container/walletextension_container.go (4)
  • 41-43: The differentiation between WebSocket and HTTP protocols for the host RPC bind addresses is correctly implemented, aligning with the architectural changes.

  • 55-55: The userAccountManager initialization now correctly uses both the HTTP and WebSocket addresses, which is consistent with the updated requirements.

  • 88-88: The creation of a new client using the WebSocket address for the default user account manager is appropriate and aligns with the changes made to support both protocols.

  • 113-120: The instantiation of the WalletExtension with separate fields for HTTP and WebSocket addresses is correctly implemented and necessary for the new communication protocol structure.

tools/walletextension/accountmanager/account_manager.go (4)
  • 37-46: The AccountManager struct has been updated to include a map for HTTP clients and a WebSocket address, which is consistent with the need to support both HTTP and WebSocket connections.

  • 50-57: The NewAccountManager function has been correctly updated to initialize the new fields in the AccountManager struct.

  • 78-78: The AddClient function now adds clients to the HTTP clients map, which is consistent with the updated struct and the architectural changes.

  • 114-150: The new functions suggestSubscriptionClient, filterClients, and createClientsForAllAccounts are correctly implemented to handle subscriptions using WebSocket clients, which is necessary due to the retention of WebSocket connections for subscription purposes.

tools/walletextension/wallet_extension.go (4)
  • 34-35: The WalletExtension struct now includes separate fields for HTTP and WebSocket addresses, which is necessary for the new communication protocol structure.

  • 47-64: The New function of the WalletExtension has been updated to accept separate HTTP and WebSocket addresses and correctly initializes the new fields in the struct.

  • 171-171: The creation of a new encrypted network client using the HTTP address within the SubmitViewingKey method is consistent with the updated struct and the need to support HTTP connections.

  • 243-251: The AddAddressToUser method correctly creates a new encrypted client using the HTTP address, which aligns with the changes made to support both protocols.

integration/obscurogateway/tengateway_test.go (3)
  • 669-669: The transferETHToAddress function is used to transfer ETH to a specified address within the tests. Ensure that this function is robust and handles all potential error cases, as transactions are a critical part of the test setup.
Verification successful

The output from the rg command shows that the transferETHToAddress function is called multiple times within the tengateway_test.go file. After each call, there is a require.NoError(t, err) statement. This indicates that the test is using the require package from the testify library to assert that no error was returned by the transferETHToAddress function. If an error is returned, the require.NoError function will fail the test and stop execution.

This is a common and appropriate way to handle errors in test functions in Go, as it ensures that the test will not proceed if a critical setup step, like transferring ETH, fails.

Based on this information, it can be concluded that the transferETHToAddress function is robust in terms of error handling, and the calls to this function within the test suite are correctly handling the potential errors by asserting that no error should occur.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the transferETHToAddress function is used consistently and correctly throughout the test suite.
rg --type go 'transferETHToAddress'

Length of output: 1196



Script:

#!/bin/bash
# Examine the definition of transferETHToAddress to check for error handling
ast-grep --lang go --pattern 'func transferETHToAddress($_, $_, $_, $_) ($_,$_){ $$$ }' integration/obscurogateway/tengateway_test.go

Length of output: 1757



Script:

#!/bin/bash
# Verify that the calls to transferETHToAddress handle the error that might be returned.
rg --type go 'transferETHToAddress' integration/obscurogateway/tengateway_test.go | rg 'err :='

Length of output: 95



Script:

#!/bin/bash
# Search for the calls to transferETHToAddress and get the surrounding lines of code to inspect error handling.
rg --type go -C 3 'transferETHToAddress' integration/obscurogateway/tengateway_test.go

Length of output: 1736

* 669-669: The `createTenNetwork` function is responsible for setting up a test network. It's important to ensure that this function is reliable and that the network setup is consistent with the requirements of the tests.
Verification successful

The output from the shell script indicates that the createTenNetwork function is defined and called within the integration/obscurogateway/tengateway_test.go file. The function is invoked with two parameters: t, which is likely a reference to the testing framework's *testing.T object, and startPort, which is an integer that probably specifies the starting port number for the test network.

Given this information, it appears that the createTenNetwork function is indeed used within the test suite, and its usage is consistent with the typical pattern of setting up a network for testing purposes. However, without further context on the implementation details of the createTenNetwork function and how it interacts with the rest of the test suite, we cannot fully verify the correctness of its usage.

To gain more insight into the implementation of the createTenNetwork function and to verify its correctness, we would need to review the function's definition and its calls in more detail.


The output from the shell script provides a snippet of the createTenNetwork function definition in the integration/obscurogateway/tengateway_test.go file. The function takes two parameters: a pointer to the testing framework's *testing.T object and an integer startPort. The comments and code within the function suggest that it is responsible for creating a simulated Ten network for testing purposes, with the following steps:

  1. It specifies the number of nodes in the network (numberOfNodes := 1).
  2. It creates simulated wallets using params.NewSimWallets.
  3. It defines simulation parameters (simParams) including the number of nodes, average block duration, and mock contract libraries for management and ERC20 contracts.
  4. It sets the starting port for the network (StartPort: startPort).

This function appears to be a setup utility for the test suite, configuring a simulated environment with one node and mock contracts, which is a common practice for integration tests that require a network-like environment.

Given this context, the createTenNetwork function seems to be used correctly within the test suite, as it is designed to set up a test network with specified parameters. The usage of this function in the test suite is consistent with its intended purpose.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the createTenNetwork function is used consistently and correctly throughout the test suite.
rg --type go 'createTenNetwork'

Length of output: 208



Script:

#!/bin/bash
# Review the implementation of the createTenNetwork function and its usage in the test suite.
rg --type go -A 10 'func createTenNetwork'

Length of output: 1038

* 669-669: The `waitServerIsReady` function is used to wait for the server to be ready to receive requests. It's important to ensure that this function is robust and handles all potential error cases, as a server not being ready could lead to failed tests.
Verification successful

The waitServerIsReady function appears in two test files: integration/obscuroscan/obscuroscan_test.go and integration/obscurogateway/tengateway_test.go. In both instances, the function is used to ensure the server is ready before proceeding with the tests. The function is defined in both files, suggesting that it is a utility function specific to each test suite.

Given this information, it seems that the function is used consistently within the context of the test suites for obscuroscan and tengateway. However, without reviewing the implementation details of the waitServerIsReady function, we cannot fully verify the robustness and error handling within the function itself.

To proceed with the verification, we should review the implementation of the waitServerIsReady function in both test files to ensure it handles potential error cases effectively.


The implementation of the waitServerIsReady function in both integration/obscuroscan/obscuroscan_test.go and integration/obscurogateway/tengateway_test.go appears to be identical. The function waits for up to 30 seconds, checking every 500 milliseconds to see if the server is ready by making a GET request to the server's health endpoint. If a connection error occurs, it continues to retry until the timeout is reached. For other types of errors, it returns immediately.

This implementation seems to handle the case where the server is not immediately ready by allowing some time for it to boot up and become responsive. The use of a health endpoint is a common pattern for checking server readiness, and the function's logic to handle connection errors by retrying suggests that it is designed to be robust against transient startup issues.

Given the output from the scripts, the waitServerIsReady function is consistently implemented across the two test files and includes basic error handling for connection-related issues. Therefore, the review comment about ensuring that the function is robust and handles all potential error cases is addressed by the current implementation.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the waitServerIsReady function is used consistently and correctly throughout the test suite.
rg --type go 'waitServerIsReady'

Length of output: 387



Script:

#!/bin/bash
# Review the implementation of the waitServerIsReady function in both test files.
rg --type go -A 10 'func waitServerIsReady' integration/obscuroscan/obscuroscan_test.go
rg --type go -A 10 'func waitServerIsReady' integration/obscurogateway/tengateway_test.go

Length of output: 907

integration/obscurogateway/tengateway_test.go Show resolved Hide resolved
Comment on lines 248 to 323
func testSubscriptionTopics(t *testing.T, httpURL, wsURL string, w wallet.Wallet) {
user0, err := NewUser([]wallet.Wallet{w}, httpURL, wsURL)
require.NoError(t, err)
fmt.Printf("Created user with encryption token: %s\n", user0.tgClient.UserID())

user1, err := NewUser([]wallet.Wallet{datagenerator.RandomWallet(integration.TenChainID), datagenerator.RandomWallet(integration.TenChainID)}, httpURL, wsURL)
require.NoError(t, err)
fmt.Printf("Created user with encryption token: %s\n", user0.tgClient.UserID())

// register all the accounts for that user
err = user0.RegisterAccounts()
require.NoError(t, err)
err = user1.RegisterAccounts()
require.NoError(t, err)

var amountToTransfer int64 = 1_000_000_000_000_000_000
// Transfer some funds to user1 to be able to make transactions
_, err = transferETHToAddress(user0.HTTPClient, user0.Wallets[0], user1.Wallets[0].Address(), amountToTransfer)
require.NoError(t, err)
time.Sleep(5 * time.Second)
_, err = transferETHToAddress(user0.HTTPClient, user0.Wallets[0], user1.Wallets[1].Address(), amountToTransfer)
require.NoError(t, err)

// Print balances of all registered accounts to check if all accounts have funds
err = user0.PrintUserAccountsBalances()
require.NoError(t, err)
err = user1.PrintUserAccountsBalances()
require.NoError(t, err)

// deploy events contract
deployTx := &types.LegacyTx{
Nonce: w.GetNonceAndIncrement(),
Gas: uint64(1_000_000),
GasPrice: gethcommon.Big1,
Data: gethcommon.FromHex(eventsContractBytecode),
}

signedTx, err := w.SignTransaction(deployTx)
require.NoError(t, err)

err = user0.HTTPClient.SendTransaction(context.Background(), signedTx)
require.NoError(t, err)

contractReceipt, err := integrationCommon.AwaitReceiptEth(context.Background(), user0.HTTPClient, signedTx.Hash(), time.Minute)
require.NoError(t, err)

// user0 subscribes to all events from that smart contract, user1 only an event with a topic of his first account
var user0logs []types.Log
var user1logs []types.Log
var topics [][]gethcommon.Hash
t1 := gethcommon.BytesToHash(user1.Wallets[1].Address().Bytes())
topics = append(topics, nil)
topics = append(topics, []gethcommon.Hash{t1})
subscribeToEvents([]gethcommon.Address{contractReceipt.ContractAddress}, nil, user0.WSClient, &user0logs)
subscribeToEvents([]gethcommon.Address{contractReceipt.ContractAddress}, topics, user1.WSClient, &user1logs)

// TODO: add a comment
_, err = integrationCommon.InteractWithSmartContract(user0.HTTPClient, user0.Wallets[0], eventsContractABI, "setMessage", "user0Event1", contractReceipt.ContractAddress)
require.NoError(t, err)
_, err = integrationCommon.InteractWithSmartContract(user0.HTTPClient, user0.Wallets[0], eventsContractABI, "setMessage", "user0Event2", contractReceipt.ContractAddress)
require.NoError(t, err)

_, err = integrationCommon.InteractWithSmartContract(user1.HTTPClient, user1.Wallets[0], eventsContractABI, "setMessage", "user1Event1", contractReceipt.ContractAddress)
require.NoError(t, err)
_, err = integrationCommon.InteractWithSmartContract(user1.HTTPClient, user1.Wallets[1], eventsContractABI, "setMessage", "user1Event2", contractReceipt.ContractAddress)
require.NoError(t, err)

// wait a few seconds to be completely sure all events arrived
time.Sleep(time.Second * 3)

// Assert the number of logs received by each client
// user0 should see two lifecycle events (1 for each interaction with the smart contract)
assert.Equal(t, 2, len(user0logs))
// user1 should see only one event (the other is filtered out because of the topic filter)
assert.Equal(t, 1, len(user1logs))
}
Copy link

@coderabbitai coderabbitai bot Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new test function testSubscriptionTopics has been added to verify the functionality of subscription topics over WebSocket connections. It's important to ensure that this test covers all relevant cases and that the TODO comment on line 304 is addressed before merging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a todo

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zkokelj The check for the TODO comment in the testSubscriptionTopics function didn't return any results, which suggests that the TODO has indeed been addressed. If there's anything else you need me to look into, please let me know!


\

Analysis chain
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Fetch the content of the testSubscriptionTopics function to verify the resolution of the TODO.
ast-grep --lang go --pattern $'func testSubscriptionTopics($_, $_, $_, $_) {
  $$$
  // TODO: $_
  $$$
}'

Length of output: 106


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between ecb2f9d and f6cbe5b.
Files selected for processing (1)
  • integration/obscurogateway/tengateway_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • integration/obscurogateway/tengateway_test.go

@ten-protocol ten-protocol deleted a comment from coderabbitai bot Jan 12, 2024
@ten-protocol ten-protocol deleted a comment from coderabbitai bot Jan 12, 2024
@zkokelj zkokelj requested a review from otherview January 15, 2024 13:09
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f6cbe5b and 0ce16b5.
Files selected for processing (2)
  • integration/obscurogateway/tengateway_test.go (3 hunks)
  • tools/walletextension/accountmanager/account_manager.go (6 hunks)
Files skipped from review as they are similar to previous changes (2)
  • integration/obscurogateway/tengateway_test.go
  • tools/walletextension/accountmanager/account_manager.go

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0ce16b5 and f676a96.
Files selected for processing (1)
  • tools/walletextension/accountmanager/account_manager.go (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • tools/walletextension/accountmanager/account_manager.go

Copy link
Contributor

@otherview otherview left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion, non-blocking tho.

tools/walletextension/accountmanager/account_manager.go Outdated Show resolved Hide resolved
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f676a96 and 483d7db.
Files selected for processing (2)
  • integration/obscurogateway/tengateway_test.go (3 hunks)
  • tools/walletextension/accountmanager/account_manager.go (6 hunks)
Files skipped from review as they are similar to previous changes (1)
  • integration/obscurogateway/tengateway_test.go
Additional comments: 13
tools/walletextension/accountmanager/account_manager.go (13)
  • 4-4: The import of the bytes package is new and should be used in the file. Ensure that it is indeed utilized in the code changes.
  • 14-14: The import of the storage package is new. Verify that the new storage functionality is integrated correctly and securely handles data.
  • 37-46: The AccountManager struct has been modified to include new fields for HTTP clients and WebSocket binding addresses. Ensure that these fields are properly initialized and used throughout the file.
  • 50-57: The NewAccountManager function has been updated to initialize the new fields in the AccountManager struct. Confirm that the parameters passed to this function are correctly assigned to the struct fields.
  • 67-68: The GetAllAddressesWithClients function now returns addresses associated with HTTP clients. Ensure that the conversion from gethcommon.Address to string is correct and that the addresses are properly formatted.
  • 78-78: The AddClient function has been updated to add HTTP clients to the accountClientsHTTP map. Verify that the client is correctly stored and that thread safety is maintained with the mutex.
  • 75-84: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [81-114]

The ProxyRequest function has been modified to handle subscription requests using WebSocket clients. Ensure that the logic for handling subscriptions and unsubscribing is correct and that errors are properly handled.

  • 117-150: The suggestSubscriptionClient function is new and creates WebSocket clients for subscriptions. Verify that the clients are created correctly and that the function handles errors appropriately.
  • 164-217: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [152-182]

The filterAccounts function is new and filters accounts based on the subscription filter criteria. Ensure that the filter logic is correct and that the function properly handles JSON marshaling and unmarshaling.

  • 185-195: The createClientsForAccounts function is new and creates WebSocket clients for all accounts. Verify that the clients are created correctly and that the function handles errors appropriately.
  • 202-214: The executeCall function has been modified to handle Ten RPC requests. Ensure that the logic for selecting the appropriate client is correct and that the function handles errors appropriately.
  • 1-24: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [230-260]

The helper functions parseParams, checkForFromField, and searchDataFieldForAccount are used to process RPC request parameters. Verify that these functions correctly parse and handle the parameters, and that they properly interact with the accClients map.

  • 1-24: > Note: This review was outside the patches, and no patch overlapping with it was found. Original lines [260-320]

The submitCall and setFromFieldIfMissing functions are used to submit RPC calls and ensure the from field is set. Verify that these functions correctly handle the request and response objects, and that they properly interact with the rpc.EncRPCClient.

@zkokelj zkokelj merged commit dcf96c9 into main Jan 17, 2024
2 checks passed
@zkokelj zkokelj deleted the ziga/ten_gateway_use_http_instead_of_ws branch January 17, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants