-
Notifications
You must be signed in to change notification settings - Fork 129
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
Move off-chain-updates tests to its own package #1655
Conversation
WalkthroughThe recent changes involve renaming several functions in the Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- protocol/indexer/off_chain_updates/off_chain_updates.go (8 hunks)
- protocol/indexer/off_chain_updates/off_chain_updates_test.go (15 hunks)
Files skipped from review due to trivial changes (1)
- protocol/indexer/off_chain_updates/off_chain_updates_test.go
Additional comments not posted (3)
protocol/indexer/off_chain_updates/off_chain_updates.go (3)
Line range hint
287-308
: Review the implementation ofNewOrderPlaceMessage
.The implementation of
NewOrderPlaceMessage
looks correct and follows the expected structure for creating anOffChainUpdate
struct. The use ofproto.Marshal
is appropriate for encoding the structure into a byte slice.
Line range hint
305-329
: Review the implementation ofNewOrderRemoveMessage
.The function
NewOrderRemoveMessage
is implemented correctly. It properly constructs theOffChainUpdate
struct and handles the marshaling process. Good use of structured logging and error handling within the function.
Line range hint
329-345
: Review the implementation ofNewOrderUpdateMessage
.The implementation of
NewOrderUpdateMessage
is correct. It effectively creates anOffChainUpdate
struct and encodes it as a byte slice usingproto.Marshal
. The function parameters are used appropriately to construct the message.
@@ -48,7 +48,7 @@ func CreateOrderPlaceMessage( | |||
return msgsender.Message{}, false | |||
} | |||
|
|||
update, err := newOrderPlaceMessage(order) | |||
update, err := NewOrderPlaceMessage(order) |
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.
Ensure proper error handling in NewOrderPlaceMessage
.
The function NewOrderPlaceMessage
is called without handling its error return value. This could lead to unhandled exceptions or incorrect behavior in case of an error. Consider adding error handling here.
@@ -92,7 +92,7 @@ | |||
return msgsender.Message{}, false | |||
} | |||
|
|||
update, err := newOrderReplaceMessage(order) | |||
update, err := NewOrderReplaceMessage(order) |
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.
Ensure proper error handling in NewOrderReplaceMessage
.
Similar to the previous comment, the error returned by NewOrderReplaceMessage
is not handled. Proper error handling is crucial to ensure the robustness of the application.
@@ -139,7 +139,7 @@ | |||
return msgsender.Message{}, false | |||
} | |||
|
|||
update, err := newOrderUpdateMessage(orderId, totalFilled) | |||
update, err := NewOrderUpdateMessage(orderId, totalFilled) |
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.
Ensure proper error handling in NewOrderUpdateMessage
.
The function NewOrderUpdateMessage
is invoked here without handling its error return value. It's important to handle all potential errors to prevent runtime issues.
@@ -192,7 +192,7 @@ | |||
return msgsender.Message{}, false | |||
} | |||
|
|||
update, err := newOrderRemoveMessage(orderId, reason, removalStatus) | |||
update, err := NewOrderRemoveMessage(orderId, reason, removalStatus) |
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.
Ensure proper error handling in NewOrderRemoveMessage
.
The error returned by NewOrderRemoveMessage
is not handled in this context. Handling errors appropriately is essential for maintaining the integrity of the application's operations.
Changelist
indexer/off_chain_updates/off_chain_updates.go:1: : import cycle not allowed in test
while working on another pr. Moved test into a new package to fix the issue.Summary by CodeRabbit