use lightning::routing::router::RouteHintHop;
use secp256k1::Secp256k1;
use secp256k1::{SecretKey, PublicKey};
- use std::time::{UNIX_EPOCH, Duration};
+ use std::time::Duration;
let secp_ctx = Secp256k1::new();
assert_eq!(invoice.currency(), Currency::BitcoinTestnet);
#[cfg(feature = "std")]
assert_eq!(
- invoice.timestamp().duration_since(UNIX_EPOCH).unwrap().as_secs(),
+ invoice.timestamp().duration_since(SystemTime::UNIX_EPOCH).unwrap().as_secs(),
1234567
);
assert_eq!(invoice.payee_pub_key(), Some(&public_key));
use super::*;
use crate::{InvoiceBuilder, Currency};
use bitcoin::hashes::sha256::Hash as Sha256;
- use lightning::events::Event;
- use lightning::ln::channelmanager::{Retry, PaymentId};
- use lightning::ln::msgs::ChannelMessageHandler;
use lightning::ln::PaymentSecret;
- use lightning::ln::functional_test_utils::*;
use lightning::routing::router::Payee;
use secp256k1::{SecretKey, PublicKey, Secp256k1};
- use std::time::{SystemTime, Duration};
+ use core::time::Duration;
+ #[cfg(feature = "std")]
+ use std::time::SystemTime;
fn duration_since_epoch() -> Duration {
#[cfg(feature = "std")]
#[test]
#[cfg(feature = "std")]
fn payment_metadata_end_to_end() {
+ use lightning::events::Event;
+ use lightning::ln::channelmanager::{Retry, PaymentId};
+ use lightning::ln::msgs::ChannelMessageHandler;
+ use lightning::ln::functional_test_utils::*;
// Test that a payment metadata read from an invoice passed to `pay_invoice` makes it all
// the way out through the `PaymentClaimable` event.
let chanmon_cfgs = create_chanmon_cfgs(2);
#[cfg(test)]
mod test {
- use core::cell::RefCell;
use core::time::Duration;
use crate::{Currency, Description, Bolt11InvoiceDescription, SignOrCreationError, CreationError};
use bitcoin::hashes::{Hash, sha256};
use bitcoin::hashes::sha256::Hash as Sha256;
use lightning::sign::PhantomKeysManager;
- use lightning::events::{MessageSendEvent, MessageSendEventsProvider, Event, EventsProvider};
- use lightning::ln::{PaymentPreimage, PaymentHash};
+ use lightning::events::{MessageSendEvent, MessageSendEventsProvider};
+ use lightning::ln::PaymentHash;
+ #[cfg(feature = "std")]
+ use lightning::ln::PaymentPreimage;
use lightning::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
use lightning::ln::functional_test_utils::*;
use lightning::ln::msgs::ChannelMessageHandler;
#[cfg(feature = "std")]
fn do_test_multi_node_receive(user_generated_pmt_hash: bool) {
+ use lightning::events::{Event, EventsProvider};
+ use core::cell::RefCell;
+
let mut chanmon_cfgs = create_chanmon_cfgs(3);
let seed_1 = [42u8; 32];
let seed_2 = [43u8; 32];