Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
rust_tests:
name: Rust Checks
runs-on: ubuntu-latest
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
run: cargo check -p orange-cli

- name: Run tests
run: cargo test --features _test-utils
run: cargo test --features _test-utils -- --test-threads=2

- name: Run cashu tests
run: cargo test --features _cashu-tests
run: cargo test --features _cashu-tests -- --test-threads=2
15 changes: 11 additions & 4 deletions orange-sdk/src/trusted_wallet/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl DummyTrustedWallet {
cookie.password,
);

let tmp = temp_dir().join(format!("orange-test-{uuid}-dummy-ldk"));
let tmp = temp_dir().join(format!("orange-test-{uuid}/dummy-ldk"));
builder.set_storage_dir_path(tmp.to_str().unwrap().to_string());

let port = get_available_port().unwrap();
Expand Down Expand Up @@ -199,7 +199,8 @@ impl DummyTrustedWallet {
});

// wait for ldk to be ready
for _ in 0..10 {
let iterations = if std::env::var("CI").is_ok() { 120 } else { 10 };
for _ in 0..iterations {
if ldk_node.status().is_listening {
break;
}
Expand All @@ -210,13 +211,19 @@ impl DummyTrustedWallet {
lsp.open_channel(ldk_node.node_id(), socket_addr, 1_000_000, Some(500_000_000), None)
.unwrap();
// wait for channel to be broadcast
tokio::time::sleep(Duration::from_secs(1)).await;
for _ in 0..iterations {
let num_txs = bitcoind.client.get_mempool_info().unwrap().size;
if num_txs > 0 {
break;
}
tokio::time::sleep(Duration::from_millis(250)).await;
}
// confirm channel
let addr = bitcoind.client.new_address().unwrap();
bitcoind.client.generate_to_address(6, &addr).unwrap();

// wait for sync/channel ready
for _ in 0..10 {
for _ in 0..iterations {
if ldk_node.list_channels().first().is_some_and(|c| c.is_usable) {
break;
}
Expand Down
Loading
Loading