Skip to content

Commit

Permalink
Move UniFFI-specific re-exports to uniffi_types.rs
Browse files Browse the repository at this point in the history
.. which declutters our `lib.rs` imports a bit.
  • Loading branch information
tnull committed Feb 22, 2024
1 parent 50e6283 commit c99dc15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
10 changes: 1 addition & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,7 @@ pub use types::ChannelConfig;
pub use io::utils::generate_entropy_mnemonic;

#[cfg(feature = "uniffi")]
use {
bip39::Mnemonic,
bitcoin::OutPoint,
lightning::events::{ClosureReason, PaymentFailureReason},
lightning::ln::ChannelId,
lightning::ln::PaymentSecret,
lightning::util::string::UntrustedString,
uniffi_types::*,
};
use uniffi_types::*;

#[cfg(feature = "uniffi")]
pub use builder::ArcedNodeBuilder as Builder;
Expand Down
14 changes: 10 additions & 4 deletions src/uniffi_types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
pub use lightning::events::{ClosureReason, PaymentFailureReason};
pub use lightning::ln::ChannelId;
pub use lightning::ln::PaymentSecret;
pub use lightning::util::string::UntrustedString;

pub use bitcoin::OutPoint;

pub use bip39::Mnemonic;

use crate::UniffiCustomTypeConverter;

use crate::error::Error;
Expand All @@ -9,12 +18,9 @@ use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::hashes::Hash;
use bitcoin::secp256k1::PublicKey;
use bitcoin::{Address, Txid};
use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
use lightning::util::string::UntrustedString;
use lightning::ln::{PaymentHash, PaymentPreimage};
use lightning_invoice::{Bolt11Invoice, SignedRawBolt11Invoice};

use bip39::Mnemonic;

use std::convert::TryInto;
use std::str::FromStr;

Expand Down

0 comments on commit c99dc15

Please sign in to comment.