Skip to content

Commit

Permalink
Merge pull request #1 from getAlby/downgrade-uniffi
Browse files Browse the repository at this point in the history
Downgrade uniffi dependency to version 0.25.3.
  • Loading branch information
rolznz authored Feb 28, 2024
2 parents 87c0266 + f91b06f commit 92de54a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ futures = "0.3"
tokio = { version = "1", default-features = false, features = [ "rt-multi-thread", "time", "sync" ] }
esplora-client = { version = "0.6", default-features = false }
libc = "0.2"
uniffi = { version = "0.26.0", features = ["build"], optional = true }
uniffi = { version = "0.25.3", features = ["build"], optional = true }

[target.'cfg(vss)'.dependencies]
vss-client = "0.2"
Expand All @@ -95,7 +95,7 @@ electrsd = { version = "0.26.0", features = ["legacy"] }
clightningrpc = { version = "0.3.0-beta.8", default-features = false }

[build-dependencies]
uniffi = { version = "0.26.0", features = ["build"], optional = true }
uniffi = { version = "0.25.3", features = ["build"], optional = true }

[profile.release]
panic = "abort"
Expand Down
21 changes: 12 additions & 9 deletions bindings/ldk_node.udl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ interface LDKNode {
void stop();
Event? next_event();
Event wait_next_event();
[Async]
Event next_event_async();
// [Async]
// Event next_event_async();
void event_handled();
PublicKey node_id();
sequence<SocketAddress>? listening_addresses();
Expand Down Expand Up @@ -211,13 +211,16 @@ dictionary PaymentDetails {
LSPFeeLimits? lsp_fee_limits;
};

[NonExhaustive]
enum Network {
"Bitcoin",
"Testnet",
"Signet",
"Regtest",
};
// [NonExhaustive]
// enum Network {
// "Bitcoin",
// "Testnet",
// "Signet",
// "Regtest",
// };

[Custom]
typedef string Network;

dictionary OutPoint {
Txid txid;
Expand Down
2 changes: 1 addition & 1 deletion bindings/uniffi-bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
uniffi = { version = "0.26.0", features = ["cli"] }
uniffi = { version = "0.25.3", features = ["cli"] }
11 changes: 11 additions & 0 deletions src/uniffi_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,14 @@ impl UniffiCustomTypeConverter for UntrustedString {
obj.to_string()
}
}

impl UniffiCustomTypeConverter for Network {
type Builtin = String;
fn into_custom(val: Self::Builtin) -> uniffi::Result<Self> {
Ok(Network::from_str(&val).map_err(|_| Error::InvalidNetwork)?)
}

fn from_custom(obj: Self) -> Self::Builtin {
obj.to_string()
}
}

0 comments on commit 92de54a

Please sign in to comment.