From f399b799e4138a1b47b2a9d55dc3dc509e5e7f46 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Tue, 3 Jan 2023 09:47:23 -0600 Subject: [PATCH] Add validate_domain option to ElectrumConfig --- Cargo.lock | 5 +++-- api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt | 4 +++- bdk-ffi/Cargo.toml | 3 +-- bdk-ffi/src/bdk.udl | 1 + bdk-ffi/src/lib.rs | 3 +++ bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c8ffbe..434c155 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,8 +130,9 @@ dependencies = [ [[package]] name = "bdk" -version = "0.26.0-rc.2" -source = "git+https://github.com/bitcoindevkit/bdk?tag=v0.26.0-rc.2#7e8e9921a961367ae85d7df29e1cc5eb36fdd210" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b238a07736baee43ba9663933e44b1c6c27b43ef871b9486e175902335d83880" dependencies = [ "ahash", "async-trait", diff --git a/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt b/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt index 837ebe4..c22341f 100644 --- a/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt +++ b/api-docs/kotlin/src/main/kotlin/org/bitcoindevkit/bdk.kt @@ -120,6 +120,7 @@ data class SledDbConfiguration( * @property retry Request retry count. * @property timeout Request timeout (seconds). * @property stopGap Stop searching addresses for transactions after finding an unused gap of this length. + * @property validateDomain Validate the domain when using SSL. * * @sample org.bitcoindevkit.electrumBlockchainConfigSample */ @@ -128,7 +129,8 @@ data class ElectrumConfig( var socks5: String?, var retry: UByte, var timeout: UByte?, - var stopGap: ULong + var stopGap: ULong, + var validateDomain: Boolean ) /** diff --git a/bdk-ffi/Cargo.toml b/bdk-ffi/Cargo.toml index 5f25eb0..85860c6 100644 --- a/bdk-ffi/Cargo.toml +++ b/bdk-ffi/Cargo.toml @@ -10,8 +10,7 @@ crate-type = ["staticlib", "cdylib"] name = "bdkffi" [dependencies] -#bdk = { version = "0.26", features = ["all-keys", "use-esplora-ureq", "sqlite-bundled", "rpc"] } -bdk = { git = "https://github.com/bitcoindevkit/bdk", tag = "v0.26.0-rc.2", features = ["all-keys", "use-esplora-ureq", "sqlite-bundled", "rpc"] } +bdk = { version = "0.26", features = ["all-keys", "use-esplora-ureq", "sqlite-bundled", "rpc"] } uniffi_macros = { version = "0.21.0", features = ["builtin-bindgen"] } uniffi = { version = "0.21.0", features = ["builtin-bindgen"] } diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index 5b14025..7ca27f1 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -117,6 +117,7 @@ dictionary ElectrumConfig { u8 retry; u8? timeout; u64 stop_gap; + boolean validate_domain; }; dictionary EsploraConfig { diff --git a/bdk-ffi/src/lib.rs b/bdk-ffi/src/lib.rs index ddaeb51..2f75853 100644 --- a/bdk-ffi/src/lib.rs +++ b/bdk-ffi/src/lib.rs @@ -118,6 +118,8 @@ pub struct ElectrumConfig { pub timeout: Option, /// Stop searching addresses for transactions after finding an unused gap of this length pub stop_gap: u64, + /// Validate the domain when using SSL + pub validate_domain: bool, } /// Configuration for an EsploraBlockchain @@ -268,6 +270,7 @@ impl Blockchain { timeout: config.timeout, url: config.url, stop_gap: usize::try_from(config.stop_gap).unwrap(), + validate_domain: config.validate_domain, }) } BlockchainConfig::Esplora { config } => { diff --git a/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt b/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt index 81eec3a..d8d3464 100644 --- a/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt +++ b/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/JvmLibTest.kt @@ -38,7 +38,8 @@ class JvmLibTest { null, 5u, null, - 100u + 100u, + true, ) )