chore: improve insert transaction response#3026
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the insert transaction response to include additional status messages by changing the return type from TransactionStatus to a pair containing TransactionStatus and a string message.
- Updated tests to check the first element of the returned pair.
- Refactored transaction_queue and transaction_manager implementations and their header declarations to provide detailed error messages.
- Adjusted network packet handler logic to use the new response format.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/full_node_test.cpp | Updated test comparison to use the first element of the returned pair. |
| libraries/core_libs/network/src/tarcap/packets_handlers/latest/transaction_packet_handler.cpp | Refactored status checks for the new response pair format. |
| libraries/core_libs/consensus/src/transaction/transaction_queue.cpp | Changed insert() return type to include a message and updated error responses. |
| libraries/core_libs/consensus/src/transaction/transaction_manager.cpp | Adjusted insertValidatedTransaction() to return status-message pair and updated condition handling accordingly. |
| libraries/core_libs/consensus/include/transaction/transaction_queue.hpp | Updated function signature to reflect the new return type. |
| libraries/core_libs/consensus/include/transaction/transaction_manager.hpp | Updated function signature to reflect the new return type. |
MatusKysel
approved these changes
Apr 28, 2025
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
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.
Add additional info in insert transaction response