Skip to content

Commit c6903f6

Browse files
authored
Merge pull request #752 from tnull/2026-01-fix-nodentropy-uniffi-tests
Drop entropy creation helper, cleanup remaining warnings
2 parents d1bbf97 + 625cd5d commit c6903f6

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

tests/common/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,18 +1288,6 @@ pub(crate) async fn do_channel_full_cycle<E: ElectrumApi>(
12881288
println!("\nB stopped");
12891289
}
12901290

1291-
// Helper to unify entropy creation
1292-
pub(crate) fn create_test_entropy(seed: [u8; 64]) -> NodeEntropy {
1293-
#[cfg(feature = "uniffi")]
1294-
{
1295-
NodeEntropy::from_seed_bytes(seed.to_vec()).unwrap()
1296-
}
1297-
#[cfg(not(feature = "uniffi"))]
1298-
{
1299-
NodeEntropy::from_seed_bytes(seed)
1300-
}
1301-
}
1302-
13031291
// A `KVStore` impl for testing purposes that wraps all our `KVStore`s and asserts their synchronicity.
13041292
#[derive(Clone)]
13051293
pub(crate) struct TestSyncStore {

tests/integration_tests_rust.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use bitcoin::hashes::Hash;
1717
use bitcoin::{Address, Amount, ScriptBuf};
1818
use common::logging::{init_log_logger, validate_log_entry, MultiNodeLogger, TestLogWriter};
1919
use common::{
20-
bump_fee_and_broadcast, create_test_entropy, distribute_funds_unconfirmed,
21-
do_channel_full_cycle, expect_channel_pending_event, expect_channel_ready_event, expect_event,
20+
bump_fee_and_broadcast, distribute_funds_unconfirmed, do_channel_full_cycle,
21+
expect_channel_pending_event, expect_channel_ready_event, expect_event,
2222
expect_payment_claimable_event, expect_payment_received_event, expect_payment_successful_event,
2323
expect_splice_pending_event, generate_blocks_and_wait, open_channel, open_channel_push_amt,
2424
premine_and_distribute_funds, premine_blocks, prepare_rbf, random_config,
@@ -27,6 +27,7 @@ use common::{
2727
TestSyncStore,
2828
};
2929
use ldk_node::config::{AsyncPaymentsRole, EsploraSyncConfig};
30+
use ldk_node::entropy::NodeEntropy;
3031
use ldk_node::liquidity::LSPS2ServiceConfig;
3132
use ldk_node::payment::{
3233
ConfirmationStatus, PaymentDetails, PaymentDirection, PaymentKind, PaymentStatus,
@@ -2445,8 +2446,6 @@ async fn persistence_backwards_compatibility() {
24452446
let storage_path = common::random_storage_path().to_str().unwrap().to_owned();
24462447
let seed_bytes = [42u8; 64];
24472448

2448-
let node_entropy = create_test_entropy(seed_bytes);
2449-
24502449
// Setup a v0.6.2 `Node`
24512450
let (old_balance, old_node_id) = {
24522451
let mut builder_old = ldk_node_062::Builder::new();
@@ -2477,11 +2476,18 @@ async fn persistence_backwards_compatibility() {
24772476
};
24782477

24792478
// Now ensure we can still reinit from the same backend.
2479+
#[cfg(feature = "uniffi")]
2480+
let builder_new = Builder::new();
2481+
#[cfg(not(feature = "uniffi"))]
24802482
let mut builder_new = Builder::new();
24812483
builder_new.set_network(bitcoin::Network::Regtest);
24822484
builder_new.set_storage_dir_path(storage_path);
24832485
builder_new.set_chain_source_esplora(esplora_url, None);
24842486

2487+
#[cfg(feature = "uniffi")]
2488+
let node_entropy = NodeEntropy::from_seed_bytes(seed_bytes.to_vec()).unwrap();
2489+
#[cfg(not(feature = "uniffi"))]
2490+
let node_entropy = NodeEntropy::from_seed_bytes(seed_bytes);
24852491
let node_new = builder_new.build(node_entropy.into()).unwrap();
24862492

24872493
node_new.start().unwrap();

0 commit comments

Comments
 (0)