Skip to content

Commit

Permalink
fix: rename esplora scan to full_scan
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Jan 11, 2024
1 parent 54beb23 commit 7319aea
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LiveTxBuilderTest {
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)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")

Expand All @@ -34,7 +34,7 @@ class LiveTxBuilderTest {
val changeDescriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/1/*)", Network.TESTNET)
val wallet = Wallet.newNoPersist(externalDescriptor, changeDescriptor, Network.TESTNET)
val esploraClient = EsploraClient("https://mempool.space/testnet/api")
val update = esploraClient.scan(wallet, 10uL, 1uL)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LiveWalletTest {
val descriptor: Descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", Network.TESTNET)
val wallet: Wallet = Wallet.newNoPersist(descriptor, null, Network.TESTNET)
val esploraClient: EsploraClient = EsploraClient("https://mempool.space/testnet/api")
val update = esploraClient.scan(wallet, 10uL, 1uL)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")
val balance: Balance = wallet.getBalance()
Expand All @@ -35,7 +35,7 @@ class LiveWalletTest {
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)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)

wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")
Expand Down
2 changes: 1 addition & 1 deletion bdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ default = ["uniffi/cli"]

[dependencies]
bdk = { version = "1.0.0-alpha.3", features = ["all-keys", "keys-bip39"] }
bdk_esplora = { version = "0.5.0", default-features = false, features = ["std", "blocking"] }

# TODO 22: The bdk_esplora crate uses esplora_client which uses reqwest for async. By default it uses the system
# openssl library, which is creating problems for cross-compilation. I'd rather use rustls, but it's hidden
Expand All @@ -28,7 +29,6 @@ bdk = { version = "1.0.0-alpha.3", features = ["all-keys", "keys-bip39"] }
# bdk = { git = "https://github.com/thunderbiscuit/bdk.git", branch = "test-rust-tls", version = "1.0.0-alpha.2", features = ["all-keys", "keys-bip39"] }
# bdk_esplora = { git = "https://github.com/thunderbiscuit/bdk.git", branch = "test-rust-tls", version = "0.4.0", package = "bdk_esplora", default-features = false, features = ["std", "blocking", "async-https-rustls"] }

bdk_esplora = { version = "0.5.0", default-features = false, features = ["std", "blocking"] }
uniffi = { version = "=0.25.1" }

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ interface EsploraClient {
constructor(string url);

[Throws=Alpha3Error]
Update scan(Wallet wallet, u64 stop_gap, u64 parallel_requests);
Update full_scan(Wallet wallet, u64 stop_gap, u64 parallel_requests);

[Throws=Alpha3Error]
void broadcast([ByRef] Transaction transaction);
Expand Down
2 changes: 1 addition & 1 deletion bdk-ffi/src/esplora.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl EsploraClient {

// This is a temporary solution for scanning. The long-term solution involves not passing
// the wallet to the client at all.
pub fn scan(
pub fn full_scan(
&self,
wallet: Arc<Wallet>,
stop_gap: u64,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class LiveTxBuilderTest {
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)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")

Expand All @@ -32,7 +32,7 @@ class LiveTxBuilderTest {
val changeDescriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/1/*)", Network.TESTNET)
val wallet = Wallet.newNoPersist(externalDescriptor, changeDescriptor, Network.TESTNET)
val esploraClient = EsploraClient("https://mempool.space/testnet/api")
val update = esploraClient.scan(wallet, 10uL, 1uL)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class LiveWalletTest {
val wallet: Wallet = Wallet.newNoPersist(descriptor, null, Network.TESTNET)
val esploraClient: EsploraClient = EsploraClient("https://mempool.space/testnet/api")
// val esploraClient = EsploraClient("https://blockstream.info/testnet/api")
val update = esploraClient.scan(wallet, 10uL, 1uL)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)
wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")

Expand All @@ -31,7 +31,7 @@ class LiveWalletTest {
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)
val update = esploraClient.fullScan(wallet, 10uL, 1uL)

wallet.applyUpdate(update)
println("Balance: ${wallet.getBalance().total}")
Expand Down
4 changes: 2 additions & 2 deletions bdk-python/tests/test_live_tx_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_tx_builder(self):
bdk.Network.TESTNET
)
esploraClient: bdk.EsploraClient = bdk.EsploraClient(url = "https://mempool.space/testnet/api")
update = esploraClient.scan(
update = esploraClient.full_scan(
wallet = wallet,
stop_gap = 10,
parallel_requests = 1
Expand Down Expand Up @@ -48,7 +48,7 @@ def complex_tx_builder(self):
bdk.Network.TESTNET
)
esploraClient: bdk.EsploraClient = bdk.EsploraClient(url = "https://mempool.space/testnet/api")
update = esploraClient.scan(
update = esploraClient.full_scan(
wallet = wallet,
stop_gap = 10,
parallel_requests = 1
Expand Down
4 changes: 2 additions & 2 deletions bdk-python/tests/test_live_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def test_synced_balance(self):
bdk.Network.TESTNET
)
esploraClient: bdk.EsploraClient = bdk.EsploraClient(url = "https://mempool.space/testnet/api")
update = esploraClient.scan(
update = esploraClient.full_scan(
wallet = wallet,
stop_gap = 10,
parallel_requests = 1
Expand Down Expand Up @@ -43,7 +43,7 @@ def test_broadcast_transaction(self):
bdk.Network.TESTNET
)
esploraClient: bdk.EsploraClient = bdk.EsploraClient(url = "https://mempool.space/testnet/api")
update = esploraClient.scan(
update = esploraClient.full_scan(
wallet = wallet,
stop_gap = 10,
parallel_requests = 1
Expand Down
4 changes: 2 additions & 2 deletions bdk-swift/Tests/BitcoinDevKitTests/LiveTxBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class LiveTxBuilderTests: XCTestCase {
network: .testnet
)
let esploraClient = EsploraClient(url: "https://mempool.space/testnet/api")
let update = try esploraClient.scan(
let update = try esploraClient.fullScan(
wallet: wallet,
stopGap: 10,
parallelRequests: 1
Expand Down Expand Up @@ -47,7 +47,7 @@ final class LiveTxBuilderTests: XCTestCase {
network: .testnet
)
let esploraClient = EsploraClient(url: "https://mempool.space/testnet/api")
let update = try esploraClient.scan(
let update = try esploraClient.fullScan(
wallet: wallet,
stopGap: 10,
parallelRequests: 1
Expand Down
4 changes: 2 additions & 2 deletions bdk-swift/Tests/BitcoinDevKitTests/LiveWalletTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class LiveWalletTests: XCTestCase {
network: .testnet
)
let esploraClient = EsploraClient(url: "https://mempool.space/testnet/api")
let update = try esploraClient.scan(
let update = try esploraClient.fullScan(
wallet: wallet,
stopGap: 10,
parallelRequests: 1
Expand Down Expand Up @@ -43,7 +43,7 @@ final class LiveWalletTests: XCTestCase {
network: .testnet
)
let esploraClient = EsploraClient(url: "https://mempool.space/testnet/api")
let update = try esploraClient.scan(
let update = try esploraClient.fullScan(
wallet: wallet,
stopGap: 10,
parallelRequests: 1
Expand Down

0 comments on commit 7319aea

Please sign in to comment.