Skip to content

Commit

Permalink
debug test
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed Aug 17, 2024
1 parent 38a7d58 commit 7f177d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions android_test/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ dependencies {
implementation("androidx.compose.material3:material3")
implementation(files("libs/stellar-sdk-android-spi-1.0.0-alpha0.jar"))
implementation("network.lightsail:stellar-sdk:1.0.0-alpha0")
implementation("network.lightsail:mnemonic4j:0.1.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import network.lightsail.Mnemonic
import org.stellar.javastellarsdkdemoapp.ui.theme.JavaStellarSDKDemoAppTheme
import org.stellar.sdk.Account
import org.stellar.sdk.Address
Expand Down Expand Up @@ -160,6 +161,15 @@ private fun testSDK(): String {
val source: KeyPair =
KeyPair.fromSecretSeed("SCH27VUZZ6UAKB67BDNF6FA42YMBMQCBKXWGMFD5TZ6S5ZZCZFLRXKHS")

// test mnemonic4j
val mnemonic = Mnemonic()
val words = mnemonic.generate(256)
val seed = Mnemonic.toSeed(words)
val kp = KeyPair.fromBip39Seed(seed, 0)
if (kp.secretSeed == null) {
throw Exception("test mnemonic4j failed")
}

val ledgerKey = LedgerKey.builder()
.discriminant(LedgerEntryType.ACCOUNT)
.account(
Expand Down

0 comments on commit 7f177d1

Please sign in to comment.