fixed tracking wallet seed phrase

This commit is contained in:
cryptozoidberg 2021-05-25 16:43:47 +02:00
parent 1d1014d2f9
commit add2de9b51
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
4 changed files with 38 additions and 14 deletions

View file

@ -95,21 +95,21 @@ namespace plain_wallet
std::string get_wallets_folder()
{
#ifdef WIN32
return "";
std::string path = get_bundle_working_dir() + "/" + WALLETS_FOLDER_NAME + "/";
#else
std::string path = get_bundle_working_dir() + "/" + WALLETS_FOLDER_NAME + "/";
return path;
#endif // WIN32
return path;
}
std::string get_app_config_folder()
{
#ifdef WIN32
return "";
std::string path = get_bundle_working_dir() + "/" + APP_CONFIG_FOLDER + "/";
#else
std::string path = get_bundle_working_dir() + "/" + APP_CONFIG_FOLDER + "/";
return path;
#endif // WIN32
return path;
}
#ifdef ANDROID_BUILD
class android_logger : public log_space::ibase_log_stream

View file

@ -48,6 +48,16 @@ namespace tools
result.hash_sum_matched = false;
}
}
if (!result.syntax_correct)
{
//possibly tracking wallet
currency::account_base acc;
result.syntax_correct = acc.restore_from_tracking_seed(seed_phrase);
if (result.syntax_correct)
{
result.tracking = true;
}
}
return API_RETURN_CODE_OK;
}
}

View file

@ -184,11 +184,13 @@ namespace wallet_public
bool syntax_correct;
bool require_password;
bool hash_sum_matched;
bool tracking;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(syntax_correct)
KV_SERIALIZE(require_password)
KV_SERIALIZE(hash_sum_matched)
KV_SERIALIZE(tracking)
END_KV_SERIALIZE_MAP()
};

View file

@ -31,17 +31,29 @@ struct try_pull_result_open_response
void run_plain_wallet_api_test()
{
LOG_PRINT_L0("Creating instance...");
std::string s = plain_wallet::init("195.201.107.230", "11211", boost::dll::program_location().parent_path().string(), 1);
s = plain_wallet::get_export_private_info("E:\\tmp\\check_export");
std::string key = plain_wallet::generate_random_key(10);
std::string test_data = "1234567890 test test ";
std::string res = plain_wallet::set_appconfig(test_data, key);
std::string test_data2 = plain_wallet::get_appconfig(key);
if (test_data2 != test_data)
{
LOG_ERROR("Error");
}
//plain_wallet::set_bundle_working_dir("E:\\tmp\\check_export");
std::string s = plain_wallet::init("195.201.107.230", "33333", boost::dll::program_location().parent_path().string(), 1);
//s = plain_wallet::get_export_private_info("E:\\tmp\\check_export");
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", "");
epee::misc_utils::sleep_no_w(10000000);
//std::string key = plain_wallet::generate_random_key(10);
//std::string test_data = "1234567890 test test ";
//std::string res = plain_wallet::set_appconfig(test_data, key);
//std::string test_data2 = plain_wallet::get_appconfig(key);
//if (test_data2 != test_data)
//{
// LOG_ERROR("Error");
//}
return;
//std::string fres = plain_wallet::get_logs_buffer();
//std::string fres2 = plain_wallet::truncate_log();