Skip to content

Commit c4b6901

Browse files
committed
fixup! Add end-to-end test for HRN resolution
1 parent af8ece3 commit c4b6901

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.github/workflows/kotlin.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,28 @@ jobs:
4141
./gradlew ktlintCheck
4242
4343
- name: Generate Kotlin JVM
44+
env:
45+
RUSTFLAGS: "--cfg hrn_tests"
4446
run: ./scripts/uniffi_bindgen_generate_kotlin.sh
4547

4648
- name: Generate Kotlin Android
49+
env:
50+
RUSTFLAGS: "--cfg hrn_tests"
4751
run: ./scripts/uniffi_bindgen_generate_kotlin_android.sh
4852

4953
- name: Start bitcoind and electrs
5054
run: docker compose up -d
5155

5256
- name: Run ldk-node-jvm tests
57+
env:
58+
RUSTFLAGS: "--cfg hrn_tests"
5359
run: |
5460
cd $LDK_NODE_JVM_DIR
5561
./gradlew test -Penv=ci
5662
5763
- name: Run ldk-node-android tests
64+
env:
65+
RUSTFLAGS: "--cfg hrn_tests"
5866
run: |
5967
cd $LDK_NODE_ANDROID_DIR
6068
./gradlew test

.github/workflows/python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828

2929
- name: Run Python unit tests
3030
env:
31+
RUSTFLAGS: "--cfg hrn_tests"
3132
BITCOIN_CLI_BIN: "docker exec ldk-node-bitcoin-1 bitcoin-cli"
3233
BITCOIND_RPC_USER: "user"
3334
BITCOIND_RPC_PASSWORD: "pass"

src/payment/unified.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ impl UnifiedPayment {
337337
/// Sets a test offer to be used in the `send` method when the `hrn_tests` config flag is enabled.
338338
/// This is necessary to test sending Bolt12 payments via the unified payment handler in HRN tests,
339339
/// as we cannot rely on the offer being present in the parsed URI.
340+
#[uniffi::export]
340341
#[cfg(hrn_tests)]
341342
pub fn set_test_offer(&self, offer: Offer) {
342343
let mut guard = self.test_offer.lock().unwrap();

tests/integration_tests_hrn.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async fn unified_send_to_hrn() {
3939

4040
node_a.sync_wallets().unwrap();
4141
open_channel(&node_a, &node_b, 4_000_000, true, &electrsd).await;
42+
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
4243
generate_blocks_and_wait(&bitcoind.client, &electrsd.client, 6).await;
4344

4445
node_a.sync_wallets().unwrap();

0 commit comments

Comments
 (0)