-
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.
Add excluded in CI connected tests to JVM library
- Loading branch information
1 parent
13c751c
commit 3fd02c5
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -38,4 +38,4 @@ jobs: | |
- name: "Run JVM tests" | ||
run: | | ||
cd bdk-jvm | ||
./gradlew test | ||
./gradlew test -P excludeConnectedTests |
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
25 changes: 25 additions & 0 deletions
25
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/ConnectedTxBuilderTest.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,25 @@ | ||
package org.bitcoindevkit | ||
|
||
import org.junit.Test | ||
|
||
class ConnectedTxBuilderTest { | ||
@Test | ||
fun testTxBuilder() { | ||
val descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", Network.TESTNET) | ||
val wallet = Wallet.newNoPersist(descriptor, null, Network.TESTNET) | ||
val esploraClient = EsploraClient("https://mempool.space/testnet/api") | ||
val update = esploraClient.scan(wallet, 10uL, 1uL) | ||
wallet.applyUpdate(update) | ||
println("Balance: ${wallet.getBalance().total()}") | ||
|
||
assert(wallet.getBalance().total() > 0uL) | ||
|
||
val recipient: Address = Address("tb1qrnfslnrve9uncz9pzpvf83k3ukz22ljgees989", Network.TESTNET) | ||
val psbt: PartiallySignedTransaction = TxBuilder() | ||
.addRecipient(recipient.scriptPubkey(), 4200uL) | ||
.feeRate(2.0f) | ||
.finish(wallet) | ||
|
||
println(psbt.serialize()) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/ConnectedWalletTest.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,16 @@ | ||
package org.bitcoindevkit | ||
|
||
import org.junit.Test | ||
|
||
class ConnectedWalletTest { | ||
@Test | ||
fun testSyncedBalance() { | ||
val descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", Network.TESTNET) | ||
val wallet = Wallet.newNoPersist(descriptor, null, Network.TESTNET) | ||
val esploraClient = EsploraClient("https://mempool.space/testnet/api") | ||
// val esploraClient = EsploraClient("https://blockstream.info/testnet/api") | ||
val update = esploraClient.scan(wallet, 10uL, 1uL) | ||
wallet.applyUpdate(update) | ||
println("Balance: ${wallet.getBalance().total()}") | ||
} | ||
} |