From ef01ce1e28f5796d4439fb599207a4c1019ba15a Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Mon, 18 Nov 2024 11:01:19 +0100 Subject: [PATCH] ffi: bump `uniffi` to 0.28.3 * Temp remove uniffi tests due to issues with MSRV and uniffi 0.28.3 Signed-off-by: Yuki Kishimoto --- Cargo.lock | 34 +++++++++---------- bindings/nostr-sdk-ffi/Cargo.toml | 5 +-- bindings/nostr-sdk-ffi/tests/test_equality.py | 23 ------------- .../tests/test_generated_bindings.rs | 5 --- bindings/nostr-sdk-ffi/tests/test_nip05.py | 14 -------- .../nostr-sdk-ffi/tests/test_to_string.py | 8 ----- 6 files changed, 17 insertions(+), 72 deletions(-) delete mode 100644 bindings/nostr-sdk-ffi/tests/test_equality.py delete mode 100644 bindings/nostr-sdk-ffi/tests/test_generated_bindings.rs delete mode 100644 bindings/nostr-sdk-ffi/tests/test_nip05.py delete mode 100644 bindings/nostr-sdk-ffi/tests/test_to_string.py diff --git a/Cargo.lock b/Cargo.lock index 7d5adc8a6..4f905221c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6404,9 +6404,9 @@ checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "uniffi" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31bff6daf87277a9014bcdefbc2842b0553392919d1096843c5aad899ca4588" +checksum = "4cb08c58c7ed7033150132febe696bef553f891b1ede57424b40d87a89e3c170" dependencies = [ "anyhow", "camino", @@ -6418,9 +6418,9 @@ dependencies = [ [[package]] name = "uniffi_bindgen" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96061d7e01b185aa405f7c9b134741ab3e50cc6796a47d6fd8ab9a5364b5feed" +checksum = "cade167af943e189a55020eda2c314681e223f1e42aca7c4e52614c2b627698f" dependencies = [ "anyhow", "askama", @@ -6436,15 +6436,14 @@ dependencies = [ "textwrap", "toml 0.5.11", "uniffi_meta", - "uniffi_testing", "uniffi_udl", ] [[package]] name = "uniffi_checksum_derive" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fcfa22f55829d3aaa7acfb1c5150224188fe0f27c59a8a3eddcaa24d1ffbe58" +checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" dependencies = [ "quote", "syn 2.0.77", @@ -6452,14 +6451,13 @@ dependencies = [ [[package]] name = "uniffi_core" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3210d57d6ab6065ab47a2898dacdb7c606fd6a4156196831fa3bf82e34ac58a6" +checksum = "bc7687007d2546c454d8ae609b105daceb88175477dac280707ad6d95bcd6f1f" dependencies = [ "anyhow", "async-compat", "bytes", - "camino", "log", "once_cell", "paste", @@ -6468,9 +6466,9 @@ dependencies = [ [[package]] name = "uniffi_macros" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58691741080935437dc862122e68d7414432a11824ac1137868de46181a0bd2" +checksum = "12c65a5b12ec544ef136693af8759fb9d11aefce740fb76916721e876639033b" dependencies = [ "bincode", "camino", @@ -6486,9 +6484,9 @@ dependencies = [ [[package]] name = "uniffi_meta" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7663eacdbd9fbf4a88907ddcfe2e6fa85838eb6dc2418a7d91eebb3786f8e20b" +checksum = "4a74ed96c26882dac1ca9b93ca23c827e284bacbd7ec23c6f0b0372f747d59e4" dependencies = [ "anyhow", "bytes", @@ -6498,9 +6496,9 @@ dependencies = [ [[package]] name = "uniffi_testing" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f922465f7566f25f8fe766920205fdfa9a3fcdc209c6bfb7557f0b5bf45b04dd" +checksum = "6a6f984f0781f892cc864a62c3a5c60361b1ccbd68e538e6c9fbced5d82268ac" dependencies = [ "anyhow", "camino", @@ -6511,9 +6509,9 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef408229a3a407fafa4c36dc4f6ece78a6fb258ab28d2b64bddd49c8cb680f6" +checksum = "037820a4cfc4422db1eaa82f291a3863c92c7d1789dc513489c36223f9b4cdfc" dependencies = [ "anyhow", "textwrap", diff --git a/bindings/nostr-sdk-ffi/Cargo.toml b/bindings/nostr-sdk-ffi/Cargo.toml index 6563f7c87..1ef38634f 100644 --- a/bindings/nostr-sdk-ffi/Cargo.toml +++ b/bindings/nostr-sdk-ffi/Cargo.toml @@ -25,10 +25,7 @@ nostr-relay-builder.workspace = true nostr-sdk = { workspace = true, default-features = false, features = ["all-nips", "tor"] } tracing = { workspace = true, features = ["std"] } tracing-subscriber.workspace = true -uniffi = { version = "=0.28.0", features = ["cli", "tokio"] } # cli feature is required for the `uniffi-bindgen` binary +uniffi = { version = "=0.28.3", default-features = false, features = ["cli", "tokio"] } # cli feature is required for the `uniffi-bindgen` binary [target.'cfg(target_os = "android")'.dependencies] paranoid-android = "0.2" - -[dev-dependencies] -uniffi = { version = "=0.28.0", features = ["bindgen-tests"] } diff --git a/bindings/nostr-sdk-ffi/tests/test_equality.py b/bindings/nostr-sdk-ffi/tests/test_equality.py deleted file mode 100644 index 6387fb1b5..000000000 --- a/bindings/nostr-sdk-ffi/tests/test_equality.py +++ /dev/null @@ -1,23 +0,0 @@ -from nostr_sdk import * - -# Test PublicKey -pk1 = PublicKey.from_hex("b2d670de53b27691c0c3400225b65c35a26d06093bcc41f48ffc71e0907f9d4a") -pk2 = PublicKey.from_hex("b2d670de53b27691c0c3400225b65c35a26d06093bcc41f48ffc71e0907f9d4a") -pk3 = PublicKey.from_hex("3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d") - -assert pk1 == pk2 -assert pk1 != pk3 - -# Test EventId -id1 = EventId.from_hex("7469af3be8c8e06e1b50ef1caceba30392ddc0b6614507398b7d7daa4c218e96") -id2 = EventId.from_hex("7469af3be8c8e06e1b50ef1caceba30392ddc0b6614507398b7d7daa4c218e96") - -assert id1 == id2 - -# Test Kind -k1 = Kind(1) -k2 = Kind(1) -k3 = Kind(4) - -assert k1 == k2 -assert k1 != k3 diff --git a/bindings/nostr-sdk-ffi/tests/test_generated_bindings.rs b/bindings/nostr-sdk-ffi/tests/test_generated_bindings.rs deleted file mode 100644 index c71343a38..000000000 --- a/bindings/nostr-sdk-ffi/tests/test_generated_bindings.rs +++ /dev/null @@ -1,5 +0,0 @@ -uniffi::build_foreign_language_testcases!( - "tests/test_equality.py", - "tests/test_nip05.py", - "tests/test_to_string.py", -); diff --git a/bindings/nostr-sdk-ffi/tests/test_nip05.py b/bindings/nostr-sdk-ffi/tests/test_nip05.py deleted file mode 100644 index 5a7bf239f..000000000 --- a/bindings/nostr-sdk-ffi/tests/test_nip05.py +++ /dev/null @@ -1,14 +0,0 @@ -import asyncio -from nostr_sdk import * - -async def main(): - nip_05 = "yuki@yukikishimoto.com" - public_key = PublicKey.parse("npub1drvpzev3syqt0kjrls50050uzf25gehpz9vgdw08hvex7e0vgfeq0eseet") - proxy = None - if await verify_nip05(public_key, nip_05, proxy): - print(f" '{nip_05}' verified, for {public_key.to_bech32()}") - else: - print(f" Unable to verify NIP05, for {public_key.to_bech32()}") - -if __name__ == '__main__': - asyncio.run(main()) diff --git a/bindings/nostr-sdk-ffi/tests/test_to_string.py b/bindings/nostr-sdk-ffi/tests/test_to_string.py deleted file mode 100644 index 1036b5ce4..000000000 --- a/bindings/nostr-sdk-ffi/tests/test_to_string.py +++ /dev/null @@ -1,8 +0,0 @@ -from nostr_sdk import * - -addr = "30023:aa4fc8665f5696e33db7e1a572e3b0f5b3d615837b0f362dcb1c8068b098c7b4:ipsum" -coordinate = Coordinate.parse(addr) -assert addr == coordinate.__str__() - -t_kind = TagKind.NONCE() -assert tag_kind_to_string(t_kind) == "nonce"