Skip to content

Commit

Permalink
Drop unnecessary LDKNode type alias completely
Browse files Browse the repository at this point in the history
... now that we don't have any generic to hide, we can just use the
`Node` type directly.
  • Loading branch information
tnull committed Feb 7, 2024
1 parent 9cf5423 commit 2eefafc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ interface Builder {
[Throws=BuildError]
void set_listening_addresses(sequence<SocketAddress> listening_addresses);
[Throws=BuildError]
LDKNode build();
Node build();
};

interface LDKNode {
interface Node {
[Throws=NodeError]
void start();
[Throws=NodeError]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub use types::ChannelConfig;
pub use io::utils::generate_entropy_mnemonic;

#[cfg(feature = "uniffi")]
use {bip39::Mnemonic, bitcoin::OutPoint, lightning::ln::PaymentSecret, uniffi_types::*};
use {bip39::Mnemonic, bitcoin::OutPoint, lightning::ln::PaymentSecret};

#[cfg(feature = "uniffi")]
pub use builder::ArcedNodeBuilder as Builder;
Expand Down
6 changes: 1 addition & 5 deletions src/uniffi_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::UniffiCustomTypeConverter;

use crate::error::Error;
use crate::hex_utils;
use crate::{Node, SocketAddress, UserChannelId};
use crate::{SocketAddress, UserChannelId};

use bitcoin::hashes::sha256::Hash as Sha256;
use bitcoin::hashes::Hash;
Expand All @@ -16,10 +16,6 @@ use bip39::Mnemonic;
use std::convert::TryInto;
use std::str::FromStr;

/// This type alias is required as Uniffi doesn't support generics, i.e., we can only expose the
/// concretized types via this aliasing hack.
pub type LDKNode = Node;

impl UniffiCustomTypeConverter for PublicKey {
type Builtin = String;

Expand Down

0 comments on commit 2eefafc

Please sign in to comment.