Merge pull request #5007

68f095f0 message_store: fix error message adding const char * with offset (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-01-07 21:26:52 +02:00
commit 53fba1455c
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -125,7 +125,7 @@ void message_store::set_signer(const multisig_wallet_state &state,
const boost::optional<std::string> &transport_address, const boost::optional<std::string> &transport_address,
const boost::optional<cryptonote::account_public_address> monero_address) const boost::optional<cryptonote::account_public_address> monero_address)
{ {
THROW_WALLET_EXCEPTION_IF(index >= m_num_authorized_signers, tools::error::wallet_internal_error, "Invalid signer index " + index); THROW_WALLET_EXCEPTION_IF(index >= m_num_authorized_signers, tools::error::wallet_internal_error, "Invalid signer index " + std::to_string(index));
authorized_signer &m = m_signers[index]; authorized_signer &m = m_signers[index];
if (label) if (label)
{ {
@ -146,7 +146,7 @@ void message_store::set_signer(const multisig_wallet_state &state,
const authorized_signer &message_store::get_signer(uint32_t index) const const authorized_signer &message_store::get_signer(uint32_t index) const
{ {
THROW_WALLET_EXCEPTION_IF(index >= m_num_authorized_signers, tools::error::wallet_internal_error, "Invalid signer index " + index); THROW_WALLET_EXCEPTION_IF(index >= m_num_authorized_signers, tools::error::wallet_internal_error, "Invalid signer index " + std::to_string(index));
return m_signers[index]; return m_signers[index];
} }
@ -201,7 +201,7 @@ void message_store::unpack_signer_config(const multisig_wallet_state &state, con
THROW_WALLET_EXCEPTION_IF(true, tools::error::wallet_internal_error, "Invalid structure of signer config"); THROW_WALLET_EXCEPTION_IF(true, tools::error::wallet_internal_error, "Invalid structure of signer config");
} }
uint32_t num_signers = (uint32_t)signers.size(); uint32_t num_signers = (uint32_t)signers.size();
THROW_WALLET_EXCEPTION_IF(num_signers != m_num_authorized_signers, tools::error::wallet_internal_error, "Wrong number of signers in config: " + num_signers); THROW_WALLET_EXCEPTION_IF(num_signers != m_num_authorized_signers, tools::error::wallet_internal_error, "Wrong number of signers in config: " + std::to_string(num_signers));
} }
void message_store::process_signer_config(const multisig_wallet_state &state, const std::string &signer_config) void message_store::process_signer_config(const multisig_wallet_state &state, const std::string &signer_config)
@ -424,7 +424,7 @@ void message_store::setup_signer_for_auto_config(uint32_t index, const std::stri
// auto-config parameters. In the wallet of somebody using the token to send auto-config // auto-config parameters. In the wallet of somebody using the token to send auto-config
// data the auto-config parameters are stored in the "me" signer and taken from there // data the auto-config parameters are stored in the "me" signer and taken from there
// to send that data. // to send that data.
THROW_WALLET_EXCEPTION_IF(index >= m_num_authorized_signers, tools::error::wallet_internal_error, "Invalid signer index " + index); THROW_WALLET_EXCEPTION_IF(index >= m_num_authorized_signers, tools::error::wallet_internal_error, "Invalid signer index " + std::to_string(index));
authorized_signer &m = m_signers[index]; authorized_signer &m = m_signers[index];
m.auto_config_token = token; m.auto_config_token = token;
crypto::hash_to_scalar(token.data(), token.size(), m.auto_config_secret_key); crypto::hash_to_scalar(token.data(), token.size(), m.auto_config_secret_key);
@ -506,7 +506,7 @@ void message_store::process_wallet_created_data(const multisig_wallet_state &sta
break; break;
default: default:
THROW_WALLET_EXCEPTION(tools::error::wallet_internal_error, "Illegal message type " + (uint32_t)type); THROW_WALLET_EXCEPTION(tools::error::wallet_internal_error, "Illegal message type " + std::to_string((uint32_t)type));
break; break;
} }
} }
@ -573,7 +573,7 @@ size_t message_store::get_message_index_by_id(uint32_t id) const
{ {
size_t index; size_t index;
bool found = get_message_index_by_id(id, index); bool found = get_message_index_by_id(id, index);
THROW_WALLET_EXCEPTION_IF(!found, tools::error::wallet_internal_error, "Invalid message id " + id); THROW_WALLET_EXCEPTION_IF(!found, tools::error::wallet_internal_error, "Invalid message id " + std::to_string(id));
return index; return index;
} }
@ -601,7 +601,7 @@ message message_store::get_message_by_id(uint32_t id) const
{ {
message m; message m;
bool found = get_message_by_id(id, m); bool found = get_message_by_id(id, m);
THROW_WALLET_EXCEPTION_IF(!found, tools::error::wallet_internal_error, "Invalid message id " + id); THROW_WALLET_EXCEPTION_IF(!found, tools::error::wallet_internal_error, "Invalid message id " + std::to_string(id));
return m; return m;
} }