Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.

feat(api): add query for listing all transactions#240

Merged
golnar-boosty merged 9 commits intostagingfrom
feature/add_all_transaction_list_query
Jan 27, 2025
Merged

feat(api): add query for listing all transactions#240
golnar-boosty merged 9 commits intostagingfrom
feature/add_all_transaction_list_query

Conversation

@golnar-boosty
Copy link
Copy Markdown
Collaborator

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, improving modularity, 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 and SaveTransactions to reduce redundancy and improve readability.

- Improved Transaction Query Handling:

1- Replaced the redundant TxsResponse definition with types.TxsResponse for consistency.
2- Consolidated transaction queries in GetTransactionsWithSync using BuildTxSearchEndpoint for endpoint construction.
3- Simplified direction-specific logic in GetFilteredTransactions by introducing the reusable processDirection 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 use types.TxsResponse.

…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.
@github-actions
Copy link
Copy Markdown

This repository does not accept pull requests from non version branches.
--- Please CLOSE this PR after acknowledging the issue ---

@github-actions github-actions bot added the invalid This doesn't seem right label Nov 21, 2024
@github-actions github-actions bot locked as spam and limited conversation to collaborators Nov 21, 2024
@github-actions github-actions bot unlocked this conversation Nov 29, 2024
@github-actions
Copy link
Copy Markdown

This repository does not accept pull requests from non version branches.
--- Please CLOSE this PR after acknowledging the issue ---

@github-actions github-actions bot locked as spam and limited conversation to collaborators Nov 29, 2024
@github-actions
Copy link
Copy Markdown

This repository does not accept pull requests from non version branches.
--- Please CLOSE this PR after acknowledging the issue ---

@github-actions github-actions bot unlocked this conversation Jan 27, 2025
@github-actions github-actions bot locked as spam and limited conversation to collaborators Jan 27, 2025
@golnar-boosty golnar-boosty changed the base branch from master to staging January 27, 2025 12:39
@golnar-boosty golnar-boosty merged commit ea4958a into staging Jan 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants