Skip to content

Commit

Permalink
deps: bump bdk to beta-2
Browse files Browse the repository at this point in the history
- temp 2 @thunder
- impl wallet no persist @rob
- enable default constructor on wallet type @thunder
- test: fix jvm tests @thunder
- add tx methods @thunder
- new errors @thunder
- feat: expose correct errors @thunder
- remove macros for in-memory connection @rob
- tests(python): add in-memory connection @rob
- tests(swift, kotlin): add tests with swift failures @rob
- lib: bump to bdk-wallet 1.0.0-beta2 @rob
- various fixes @rob

test: fix swift tests
  • Loading branch information
rustaceanrob committed Aug 28, 2024
1 parent f2a29c5 commit fe50d23
Show file tree
Hide file tree
Showing 34 changed files with 521 additions and 789 deletions.
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

0 comments on commit fe50d23

Please sign in to comment.