Skip to content

Commit

Permalink
fix sep-005 for malay language
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Aug 24, 2022
1 parent 7aec339 commit 61f4861
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions documentation/sdk_examples/sep-0005-key-derivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Supported languages are:
- japanese
- simplified chinese
- traditional chinese
- malay

### Generate key pairs from mnemonic

Expand Down
2 changes: 2 additions & 0 deletions lib/src/sep/0005/wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ class Wallet {
return WordList.koreanWords();
case LANGUAGE_SPANISH:
return WordList.spanishWords();
case LANGUAGE_MALAY:
return WordList.malayWords();
default:
return WordList.englishWords();
}
Expand Down
10 changes: 10 additions & 0 deletions test/sep0005_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ void main() {
print(mnemonic12WordsSpanish);
assert(mnemonic12WordsSpanish.split(" ").length == 12);

String mnemonic12WordsMalay =
await Wallet.generate12WordsMnemonic(language: LANGUAGE_MALAY);
print(mnemonic12WordsMalay);
assert(mnemonic12WordsMalay.split(" ").length == 12);

String mnemonic12WordsEnglish =
await Wallet.generate12WordsMnemonic(language: LANGUAGE_ENGLISH);
print(mnemonic12WordsEnglish);
Expand Down Expand Up @@ -92,6 +97,11 @@ void main() {
print(mnemonic24WordsSpanish);
assert(mnemonic24WordsSpanish.split(" ").length == 24);

String mnemonic24WordsMalay =
await Wallet.generate24WordsMnemonic(language: LANGUAGE_MALAY);
print(mnemonic24WordsMalay);
assert(mnemonic24WordsMalay.split(" ").length == 24);

String mnemonic24WordsEnglish =
await Wallet.generate24WordsMnemonic(language: LANGUAGE_ENGLISH);
print(mnemonic24WordsEnglish);
Expand Down

0 comments on commit 61f4861

Please sign in to comment.