From 8049f99ebccc9487b989eb670d88a4e57b9241eb Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 17 Aug 2024 21:13:08 +0000 Subject: [PATCH] Remove the `std` feature implications from the `lightning` crate Now that we don't have to have everything in our entire ecosystem use the same `std`/`no-std` feature combinations we should start by untangling our own features a bit. This takes one last step, removing the implications of the `std` feature from the `lightning` crate. --- lightning/Cargo.toml | 2 +- lightning/src/ln/bolt11_payment.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lightning/Cargo.toml b/lightning/Cargo.toml index b8ebfdca2..d68b8c643 100644 --- a/lightning/Cargo.toml +++ b/lightning/Cargo.toml @@ -30,7 +30,7 @@ max_level_trace = [] unsafe_revoked_tx_signing = [] no-std = ["hashbrown", "possiblyrandom", "libm"] -std = ["lightning-invoice/std", "bech32/std"] +std = [] # Generates low-r bitcoin signatures, which saves 1 byte in 50% of the cases grind_signatures = [] diff --git a/lightning/src/ln/bolt11_payment.rs b/lightning/src/ln/bolt11_payment.rs index 596ee49ac..b4863d4b1 100644 --- a/lightning/src/ln/bolt11_payment.rs +++ b/lightning/src/ln/bolt11_payment.rs @@ -188,11 +188,12 @@ mod tests { let secp_ctx = Secp256k1::new(); let node_secret = nodes[1].keys_manager.backing.get_node_secret_key(); + let time = std::time::SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap(); let invoice = InvoiceBuilder::new(Currency::Bitcoin) .description("test".into()) .payment_hash(Sha256::from_slice(&payment_hash.0).unwrap()) .payment_secret(payment_secret) - .current_timestamp() + .duration_since_epoch(time) .min_final_cltv_expiry_delta(144) .amount_milli_satoshis(50_000) .payment_metadata(payment_metadata.clone()) -- 2.39.5