diff --git a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp index c4f3dd87..10531317 100644 --- a/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp +++ b/libraries/plugins/peerplays_sidechain/sidechain_net_handler_ethereum.cpp @@ -23,18 +23,6 @@ namespace graphene { namespace peerplays_sidechain { -std::string string_to_hex(const std::string& in) -{ - std::stringstream ss; - - ss << std::hex << std::setfill('0'); - for (size_t i = 0; in.length() > i; ++i) { - ss << std::setw(2) << static_cast(static_cast(in[i])); - } - - return ss.str(); -} - ethereum_rpc_client::ethereum_rpc_client(const std::string &url, const std::string &user_name, const std::string &password, bool debug_rpc_calls) : rpc_client(url, user_name, password, debug_rpc_calls) { } @@ -91,7 +79,7 @@ std::string ethereum_rpc_client::get_transaction_receipt(const std::string& para data += (boost::format("%x") % boost::io::group(std::setw(64), std::setfill('0'), owner.second)).str(); } data += (boost::format("%x") % boost::io::group(std::setw(64), std::setfill('0'), object_id.size())).str(); - data += string_to_hex(object_id) + std::string( (64 - object_id.size() * 2 % 64), '0' ); + data += boost::algorithm::hex(object_id) + std::string( (64 - object_id.size() * 2 % 64), '0' ); return data; }(); @@ -668,7 +656,7 @@ std::string sidechain_net_handler_ethereum::create_primary_wallet_transaction(co data += (boost::format("%x") % boost::io::group(std::setw(64), std::setfill('0'), owner.second)).str(); } data += (boost::format("%x") % boost::io::group(std::setw(64), std::setfill('0'), object_id.size())).str(); - data += string_to_hex(object_id) + std::string( (64 - object_id.size() * 2 % 64), '0' ); + data += boost::algorithm::hex(object_id) + std::string( (64 - object_id.size() * 2 % 64), '0' ); return data; }();