bitshares / bitshares-core

BitShares Blockchain node and command-line wallet
https://bitshares.github.io/
Other
1.17k stars 649 forks source link

Add `database_api::get_next_object_id` API #2653

Closed abitmore closed 2 years ago

abitmore commented 2 years ago

PR for #2649.

This PR adds a database API which partially depends on the api_helper_indexes plugin.

/**
 * @brief Get the next object ID in an object space
 * @param space_id The space ID
 * @param type_id The type ID
 * @param with_pending_transactions Whether to include pending transactions
 * @return The next object ID to be assigned
 * @throw fc::exception If the object space does not exist, or @p with_pending_transactions
 *                      is @a false but the api_helper_indexes plugin is not enabled
 */
object_id_type get_next_object_id( uint8_t space_id, uint8_t type_id,
                                   bool with_pending_transactions )const;
sonarcloud[bot] commented 2 years ago

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

100.0% 100.0% Coverage
0.0% 0.0% Duplication