mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 02:48:52 +00:00
Don't show Old English as an available option
This commit is contained in:
parent
3e6b6bad2d
commit
443d46a6f1
@ -349,8 +349,7 @@ namespace crypto
|
|||||||
Language::Singleton<Language::English>::instance(),
|
Language::Singleton<Language::English>::instance(),
|
||||||
Language::Singleton<Language::Spanish>::instance(),
|
Language::Singleton<Language::Spanish>::instance(),
|
||||||
Language::Singleton<Language::Portuguese>::instance(),
|
Language::Singleton<Language::Portuguese>::instance(),
|
||||||
Language::Singleton<Language::Japanese>::instance(),
|
Language::Singleton<Language::Japanese>::instance()
|
||||||
Language::Singleton<Language::OldEnglish>::instance()
|
|
||||||
});
|
});
|
||||||
for (std::vector<Language::Base*>::iterator it = language_instances.begin();
|
for (std::vector<Language::Base*>::iterator it = language_instances.begin();
|
||||||
it != language_instances.end(); it++)
|
it != language_instances.end(); it++)
|
||||||
|
@ -59,6 +59,7 @@ namespace crypto
|
|||||||
namespace ElectrumWords
|
namespace ElectrumWords
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const std::string old_language_name = "OldEnglish";
|
||||||
/*!
|
/*!
|
||||||
* \brief Converts seed words to bytes (secret key).
|
* \brief Converts seed words to bytes (secret key).
|
||||||
* \param words String containing the words separated by spaces.
|
* \param words String containing the words separated by spaces.
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,79 +17,79 @@
|
|||||||
*/
|
*/
|
||||||
namespace Language
|
namespace Language
|
||||||
{
|
{
|
||||||
const int unique_prefix_length = 4; /*!< Length of the prefix of all words guaranteed to be unique */
|
const int unique_prefix_length = 4; /*!< Length of the prefix of all words guaranteed to be unique */
|
||||||
/*!
|
/*!
|
||||||
* \class Base
|
* \class Base
|
||||||
* \brief A base language class which all languages have to inherit from for
|
* \brief A base language class which all languages have to inherit from for
|
||||||
* Polymorphism.
|
* Polymorphism.
|
||||||
*/
|
*/
|
||||||
class Base
|
class Base
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
std::vector<std::string> *word_list; /*!< A pointer to the array of words */
|
std::vector<std::string> *word_list; /*!< A pointer to the array of words */
|
||||||
std::unordered_map<std::string, uint32_t> *word_map; /*!< hash table to find word's index */
|
std::unordered_map<std::string, uint32_t> *word_map; /*!< hash table to find word's index */
|
||||||
std::unordered_map<std::string, uint32_t> *trimmed_word_map; /*!< hash table to find word's trimmed index */
|
std::unordered_map<std::string, uint32_t> *trimmed_word_map; /*!< hash table to find word's trimmed index */
|
||||||
std::string language_name; /*!< Name of language */
|
std::string language_name; /*!< Name of language */
|
||||||
/*!
|
/*!
|
||||||
* \brief Populates the word maps after the list is ready.
|
* \brief Populates the word maps after the list is ready.
|
||||||
*/
|
*/
|
||||||
void populate_maps()
|
void populate_maps()
|
||||||
{
|
{
|
||||||
int ii;
|
int ii;
|
||||||
std::vector<std::string>::iterator it;
|
std::vector<std::string>::iterator it;
|
||||||
for (it = word_list->begin(), ii = 0; it != word_list->end(); it++, ii++)
|
for (it = word_list->begin(), ii = 0; it != word_list->end(); it++, ii++)
|
||||||
{
|
{
|
||||||
(*word_map)[*it] = ii;
|
(*word_map)[*it] = ii;
|
||||||
if (it->length() > unique_prefix_length)
|
if (it->length() > unique_prefix_length)
|
||||||
{
|
{
|
||||||
(*trimmed_word_map)[it->substr(0, unique_prefix_length)] = ii;
|
(*trimmed_word_map)[it->substr(0, unique_prefix_length)] = ii;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(*trimmed_word_map)[*it] = ii;
|
(*trimmed_word_map)[*it] = ii;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
Base()
|
Base()
|
||||||
{
|
{
|
||||||
word_list = new std::vector<std::string>;
|
word_list = new std::vector<std::string>;
|
||||||
word_map = new std::unordered_map<std::string, uint32_t>;
|
word_map = new std::unordered_map<std::string, uint32_t>;
|
||||||
trimmed_word_map = new std::unordered_map<std::string, uint32_t>;
|
trimmed_word_map = new std::unordered_map<std::string, uint32_t>;
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a pointer to the word list.
|
* \brief Returns a pointer to the word list.
|
||||||
* \return A pointer to the word list.
|
* \return A pointer to the word list.
|
||||||
*/
|
*/
|
||||||
const std::vector<std::string>& get_word_list() const
|
const std::vector<std::string>& get_word_list() const
|
||||||
{
|
{
|
||||||
return *word_list;
|
return *word_list;
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a pointer to the word map.
|
* \brief Returns a pointer to the word map.
|
||||||
* \return A pointer to the word map.
|
* \return A pointer to the word map.
|
||||||
*/
|
*/
|
||||||
const std::unordered_map<std::string, uint32_t>& get_word_map() const
|
const std::unordered_map<std::string, uint32_t>& get_word_map() const
|
||||||
{
|
{
|
||||||
return *word_map;
|
return *word_map;
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns a pointer to the trimmed word map.
|
* \brief Returns a pointer to the trimmed word map.
|
||||||
* \return A pointer to the trimmed word map.
|
* \return A pointer to the trimmed word map.
|
||||||
*/
|
*/
|
||||||
const std::unordered_map<std::string, uint32_t>& get_trimmed_word_map() const
|
const std::unordered_map<std::string, uint32_t>& get_trimmed_word_map() const
|
||||||
{
|
{
|
||||||
return *trimmed_word_map;
|
return *trimmed_word_map;
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the name of the language.
|
* \brief Returns the name of the language.
|
||||||
* \return Name of the language.
|
* \return Name of the language.
|
||||||
*/
|
*/
|
||||||
std::string get_language_name() const
|
std::string get_language_name() const
|
||||||
{
|
{
|
||||||
return language_name;
|
return language_name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -38,25 +38,25 @@
|
|||||||
*/
|
*/
|
||||||
namespace Language
|
namespace Language
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* \class Singleton
|
* \class Singleton
|
||||||
*
|
*
|
||||||
* \brief Single helper class.
|
* \brief Single helper class.
|
||||||
*
|
*
|
||||||
* Do Language::Singleton<YourClass>::instance() to create a singleton instance
|
* Do Language::Singleton<YourClass>::instance() to create a singleton instance
|
||||||
* of `YourClass`.
|
* of `YourClass`.
|
||||||
*/
|
*/
|
||||||
template <class T>
|
template <class T>
|
||||||
class Singleton
|
class Singleton
|
||||||
{
|
{
|
||||||
Singleton() {}
|
Singleton() {}
|
||||||
Singleton(Singleton &s) {}
|
Singleton(Singleton &s) {}
|
||||||
Singleton& operator=(const Singleton&) {}
|
Singleton& operator=(const Singleton&) {}
|
||||||
public:
|
public:
|
||||||
static T* instance()
|
static T* instance()
|
||||||
{
|
{
|
||||||
static T* obj = new T;
|
static T* obj = new T;
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -507,7 +507,7 @@ bool simple_wallet::new_wallet(const std::string &wallet_file, const std::string
|
|||||||
// convert rng value to electrum-style word list
|
// convert rng value to electrum-style word list
|
||||||
std::string electrum_words;
|
std::string electrum_words;
|
||||||
|
|
||||||
bool was_deprecated_wallet = (old_language == "OldEnglish") ||
|
bool was_deprecated_wallet = (old_language == crypto::ElectrumWords::old_language_name) ||
|
||||||
crypto::ElectrumWords::get_is_old_style_seed(m_electrum_seed);
|
crypto::ElectrumWords::get_is_old_style_seed(m_electrum_seed);
|
||||||
|
|
||||||
std::string mnemonic_language = old_language;
|
std::string mnemonic_language = old_language;
|
||||||
|
Loading…
Reference in New Issue
Block a user