Skip to content

Commit

Permalink
fix mnemonic words
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypfau committed Feb 2, 2023
1 parent 1dbf1a3 commit 8909795
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

```kotlin
dependencies {
implementation("org.ton:ton-kotlin:0.2.9")
implementation("org.ton:ton-kotlin:0.2.10")
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ val isCI = System.getenv("CI") == "true"

allprojects {
group = "org.ton"
version = "0.2.9"
version = "0.2.10"

apply(plugin = "kotlin-multiplatform")
apply(plugin = "kotlinx-serialization")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ public interface Mnemonic {

public const val DEFAULT_WORD_COUNT: Int = 24

public fun mnemonicWords(): List<String> = MNEMONIC_WORD_LIST.toList()
public fun mnemonicWords(): Array<String> = MNEMONIC_WORD_LIST

@JvmStatic
public suspend fun generate(
password: String = "",
wordCount: Int = DEFAULT_WORD_COUNT,
wordlist: Array<String> = MNEMONIC_WORD_LIST,
wordlist: Array<String> = mnemonicWords(),
random: Random = SecureRandom
): Array<String> {
while (true) {
Expand Down Expand Up @@ -66,7 +66,7 @@ public interface Mnemonic {
public suspend fun isValid(
mnemonic: Array<String>,
password: String = "",
wordlist: Array<String> = MNEMONIC_WORD_LIST
wordlist: Array<String> = mnemonicWords()
): Boolean {
if (!mnemonic.all { wordlist.contains(it) }) {
return false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.ton.mnemonic

internal val MNEMONIC_WORD_LIST = arrayOf(
internal val MNEMONIC_WORD_LIST get() = arrayOf(
"abandon",
"ability",
"able",
Expand Down

0 comments on commit 8909795

Please sign in to comment.