Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ class LiveTxBuilderTest {

@Test
fun testTxBuilder() {
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET)
var conn: Connection = Connection.newInMemory()
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
val fullScanRequest: FullScanRequest = wallet.startFullScan()
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
val update = esploraClient.fullScan(fullScanRequest, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.balance().total.toSat()}")
Expand All @@ -50,9 +51,10 @@ class LiveTxBuilderTest {

@Test
fun complexTxBuilder() {
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET)
var conn: Connection = Connection.newInMemory()
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
val fullScanRequest: FullScanRequest = wallet.startFullScan()
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
val update = esploraClient.fullScan(fullScanRequest, 10uL, 1uL)
wallet.applyUpdate(update)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ class LiveWalletTest {

@Test
fun testSyncedBalance() {
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET)
var conn: Connection = Connection.newInMemory()
val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
val esploraClient: EsploraClient = EsploraClient(SIGNET_ESPLORA_URL)
val fullScanRequest: FullScanRequest = wallet.startFullScan()
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
val update = esploraClient.fullScan(fullScanRequest, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.balance().total.toSat()}")
Expand All @@ -53,9 +54,10 @@ class LiveWalletTest {

@Test
fun testBroadcastTransaction() {
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET)
var conn: Connection = Connection.newInMemory()
val wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET, conn)
val esploraClient = EsploraClient(SIGNET_ESPLORA_URL)
val fullScanRequest: FullScanRequest = wallet.startFullScan()
val fullScanRequest: FullScanRequest = wallet.startFullScan().build()
val update = esploraClient.fullScan(fullScanRequest, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.balance().total.toSat()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ class OfflineWalletTest {

@Test
fun testNewAddress() {
val conn = Connection.newInMemory()
val wallet: Wallet = Wallet(
descriptor,
changeDescriptor,
Network.TESTNET
Network.TESTNET,
conn
)
val addressInfo: AddressInfo = wallet.revealNextAddress(KeychainKind.EXTERNAL)

Expand All @@ -56,10 +58,12 @@ class OfflineWalletTest {

@Test
fun testBalance() {
var conn: Connection = Connection.newInMemory()
val wallet: Wallet = Wallet(
descriptor,
changeDescriptor,
Network.TESTNET
Network.TESTNET,
conn
)

assertEquals(
Expand Down
157 changes: 53 additions & 104 deletions bdk-ffi/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions bdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ path = "uniffi-bindgen.rs"
default = ["uniffi/cli"]

[dependencies]
bdk_wallet = { version = "1.0.0-alpha.13", features = ["all-keys", "keys-bip39"] }
bdk_esplora = { version = "0.15.0", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
# NOTE: This is a temporary workaround to use the electrum-client with the use-rustls-ring feature. It points to a fork
# of bdk in which the bdk_electrum library uses the electrum-client with the use-rustls-ring feature.
bdk_electrum = { git = "https://github.com/thunderbiscuit/bdk/", package = "bdk_electrum", branch = "feature/electrum-client-ring-ffi-alpha13", default-features = false, features = ["use-rustls-ring"] }
# bdk_electrum = { version = "0.15.0" }
bdk_sqlite = { version = "0.2.0" }
bdk_bitcoind_rpc = { version = "0.12.0" }
bdk_wallet = { version = "1.0.0-beta.2", features = ["all-keys", "keys-bip39", "rusqlite"] }
bdk_core = { version = "0.1.0" }
bdk_esplora = { version = "0.17.0", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
bdk_electrum = { version = "0.17.0", default-features = false, features = ["use-rustls-ring"] }
bdk_bitcoind_rpc = { version = "0.14.0" }
bitcoin-internals = { version = "0.2.0", features = ["alloc"] }

uniffi = { version = "=0.28.0" }
Expand Down
Loading
Loading