forked from lthn/blockchain
fixed errors reporting for mobile wallet
This commit is contained in:
parent
3939277ed0
commit
b41d87a051
2 changed files with 31 additions and 14 deletions
|
|
@ -385,14 +385,20 @@ namespace tools
|
|||
std::string to_string() const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << transfer_error::to_string() << ", mixin_count = " << m_mixin_count << ", scanty_outs:";
|
||||
for (const auto& outs_for_amount : m_scanty_outs)
|
||||
{
|
||||
ss << '\n' << currency::print_money(outs_for_amount.amount) << " - " << outs_for_amount.outs.size();
|
||||
}
|
||||
ss << API_RETURN_CODE_NOT_ENOUGH_OUTPUTS_FOR_MIXING;
|
||||
//ss << transfer_error::to_string() << ", mixin_count = " << m_mixin_count << ", scanty_outs:";
|
||||
//for (const auto& outs_for_amount : m_scanty_outs)
|
||||
//{
|
||||
// ss << '\n' << currency::print_money(outs_for_amount.amount) << " - " << outs_for_amount.outs.size();
|
||||
//}
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual const char* what() const noexcept
|
||||
{
|
||||
return API_RETURN_CODE_NOT_ENOUGH_OUTPUTS_FOR_MIXING;
|
||||
}
|
||||
|
||||
private:
|
||||
scanty_outs_t m_scanty_outs;
|
||||
size_t m_mixin_count;
|
||||
|
|
@ -534,14 +540,18 @@ namespace tools
|
|||
std::string to_string() const
|
||||
{
|
||||
std::ostringstream ss;
|
||||
currency::transaction tx = m_tx;
|
||||
ss << transfer_error::to_string() <<
|
||||
", tx_size_limit = " << m_tx_size_limit <<
|
||||
", tx size = " << get_object_blobsize(m_tx) <<
|
||||
", tx:\n" << currency::obj_to_json_str(tx);
|
||||
ss << API_RETURN_CODE_TX_IS_TOO_BIG;
|
||||
//currency::transaction tx = m_tx;
|
||||
//ss << transfer_error::to_string() <<
|
||||
// ", tx_size_limit = " << m_tx_size_limit <<
|
||||
// ", tx size = " << get_object_blobsize(m_tx) <<
|
||||
// ", tx:\n" << currency::obj_to_json_str(tx);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
virtual const char* what() const noexcept
|
||||
{
|
||||
return API_RETURN_CODE_TX_IS_TOO_BIG;
|
||||
}
|
||||
private:
|
||||
currency::transaction m_tx;
|
||||
uint64_t m_tx_size_limit;
|
||||
|
|
|
|||
|
|
@ -40,11 +40,18 @@ void run_plain_wallet_api_test()
|
|||
std::string res = plain_wallet::sync_call("get_seed_phrase_info", 0, "{\"seed_phrase\":\"aZxat4HAWriVQ3enkGcVsrZRdMseAJswG3CSEwTqZS246VsFQ53w26eZstYsu1jWE74Atz9ajLxFnBsVTafncWNH5SMv4zHFaTS:1780c4d5dd7e97cc4a75ea8baa7977d12ef948b9a6dddc2a9a37e5e22ac7180e:1599495055\"}");
|
||||
|
||||
|
||||
res = plain_wallet::restore("footstep knowledge fur capture honey minute carefully peaceful lovely crawl lunch government nightmare friendship myself sign possibly plan flower depression bread rainbow wrong hardly dark chest",
|
||||
"test_wall2.zan", "111", "");
|
||||
// res = plain_wallet::restore("footstep knowledge fur capture honey minute carefully peaceful lovely crawl lunch government nightmare friendship myself sign possibly plan flower depression bread rainbow wrong hardly dark chest",
|
||||
// "test_wall2.zan", "111", "");
|
||||
|
||||
// epee::misc_utils::sleep_no_w(30000);
|
||||
|
||||
// plain_wallet::close_wallet(0);
|
||||
res = plain_wallet::open("test_wall2.zan", "111");
|
||||
|
||||
|
||||
epee::misc_utils::sleep_no_w(10000000);
|
||||
res = plain_wallet::invoke(0, "{\"method\":\"transfer\",\"params\":{\"destinations\":[{\"amount\":10000000000,\"address\":\"aZxat4HAWriVQ3enkGcVsrZRdMseAJswG3CSEwTqZS246VsFQ53w26eZstYsu1jWE74Atz9ajLxFnBsVTafncWNH5SMv4zHFaTS\"}],\"fee\":10000000000,\"mixin\":1011111,\"payment_id\":\"\",\"push_payer\":true,\"hide_receiver\":false}}");
|
||||
|
||||
//epee::misc_utils::sleep_no_w(10000000);
|
||||
|
||||
//std::string key = plain_wallet::generate_random_key(10);
|
||||
//std::string test_data = "1234567890 test test ";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue