]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Remove the `std` feature implications from the `lightning` crate 2024-08-feature-cleanup-1
authorMatt Corallo <git@bluematt.me>
Sat, 17 Aug 2024 21:13:08 +0000 (21:13 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 19 Aug 2024 15:09:40 +0000 (15:09 +0000)
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
lightning/src/ln/bolt11_payment.rs

index b8ebfdca210672fd91ffc958f1b2acf205c567e4..d68b8c6433de18c941c7a8092f6d8d2cdeb9541d 100644 (file)
@@ -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 = []
index 596ee49aca14824d912faa5f0266e58f8cb1307a..b4863d4b1e13bde844c1c33a5a229faeab9875e9 100644 (file)
@@ -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())