diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index d35f0861..33bd6efa 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -317,8 +317,8 @@ simple_wallet::simple_wallet() m_cmd_binder.set_handler("remove_custom_asset_id", boost::bind(&simple_wallet::remove_custom_asset_id, this, ph::_1), "Cancel previously made approval for asset id"); m_cmd_binder.set_handler("generate_ionic_swap_proposal", boost::bind(&simple_wallet::generate_ionic_swap_proposal, this, ph::_1), "generate_ionic_swap_proposal - Generates ionic_swap proposal with given conditions"); - m_cmd_binder.set_handler("get_ionic_swap_proposal_info", boost::bind(&simple_wallet::get_ionic_swap_proposal_info, this, ph::_1), "get_ionic_swap_proposal_info - Extracts and display information from ionic_swap proposal raw data"); - m_cmd_binder.set_handler("accept_ionic_swap_proposal", boost::bind(&simple_wallet::accept_ionic_swap_proposal, this, ph::_1), "accept_ionic_swap_proposal - Accept ionic_swap proposal and generates exchange transaction"); + m_cmd_binder.set_handler("get_ionic_swap_proposal_info", boost::bind(&simple_wallet::get_ionic_swap_proposal_info, this, ph::_1), "get_ionic_swap_proposal_info - Extracts and display information from ionic_swap proposal raw data"); + m_cmd_binder.set_handler("accept_ionic_swap_proposal", boost::bind(&simple_wallet::accept_ionic_swap_proposal, this, ph::_1), "accept_ionic_swap_proposal - Accept ionic_swap proposal and generates exchange transaction"); } //---------------------------------------------------------------------------------------------------- @@ -2159,8 +2159,16 @@ bool simple_wallet::get_ionic_swap_proposal_info(const std::vector return true; } + std::string raw_hex_proposal; + bool r = epee::file_io_utils::load_file_to_string(args[0], raw_hex_proposal); + if (!r) + { + fail_msg_writer() << "Failed to load proposal hex from file"; + return true; + } + std::string raw_proposal; - bool r = epee::string_tools::parse_hexstr_to_binbuff(args[0], raw_proposal); + r = epee::string_tools::parse_hexstr_to_binbuff(raw_hex_proposal, raw_proposal); if (!r) { fail_msg_writer() << "Failed to parse proposal hex to raw data"; @@ -2192,8 +2200,17 @@ bool simple_wallet::accept_ionic_swap_proposal(const std::vector &a return true; } + std::string raw_hex_proposal; + bool r = epee::file_io_utils::load_file_to_string(args[0], raw_hex_proposal); + if (!r) + { + fail_msg_writer() << "Failed to load proposal hex from file"; + return true; + } + + std::string raw_proposal; - bool r = epee::string_tools::parse_hexstr_to_binbuff(args[0], raw_proposal); + r = epee::string_tools::parse_hexstr_to_binbuff(raw_hex_proposal, raw_proposal); if (!r) { fail_msg_writer() << "Failed to parse proposal hex to raw data";