Skip to content

Commit

Permalink
deps: bump bdk to beta-2
Browse files Browse the repository at this point in the history
temp 2

impl wallet no persist

enable default constructor on wallet type

test: fix jvm tests

add tx methods

new errors

feat: expose correct errors

remove macros for in-memory connection

tests(python): add in-memory connection

tests(swift, kotlin): add tests with swift failures

lib: bump to bdk-wallet 1.0.0-beta2

various fixes
  • Loading branch information
rustaceanrob committed Aug 27, 2024
1 parent 3454331 commit 8b2af25
Show file tree
Hide file tree
Showing 33 changed files with 522 additions and 770 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 8b2af25

Please sign in to comment.