-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30a548c
commit be982c7
Showing
2 changed files
with
33 additions
and
97 deletions.
There are no files selected for viewing
97 changes: 0 additions & 97 deletions
97
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/WalletTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package org.bitcoindevkit | ||
|
||
import org.junit.Assert.* | ||
import org.junit.Test | ||
import org.slf4j.Logger | ||
import org.slf4j.LoggerFactory | ||
import java.io.File | ||
import java.nio.file.Files | ||
|
||
class WalletTest { | ||
@Test | ||
fun testNetwork() { | ||
val signetNetwork = Network.SIGNET | ||
} | ||
|
||
@Test | ||
fun testDescriptorBip86() { | ||
val mnemonic = Mnemonic(WordCount.WORDS12) | ||
val descriptorSecretKey = DescriptorSecretKey(Network.TESTNET, mnemonic, null) | ||
val descriptor = Descriptor.newBip86(descriptorSecretKey, KeychainKind.EXTERNAL, Network.TESTNET) | ||
} | ||
|
||
@Test | ||
fun testUsedWallet() { | ||
val descriptor1 = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", Network.TESTNET) | ||
// val mnemonic = Mnemonic(WordCount.WORDS12) | ||
// val descriptorSecretKey = DescriptorSecretKey(Network.TESTNET, mnemonic, null) | ||
// val descriptor = Descriptor.newBip86(descriptorSecretKey, KeychainKind.EXTERNAL, Network.TESTNET) | ||
val wallet = Wallet(descriptor1, null, Network.TESTNET, WalletType.MEMORY) | ||
val (index, address, keychain) = wallet.getAddress(AddressIndex.LastUnused) | ||
println("Address ${address.asString()} at index $index") | ||
} | ||
} |