Skip to content

Commit ccd418f

Browse files
committed
Gate set_test_offer and add HRN test config
1 parent 557145c commit ccd418f

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.github/workflows/kotlin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
./gradlew ktlintCheck
4242
4343
- name: Generate Kotlin JVM
44-
run: ./scripts/uniffi_bindgen_generate_kotlin.sh
44+
run: RUSTFLAGS="--cfg hrn_tests" ./scripts/uniffi_bindgen_generate_kotlin.sh
4545

4646
- name: Generate Kotlin Android
4747
run: ./scripts/uniffi_bindgen_generate_kotlin_android.sh

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: astral-sh/setup-uv@v7
2222

2323
- name: Generate Python bindings
24-
run: ./scripts/uniffi_bindgen_generate_python.sh
24+
run: RUSTFLAGS="--cfg hrn_tests" ./scripts/uniffi_bindgen_generate_python.sh
2525

2626
- name: Start bitcoind and electrs
2727
run: docker compose up -d

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
- name: Test on Rust ${{ matrix.toolchain }}
8585
if: "matrix.platform != 'windows-latest'"
8686
run: |
87-
RUSTFLAGS="--cfg no_download --cfg cycle_tests" cargo test
87+
RUSTFLAGS="--cfg no_download --cfg cycle_tests --cfg hrn_tests" cargo test
8888
- name: Test with UniFFI support on Rust ${{ matrix.toolchain }}
8989
if: "matrix.platform != 'windows-latest' && matrix.build-uniffi"
9090
run: |

.github/workflows/swift.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
run: rustup default stable
1919

2020
- name: Generate Swift bindings
21-
run: ./scripts/uniffi_bindgen_generate_swift.sh
21+
run: RUSTFLAGS="--cfg hrn_tests" ./scripts/uniffi_bindgen_generate_swift.sh

src/payment/unified.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,9 @@ impl UnifiedPayment {
339339
/// as we cannot rely on the offer being present in the parsed URI.
340340
#[cfg(hrn_tests)]
341341
pub fn set_test_offer(&self, _offer: Offer) {
342-
let mut guard = self.test_offer.lock().unwrap();
343-
*guard = Some(_offer);
342+
let _ = self.test_offer.lock().map(|mut guard| *guard = Some(_offer)).map_err(|e| {
343+
log_error!(self.logger, "Failed to set test offer due to poisoned lock: {:?}", e)
344+
});
344345
}
345346
}
346347

0 commit comments

Comments
 (0)