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::Spanish>::instance(),
|
||||
Language::Singleton<Language::Portuguese>::instance(),
|
||||
Language::Singleton<Language::Japanese>::instance(),
|
||||
Language::Singleton<Language::OldEnglish>::instance()
|
||||
Language::Singleton<Language::Japanese>::instance()
|
||||
});
|
||||
for (std::vector<Language::Base*>::iterator it = language_instances.begin();
|
||||
it != language_instances.end(); it++)
|
||||
|
@ -59,6 +59,7 @@ namespace crypto
|
||||
namespace ElectrumWords
|
||||
{
|
||||
|
||||
const std::string old_language_name = "OldEnglish";
|
||||
/*!
|
||||
* \brief Converts seed words to bytes (secret key).
|
||||
* \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
|
||||
{
|
||||
const int unique_prefix_length = 4; /*!< Length of the prefix of all words guaranteed to be unique */
|
||||
/*!
|
||||
* \class Base
|
||||
* \brief A base language class which all languages have to inherit from for
|
||||
* Polymorphism.
|
||||
*/
|
||||
class Base
|
||||
{
|
||||
protected:
|
||||
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> *trimmed_word_map; /*!< hash table to find word's trimmed index */
|
||||
std::string language_name; /*!< Name of language */
|
||||
/*!
|
||||
* \brief Populates the word maps after the list is ready.
|
||||
*/
|
||||
void populate_maps()
|
||||
{
|
||||
int ii;
|
||||
std::vector<std::string>::iterator it;
|
||||
for (it = word_list->begin(), ii = 0; it != word_list->end(); it++, ii++)
|
||||
{
|
||||
(*word_map)[*it] = ii;
|
||||
if (it->length() > unique_prefix_length)
|
||||
{
|
||||
(*trimmed_word_map)[it->substr(0, unique_prefix_length)] = ii;
|
||||
}
|
||||
else
|
||||
{
|
||||
(*trimmed_word_map)[*it] = ii;
|
||||
}
|
||||
}
|
||||
}
|
||||
public:
|
||||
Base()
|
||||
{
|
||||
word_list = new std::vector<std::string>;
|
||||
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.
|
||||
* \return A pointer to the word list.
|
||||
*/
|
||||
const std::vector<std::string>& get_word_list() const
|
||||
{
|
||||
return *word_list;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns 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
|
||||
{
|
||||
return *word_map;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns 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
|
||||
{
|
||||
return *trimmed_word_map;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns the name of the language.
|
||||
* \return Name of the language.
|
||||
*/
|
||||
std::string get_language_name() const
|
||||
{
|
||||
return language_name;
|
||||
}
|
||||
};
|
||||
const int unique_prefix_length = 4; /*!< Length of the prefix of all words guaranteed to be unique */
|
||||
/*!
|
||||
* \class Base
|
||||
* \brief A base language class which all languages have to inherit from for
|
||||
* Polymorphism.
|
||||
*/
|
||||
class Base
|
||||
{
|
||||
protected:
|
||||
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> *trimmed_word_map; /*!< hash table to find word's trimmed index */
|
||||
std::string language_name; /*!< Name of language */
|
||||
/*!
|
||||
* \brief Populates the word maps after the list is ready.
|
||||
*/
|
||||
void populate_maps()
|
||||
{
|
||||
int ii;
|
||||
std::vector<std::string>::iterator it;
|
||||
for (it = word_list->begin(), ii = 0; it != word_list->end(); it++, ii++)
|
||||
{
|
||||
(*word_map)[*it] = ii;
|
||||
if (it->length() > unique_prefix_length)
|
||||
{
|
||||
(*trimmed_word_map)[it->substr(0, unique_prefix_length)] = ii;
|
||||
}
|
||||
else
|
||||
{
|
||||
(*trimmed_word_map)[*it] = ii;
|
||||
}
|
||||
}
|
||||
}
|
||||
public:
|
||||
Base()
|
||||
{
|
||||
word_list = new std::vector<std::string>;
|
||||
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.
|
||||
* \return A pointer to the word list.
|
||||
*/
|
||||
const std::vector<std::string>& get_word_list() const
|
||||
{
|
||||
return *word_list;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns 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
|
||||
{
|
||||
return *word_map;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns 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
|
||||
{
|
||||
return *trimmed_word_map;
|
||||
}
|
||||
/*!
|
||||
* \brief Returns the name of the language.
|
||||
* \return Name of the language.
|
||||
*/
|
||||
std::string get_language_name() const
|
||||
{
|
||||
return language_name;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#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
|
||||
{
|
||||
/*!
|
||||
* \class Singleton
|
||||
*
|
||||
* \brief Single helper class.
|
||||
*
|
||||
* Do Language::Singleton<YourClass>::instance() to create a singleton instance
|
||||
* of `YourClass`.
|
||||
*/
|
||||
template <class T>
|
||||
class Singleton
|
||||
{
|
||||
Singleton() {}
|
||||
Singleton(Singleton &s) {}
|
||||
Singleton& operator=(const Singleton&) {}
|
||||
public:
|
||||
static T* instance()
|
||||
{
|
||||
static T* obj = new T;
|
||||
return obj;
|
||||
}
|
||||
};
|
||||
/*!
|
||||
* \class Singleton
|
||||
*
|
||||
* \brief Single helper class.
|
||||
*
|
||||
* Do Language::Singleton<YourClass>::instance() to create a singleton instance
|
||||
* of `YourClass`.
|
||||
*/
|
||||
template <class T>
|
||||
class Singleton
|
||||
{
|
||||
Singleton() {}
|
||||
Singleton(Singleton &s) {}
|
||||
Singleton& operator=(const Singleton&) {}
|
||||
public:
|
||||
static T* instance()
|
||||
{
|
||||
static T* obj = new T;
|
||||
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
|
||||
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);
|
||||
|
||||
std::string mnemonic_language = old_language;
|
||||
|
Loading…
Reference in New Issue
Block a user