Skip to content

Commit 1f3b9c3

Browse files
committed
Modify: return language value & from_entropy funcs
1 parent cc64f8e commit 1f3b9c3

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

hdwallet/mnemonics/algorand/mnemonic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def from_words(cls, words: int, language: str) -> str:
108108
)
109109

110110
@classmethod
111-
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str) -> str:
111+
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str, **kwargs) -> str:
112112
"""
113113
Generates a mnemonic phrase from entropy data.
114114

hdwallet/mnemonics/bip39/mnemonic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def from_words(cls, words: int, language: str) -> str:
183183
)
184184

185185
@classmethod
186-
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str) -> str:
186+
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str, **kwargs) -> str:
187187
"""
188188
Generates from entropy data.
189189

hdwallet/mnemonics/electrum/v1/mnemonic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def from_words(cls, words: int, language: str) -> str:
112112
)
113113

114114
@classmethod
115-
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str) -> str:
115+
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str, **kwargs) -> str:
116116
"""
117117
Generates a mnemonic phrase from entropy data.
118118

hdwallet/mnemonics/imnemonic.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,24 @@ def mnemonic(self) -> str:
6262

6363
return " ".join(self._mnemonic)
6464

65+
def mnemonic_type(self) -> str:
66+
"""
67+
Retrieves the type of the mnemonic.
68+
69+
:return: The type of the mnemonic.
70+
:rtype: str
71+
"""
72+
73+
raise NotImplemented
74+
6575
def language(self) -> str:
6676
"""
6777
Get the formatted language value.
6878
6979
:return: The formatted language string where each part is capitalized.
7080
:rtype: str
7181
"""
72-
language: str = ""
73-
for index, _ in enumerate(self._language.split("-")):
74-
language += _.title() if index == 0 else f"-{_.title()}"
75-
return language
82+
return self._language
7683

7784
def words(self) -> int:
7885
"""
@@ -89,7 +96,7 @@ def from_words(cls, words: int, language: str) -> str:
8996

9097
@classmethod
9198
@abstractmethod
92-
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str) -> str:
99+
def from_entropy(cls, entropy: Union[str, bytes, IEntropy], language: str, **kwargs) -> str:
93100
pass
94101

95102
@classmethod

0 commit comments

Comments
 (0)