Skip to content

Commit 66eab40

Browse files
committed
fix(test): use new Persister type
Changes named arguments in Swift as well as constructing the new `Persist` type with the usual sqlite database
1 parent 59d0c70 commit 66eab40

23 files changed

+62
-62
lines changed

bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/LiveTxBuilderTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class LiveTxBuilderTest {
2727

2828
@Test
2929
fun testTxBuilder() {
30-
var conn: Connection = Connection.newInMemory()
30+
var conn: Persister = Persister.newInMemory()
3131
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
3232
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
3333
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
@@ -51,7 +51,7 @@ class LiveTxBuilderTest {
5151

5252
@Test
5353
fun complexTxBuilder() {
54-
var conn: Connection = Connection.newInMemory()
54+
var conn: Persister = Persister.newInMemory()
5555
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
5656
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
5757
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()

bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/LiveWalletTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LiveWalletTest {
2828

2929
@Test
3030
fun testSyncedBalance() {
31-
var conn: Connection = Connection.newInMemory()
31+
var conn: Persister = Persister.newInMemory()
3232
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
3333
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
3434
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
@@ -54,7 +54,7 @@ class LiveWalletTest {
5454

5555
@Test
5656
fun testBroadcastTransaction() {
57-
var conn: Connection = Connection.newInMemory()
57+
var conn: Persister = Persister.newInMemory()
5858
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
5959
val esploraClient = EsploraClient(SIGNET_ESPLORA_URL)
6060
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()

bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/OfflineWalletTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class OfflineWalletTest {
3636

3737
@Test
3838
fun testNewAddress() {
39-
val conn = Connection.newInMemory()
39+
val conn = Persister.newInMemory()
4040
val wallet: Wallet = Wallet(
4141
descriptor,
4242
changeDescriptor,
@@ -58,7 +58,7 @@ class OfflineWalletTest {
5858

5959
@Test
6060
fun testBalance() {
61-
var conn: Connection = Connection.newInMemory()
61+
var conn: Persister = Persister.newInMemory()
6262
val wallet: Wallet = Wallet(
6363
descriptor,
6464
changeDescriptor,

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveElectrumClientTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LiveElectrumClientTest {
1818

1919
@Test
2020
fun testSyncedBalance() {
21-
var conn: Connection = Connection.newInMemory()
21+
var conn: Persister = Persister.newInMemory()
2222
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
2323
val electrumClient: ElectrumClient = ElectrumClient(SIGNET_ELECTRUM_URL)
2424
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveKyotoTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LiveKyotoTest {
2828

2929
@Test
3030
fun testKyoto() {
31-
val conn: Connection = Connection.newInMemory()
31+
val conn: Persister = Persister.newInMemory()
3232
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
3333
val peers = listOf(peer)
3434
runBlocking {

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveMemoryWalletTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class LiveMemoryWalletTest {
2121
"wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/1h/0/*)",
2222
Network.SIGNET
2323
)
24-
var conn: Connection = Connection.newInMemory()
24+
var conn: Persister = Persister.newInMemory()
2525
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
2626
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
2727
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
@@ -45,7 +45,7 @@ class LiveMemoryWalletTest {
4545

4646
@Test
4747
fun testScriptInspector() {
48-
var conn: Connection = Connection.newInMemory()
48+
var conn: Persister = Persister.newInMemory()
4949
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
5050
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
5151

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveTransactionTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class LiveTransactionTest {
1717

1818
@Test
1919
fun testSyncedBalance() {
20-
var conn: Connection = Connection.newInMemory()
20+
var conn: Persister = Persister.newInMemory()
2121
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
2222
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
2323
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveTxBuilderTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class LiveTxBuilderTest {
3232

3333
@Test
3434
fun testTxBuilder() {
35-
val connection: Connection = Connection(persistenceFilePath)
35+
val connection: Persister = Persister(persistenceFilePath)
3636
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, connection)
3737
val esploraClient = EsploraClient(SIGNET_ESPLORA_URL)
3838
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
@@ -58,7 +58,7 @@ class LiveTxBuilderTest {
5858

5959
@Test
6060
fun complexTxBuilder() {
61-
val connection: Connection = Connection(persistenceFilePath)
61+
val connection: Persister = Persister(persistenceFilePath)
6262
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, connection)
6363
val esploraClient = EsploraClient(SIGNET_ESPLORA_URL)
6464
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveWalletTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class LiveWalletTest {
3232

3333
@Test
3434
fun testSyncedBalance() {
35-
val connection = Connection(persistenceFilePath)
35+
val connection = Persister.newSqlite(persistenceFilePath)
3636
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, connection)
3737
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
3838
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
@@ -57,7 +57,7 @@ class LiveWalletTest {
5757

5858
@Test
5959
fun testBroadcastTransaction() {
60-
val connection = Connection(persistenceFilePath)
60+
val connection = Persister.newSqlite(persistenceFilePath)
6161
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, connection)
6262
val esploraClient = EsploraClient(SIGNET_ESPLORA_URL)
6363
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()

bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/OfflinePersistenceTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class OfflinePersistenceTest {
2020

2121
@Test
2222
fun testPersistence() {
23-
val connection = Connection(persistenceFilePath)
23+
val connection = Persister.newSqlite(persistenceFilePath)
2424

2525
val wallet: Wallet = Wallet.load(
2626
descriptor,
@@ -42,7 +42,7 @@ class OfflinePersistenceTest {
4242

4343
@Test
4444
fun testPersistenceWithDescriptor() {
45-
val connection = Connection(persistenceFilePath)
45+
val connection = Persister.newSqlite(persistenceFilePath)
4646

4747
val descriptorPub = Descriptor(
4848
"wpkh([9122d9e0/84'/1'/0']tpubDCYVtmaSaDzTxcgvoP5AHZNbZKZzrvoNH9KARep88vESc6MxRqAp4LmePc2eeGX6XUxBcdhAmkthWTDqygPz2wLAyHWisD299Lkdrj5egY6/0/*)#zpaanzgu",

0 commit comments

Comments
 (0)