-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(api): add query for listing all transactions #240
Open
golnar-boosty
wants to merge
7
commits into
master
Choose a base branch
from
feature/add_all_transaction_list_query
base: master
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.
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
…ded a function to simplify the creation of tx_search endpoint URLs. This utility takes the RPC address, query, pagination parameters, and order criteria as input, and returns a well-formatted endpoint string.
…struct. - Added a field to the struct to include the block height in transaction details. - Introduced a new struct for wrapping multiple transactions with a total count, enhancing API response consistency. This change improves the API structure by providing more granular transaction information and supporting batch responses effectively.
…Added as a direct dependency in . - Removed its previous listing as an indirect dependency. This change ensures the package is explicitly managed, improving dependency clarity and avoiding potential issues with transitive dependency resolution.
…ieval.Updated interx.tx_test.go to use types.TxsResponse instead of TxsResponse for consistency with the types package. Added getBlockHeight function to retrieve block height for a transaction hash from cache or Tendermint. Improved error handling and logging in getBlockHeight.
…ehavior. Refactored GetTransactions to simplify file path construction using basePath and suffix. Added a new resolveFileName helper function to centralize file name determination logic. Updated SaveTransactions to use resolveFileName, improving readability and maintainability. Improved conditional handling in SaveTransactions to append cached transactions only when an address is provided. Enhanced error logging with more descriptive messages in SaveTransactions.
…ng.Removed the redundant TxsResponse definition and replaced it with types.TxsResponse for consistency.Refactored GetTransactionsWithSync. Consolidated outbound and inbound logic with improved query construction.Eliminated unnecessary checks for empty addresses.Replaced repetitive endpoint construction with BuildTxSearchEndpoint. Simplified GetFilteredTransactions.Introduced processDirection to handle direction-specific logic modularly.Removed redundant loops and conditions for processing inbound and outbound transactions.Added processDirection as a reusable function for transaction direction handling.Enhanced QueryBlockTransactionsHandler.Removed redundant address validation.Updated responses to use types.TxsResponse for consistency.Removed the obsolete getBlockHeight function, as it is no longer needed.
This repository does not accept pull requests from non version branches. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Pull Request Description
This PR :
1- Add logic for paginated listing of all transactions
2- Refactors part of the transaction handling logic in the
interx
module, improvingmodularity
, readability, and maintainability while reducing redundancy. Below is a summary of the changes made across the commits:- Refactored File Path Logic for Transactions:
1- Centralized file path construction logic using a new
resolveFileName
helper function.2- Simplified logic in
GetTransactions
andSaveTransactions
to reduce redundancy and improve readability.- Improved Transaction Query Handling:
1- Replaced the redundant
TxsResponse
definition withtypes.TxsResponse
for consistency.2- Consolidated transaction queries in
GetTransactionsWithSync
usingBuildTxSearchEndpoint
for endpoint construction.3- Simplified direction-specific logic in
GetFilteredTransactions
by introducing the reusableprocessDirection
function.- Removed Redundant Functions and Code:
1- Eliminated the obsolete
getBlockHeight
function as it is no longer needed.2- Removed unnecessary validations and checks (e.g., redundant address validation in
QueryBlockTransactionsHandler
).- Enhanced Error Handling and Logging:
1- Improved error handling in
processDirection
and transaction queries to provide more meaningful logs and responses.- Standardized API Response Handling:
1- Updated responses in
QueryBlockTransactionsHandler
to consistently usetypes.TxsResponse
.