Kagome
Polkadot Runtime Engine in C++17
dictionary.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CRYPTO_BIP39_DICTIONARIES_HPP
7 #define KAGOME_CRYPTO_BIP39_DICTIONARIES_HPP
8 
10 #include "outcome/outcome.hpp"
11 
12 #include <unordered_map>
13 
14 namespace kagome::crypto::bip39 {
15 
16  enum class DictionaryError {
17  ENTRY_NOT_FOUND = 1,
18  };
19 
24  class Dictionary {
25  public:
29  void initialize();
30 
36  outcome::result<EntropyToken> findValue(std::string_view word) const;
37 
38  private:
39  std::unordered_map<std::string_view, EntropyToken> entropy_map_;
40  };
41 } // namespace kagome::crypto::bip39
42 
44 
45 #endif // KAGOME_CRYPTO_BIP39_DICTIONARIES_HPP
OUTCOME_HPP_DECLARE_ERROR(kagome::crypto::bip39, DictionaryError)
std::unordered_map< std::string_view, EntropyToken > entropy_map_
Definition: dictionary.hpp:39