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

782 part1 #1478

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libraries/app/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ namespace graphene { namespace app {
{
FC_ASSERT( _app.chain_database() );
const auto& db = *_app.chain_database();
FC_ASSERT( limit <= 100 );
const uint32_t max_account_history_operations_limit=_app.get_options().max_account_history_operations_limit;
FC_ASSERT(limit <= max_account_history_operations_limit);
vector<operation_history_object> result;
account_id_type account;
try {
Expand Down
8 changes: 8 additions & 0 deletions libraries/app/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,12 @@ void application_impl::startup()
if ( _options->count("enable-subscribe-to-all") )
_app_options.enable_subscribe_to_all = _options->at( "enable-subscribe-to-all" ).as<bool>();

if ( _options->count("max-account-history-operations-limit") )
{
_app_options.max_account_history_operations_limit = _options->at("max-account-history-operations-limit").as<uint32_t>();
manikey123 marked this conversation as resolved.
Show resolved Hide resolved
}


if( _active_plugins.find( "market_history" ) != _active_plugins.end() )
_app_options.has_market_history_plugin = true;

Expand Down Expand Up @@ -982,6 +988,8 @@ void application::set_program_options(boost::program_options::options_descriptio
("enable-standby-votes-tracking", bpo::value<bool>()->implicit_value(true),
"Whether to enable tracking of votes of standby witnesses and committee members. "
"Set it to true to provide accurate data to API clients, set to false for slightly better performance.")
("max-account-history-operations-limit",boost::program_options::value<uint32_t>()->default_value(100),
"For history_api::get_account_history_operations to increase its limited value default is 100")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better "set" instead of "increase" (could also be used to decrease from default)

;
command_line_options.add(configuration_file_options);
command_line_options.add_options()
Expand Down
1 change: 1 addition & 0 deletions libraries/app/include/graphene/app/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ namespace graphene { namespace app {
public:
bool enable_subscribe_to_all = false;
bool has_market_history_plugin = false;
uint32_t max_account_history_operations_limit=100;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-Not needed for base scenario
-However needed for scenario from test case where initialization is not provided. Additionally this is part of the clarification I needed relating to below. More details in the main ticket (#782)

Needed clarification on :
1.
On running function get_account_history_operations located in file history_api_test.cpp, config.init file is not loaded , can you suggest any approach to test the API ?
image

I am using ilog function for debugging the shared_pointers as I face BOOST error for the RTTI symbols not found. In my company the team uses CLION IDE with GDB and found it to be more time-saving than ilog. I am open for any better way to debug and open to connect with any technical member for the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On running function get_account_history_operations located in file history_api_test.cpp, config.init file is not loaded , can you suggest any approach to test the API ?

To my knowledge, we don't have tests that use config files. Best approach might be to derive a subclass from database_fixture that creates and uses a config file in graphene::utilities::temp_directory_path().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On running function get_account_history_operations located in file history_api_test.cpp, config.init file is not loaded , can you suggest any approach to test the API ?

To my knowledge, we don't have tests that use config files. Best approach might be to derive a subclass from database_fixture that creates and uses a config file in graphene::utilities::temp_directory_path().

Thank you I shall explore above approach.
In addition if I start witness node and hit the API for function get_account_history_operations, would this option work? I shall explore this too and update.

};

class application
Expand Down