Commit 050b68be authored by Mariusz's avatar Mariusz
Browse files

Some simplifications regarding `legacy_switcher` class + some cleanup

parent 6a9e9383
......@@ -356,8 +356,8 @@ namespace detail
{
if( method_name == "network_broadcast_api.broadcast_transaction" )
{
legacy_switcher switcher;
ilog("Change of serialization( `network_broadcast_api.broadcast_transaction' ) - ${format} is enabled now", ("format", legacy_switcher::info()) );
legacy_switcher switcher( hive::protocol::transaction_serialization_type::legacy );
ilog("Change of serialization( `network_broadcast_api.broadcast_transaction' ) - a legacy format is enabled now" );
response.result = (*call)( func_args );
}
else
......
......@@ -31,11 +31,8 @@ struct legacy_switcher
{
const transaction_serialization_type old_transaction_serialization = dynamic_serializer::default_transaction_serialization;
legacy_switcher();
legacy_switcher( transaction_serialization_type val );
~legacy_switcher();
static std::string info();
};
std::string trim_legacy_typename_namespace( const std::string& name );
......
......@@ -4,14 +4,6 @@ namespace hive { namespace protocol {
thread_local transaction_serialization_type dynamic_serializer::transaction_serialization = dynamic_serializer::default_transaction_serialization;
legacy_switcher::legacy_switcher() : old_transaction_serialization( dynamic_serializer::transaction_serialization )
{
if( dynamic_serializer::transaction_serialization == transaction_serialization_type::hf26 )
dynamic_serializer::transaction_serialization = transaction_serialization_type::legacy;
else
dynamic_serializer::transaction_serialization = transaction_serialization_type::hf26;
}
legacy_switcher::legacy_switcher( transaction_serialization_type val ) : old_transaction_serialization( dynamic_serializer::transaction_serialization )
{
dynamic_serializer::transaction_serialization = val;
......@@ -22,11 +14,6 @@ legacy_switcher::~legacy_switcher()
dynamic_serializer::transaction_serialization = old_transaction_serialization;
}
std::string legacy_switcher::info()
{
return dynamic_serializer::transaction_serialization == transaction_serialization_type::legacy ? "legacy format" : "hf26 format";
}
std::string trim_legacy_typename_namespace( const std::string& name )
{
auto start = name.find_last_of( ':' ) + 1;
......
......@@ -114,8 +114,6 @@ namespace detail {
uint64_t error_response_count = 0;
uint64_t total_request_count = 0;
bool use_now_time;
};
node_based_conversion_plugin_impl::node_based_conversion_plugin_impl( const std::string& input_url, const std::vector< std::string >& output_urls,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment