35#include <system_error>
101 template<
typename Base>
104 const std::string&
location()
const {
return m_loc; }
108 std::ostringstream ss;
109 ss << m_loc <<
':' <<
typeid(*this).name() <<
": " << Base::what();
125 "failed to get blocks",
126 "failed to get hashes",
127 "failed to get out indices",
128 "failed to get random outs"
138 template<
typename Base,
int msg_index>
147 const std::string&
status()
const {
return m_status; }
151 std::ostringstream ss;
152 ss << Base::to_string() <<
", status = " <<
status();
157 std::string m_status;
183 std::ostringstream ss;
205 std::ostringstream ss;
226 :
wallet_runtime_error(
std::move(loc),
"This signature was made with stale data: export fresh multisig data, which other participants must then use")
234 :
wallet_runtime_error(
std::move(loc),
"Not enough multisig data was found to sign: import multisig data from more other participants")
241 explicit password_needed(std::string&& loc,
const std::string &msg =
"Password needed")
256 "file already exists",
258 "failed to read file",
259 "failed to save file"
269 template<
int msg_index>
278 explicit file_error_base(std::string&& loc,
const std::string&
file,
const std::error_code &e)
284 const std::string&
file()
const {
return m_file; }
385 std::ostringstream ss;
401 , m_block_blob(block_data)
488 std::ostringstream ss;
514 std::ostringstream ss;
542 std::ostringstream ss;
572 std::ostringstream ss;
574 for (
const auto& out: m_scanty_outs)
583 size_t m_mixin_count;
588 typedef std::vector<cryptonote::tx_source_entry>
sources_t;
612 std::ostringstream ss;
615 for (
size_t i = 0; i < m_sources.size(); ++i)
618 ss <<
"\n source " << i <<
":";
632 ss <<
"\nDestinations:";
633 for (
size_t i = 0; i < m_destinations.size(); ++i)
640 ss <<
"\nunlock_time: " << m_unlock_time;
663 const std::string&
status()
const {
return m_status; }
664 const std::string&
reason()
const {
return m_reason; }
668 std::ostringstream ss;
672 if (!m_reason.empty())
674 ss <<
" (" << m_reason <<
")";
681 std::string m_status;
682 std::string m_reason;
689 ,
const std::vector<cryptonote::tx_destination_entry>&
destinations
700 const std::vector<cryptonote::tx_destination_entry>&
destinations()
const {
return m_destinations; }
705 std::ostringstream ss;
709 for (
const auto& dst : m_destinations)
717 std::vector<cryptonote::tx_destination_entry> m_destinations;
748 std::ostringstream ss;
750 ", tx_weight_limit = " << m_tx_weight_limit <<
751 ", tx weight = " << m_tx_weight;
777 const std::string&
request()
const {
return m_request; }
781 std::ostringstream ss;
794 std::string m_request;
804 const std::string&
status()
const {
return m_status; }
806 const std::string m_status;
864 const std::string&
keys_file()
const {
return m_keys_file; }
870 std::string m_keys_file;
871 std::string m_wallet_file;
894 :
mms_error(
std::move(loc),
"PyBitmessage returned " + error_string)
900#if !defined(_MSC_VER)
902 template<
typename TException,
typename... TArgs>
905 TException e(std::move(loc), args...);
911 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
912 #include <boost/preprocessor/repetition/enum_params.hpp>
913 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
915 template<
typename TException>
918 TException e(std::move(loc));
923#define GEN_throw_wallet_ex(z, n, data) \
924 template<typename TException, BOOST_PP_ENUM_PARAMS(n, typename TArg)> \
925 void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \
927 TException e(std::move(loc), BOOST_PP_ENUM_PARAMS(n, arg)); \
928 LOG_PRINT_L0(e.to_string()); \
932 BOOST_PP_REPEAT_FROM_TO(1, 6, GEN_throw_wallet_ex, ~)
937#define STRINGIZE_DETAIL(x) #x
938#define STRINGIZE(x) STRINGIZE_DETAIL(x)
940#define THROW_WALLET_EXCEPTION(err_type, ...) \
942 LOG_ERROR("THROW EXCEPTION: " << #err_type); \
943 tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
946#define THROW_WALLET_EXCEPTION_IF(cond, err_type, ...) \
949 LOG_ERROR(#cond << ". THROW EXCEPTION: " << #err_type); \
950 tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
std::string message("Message requiring signing")
Holds cryptonote related classes and helpers.
std::string obj_to_json_str(T &obj)
std::string get_account_address_as_str(network_type nettype, bool subaddress, account_public_address const &adr)
std::string print_etn(uint64_t amount, unsigned int decimal_point)
unsigned __int64 uint64_t
account_public_address addr
password_entry_failed(std::string &&loc, const std::string &msg="Password entry failed")