Skip to content
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

Add history_api::get_block_operation_history API #1899

Merged
merged 5 commits into from
Jul 10, 2022

Conversation

abitmore
Copy link
Member

@abitmore abitmore commented Aug 11, 2019

PR for #243. Also useful for #2268.

The API will return all operations inside a block or a transaction, including virtual operations.

/**
* @brief Get all operations inside a block or a transaction, including virtual operations
* @param block_num the number (height) of the block to fetch
* @param trx_in_block the sequence of a transaction in the block, starts from @a 0, optional.
*                     If specified, will return only operations of that transaction.
*                     If omitted, will return all operations in the specified block.
* @return a list of @a operation_history objects ordered by ID
*
* @note the data is fetched from @a account_history plugin, thus the result is possible to
*       be incomplete due to the @a partial-operations option configured in the API node.
*       For complete data, it is recommended to query from ElasticSearch where data is
*       maintained by @a elastic_search plugin.
*/
vector<operation_history_object> get_block_operation_history(
               uint32_t block_num,
               optional<uint16_t> trx_in_block = {} ) const;

@pmconrad
Copy link
Contributor

IMO adding this call doesn't make much sense at this time, because it relies on data that is known to be incomplete for (almost) all nodes. I think we should discourage using node API for history data and not add this call.

@jmjatlanta
Copy link
Contributor

Code looks good. If we can come up with a solid use case perhaps that will ease the concerns of @pmconrad . Since @xeroc made the original ticket, perhaps he can chime in.

@xeroc
Copy link
Member

xeroc commented Aug 21, 2019

I agree with Peter, if the data cannot be obtained reliably, why have an API to obtain it.

@abitmore abitmore removed this from the 4.1.0 - Feature Release milestone Aug 21, 2019
@abitmore
Copy link
Member Author

Closing. Let ES do the job.

@abitmore abitmore closed this Aug 21, 2019
@abitmore abitmore deleted the pr-get-block-ops-api branch August 21, 2019 19:41
@abitmore abitmore restored the pr-get-block-ops-api branch July 7, 2022 15:08
@abitmore abitmore reopened this Jul 7, 2022
@abitmore abitmore removed the won't fix label Jul 7, 2022
@abitmore abitmore added this to the 6.1.0 - Feature Release milestone Jul 7, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jul 10, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

96.2% 96.2% Coverage
0.0% 0.0% Duplication

@abitmore abitmore merged commit 908609c into develop Jul 10, 2022
@abitmore abitmore deleted the pr-get-block-ops-api branch July 10, 2022 16:22
@abitmore abitmore changed the title Add get_block_operation_history API Add history_api::get_block_operation_history API Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can operation_results please show the operation id(s) of all ops in the tx?
5 participants