Invoice building tests
[rust-lightning] / lightning / src / offers / refund.rs
index 48be9774aec2f7bc5e220db29935654119c3e9b0..bee6cc7f5f61ddd39a89744bf33f9d6bc8ea66f5 100644 (file)
@@ -321,14 +321,14 @@ impl Refund {
        pub fn respond_with(
                &self, payment_paths: Vec<(BlindedPath, BlindedPayInfo)>, payment_hash: PaymentHash,
                signing_pubkey: PublicKey,
-               #[cfg(not(feature = "std"))]
+               #[cfg(any(test, not(feature = "std")))]
                created_at: Duration
        ) -> Result<InvoiceBuilder, SemanticError> {
                if self.features().requires_unknown_bits() {
                        return Err(SemanticError::UnknownRequiredFeatures);
                }
 
-               #[cfg(feature = "std")]
+               #[cfg(all(not(test), feature = "std"))]
                let created_at = std::time::SystemTime::now()
                        .duration_since(std::time::SystemTime::UNIX_EPOCH)
                        .expect("SystemTime::now() should come after SystemTime::UNIX_EPOCH");