-
Notifications
You must be signed in to change notification settings - Fork 0
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
CI Tests #4
base: tests-set-up
Are you sure you want to change the base?
CI Tests #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed your code and found 2 potential issues.
while (true) { | ||
const logs = await provider.getLogs(filter); | ||
if (logs.length > 0) { | ||
return logs[0]; | ||
} | ||
await wait(retryInterval); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The queryLogsByBlock
and queryLogsByMessageIdentifier
functions have potential error handling issues. The code contains infinite loops without proper error handling mechanisms. If an error occurs during the execution of these functions, the code will continue to retry indefinitely without any way to break out of the loop or handle the error gracefully. To improve the robustness of the code, consider adding appropriate error handling within the loop. Catch any errors that occur, log them for debugging purposes, and decide whether to continue retrying or break out of the loop based on the nature of the error. Additionally, consider adding a maximum retry limit to prevent the loop from running indefinitely in case of persistent errors.
Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.
|
||
const runTest = async (eventType: string, expectedStructure: Partial<RelayState>, transactOpts: Transaction = validTransactOpts) => { | ||
const wallet = new Wallet(privateKey, provider); | ||
const tx = await performSwap(wallet, transactOpts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling around the performSwap
function call in the runTest
function. If an error occurs during the swap transaction, it should be caught, logged, and handled appropriately to provide clear error information and prevent the test from failing abruptly.
Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help Korbit improve your reviews.
Description by Korbit AI
What change is being made?
Refactor Jest configuration to update test paths, add new dependencies, and introduce comprehensive tests for relay process and monitoring.
Why are these changes being made?
The changes are necessary to improve the test coverage for the relay process and monitoring functionalities, ensuring robustness and reliability. Additionally, the updates to dependencies and configuration streamline the testing process and enhance compatibility with the latest tools and libraries.